]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - security/security.c
nfsd: fix vm overcommit crash
[linux-2.6-omap-h63xx.git] / security / security.c
index 255b08559b2b62e057d5fda7a8b4396b2bdbb065..c0acfa7177e5d1a01d19375f94bfa1ff819637a3 100644 (file)
@@ -198,14 +198,23 @@ int security_settime(struct timespec *ts, struct timezone *tz)
 
 int security_vm_enough_memory(long pages)
 {
+       WARN_ON(current->mm == NULL);
        return security_ops->vm_enough_memory(current->mm, pages);
 }
 
 int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
 {
+       WARN_ON(mm == NULL);
        return security_ops->vm_enough_memory(mm, pages);
 }
 
+int security_vm_enough_memory_kern(long pages)
+{
+       /* If current->mm is a kernel thread then we will pass NULL,
+          for this specific case that is fine */
+       return security_ops->vm_enough_memory(current->mm, pages);
+}
+
 int security_bprm_alloc(struct linux_binprm *bprm)
 {
        return security_ops->bprm_alloc_security(bprm);