net/mlx4_en: Resolve dividing by zero in 32-bit system
[cascardo/linux.git] / security / tomoyo / domain.c
index 3865145..ade7c6c 100644 (file)
@@ -874,7 +874,14 @@ bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos,
        }
        /* Same with get_arg_page(bprm, pos, 0) in fs/exec.c */
 #ifdef CONFIG_MMU
-       if (get_user_pages(current, bprm->mm, pos, 1, 0, 1, &page, NULL) <= 0)
+       /*
+        * This is called at execve() time in order to dig around
+        * in the argv/environment of the new proceess
+        * (represented by bprm).  'current' is the process doing
+        * the execve().
+        */
+       if (get_user_pages_remote(current, bprm->mm, pos, 1,
+                               0, 1, &page, NULL) <= 0)
                return false;
 #else
        page = bprm->page[pos / PAGE_SIZE];