]> www.infradead.org Git - users/willy/pagecache.git/commit
mmap locking API: don't check locking if the mm isn't live yet
authorJann Horn <jannh@google.com>
Tue, 24 Nov 2020 05:45:20 +0000 (16:45 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 24 Nov 2020 06:12:26 +0000 (17:12 +1100)
commit517a97fcb687bb35c3ffa28fbf3dd056e27f69d0
treeabc7840163f063e2c9984c8a1dd0af558553bca5
parentb9aed4a2cef9ed6aeeab4253aa88349b5c90fffa
mmap locking API: don't check locking if the mm isn't live yet

In preparation for adding a mmap_assert_locked() check in
__get_user_pages(), teach the mmap_assert_*locked() helpers that it's fine
to operate on an mm without locking in the middle of execve() as long as
it hasn't been installed on a process yet.

Existing code paths that do this are (reverse callgraph):

  get_user_pages_remote
    get_arg_page
      copy_strings
      copy_string_kernel
      remove_arg_zero
    tomoyo_dump_page
      tomoyo_print_bprm
      tomoyo_scan_bprm
      tomoyo_environ

Link: https://lkml.kernel.org/r/CAG48ez03YJG9JU_6tGiMcaVjuTyRE_o4LEQ7901b5ZoCnNAjcg@mail.gmail.com
Signed-off-by: Jann Horn <jannh@google.com>
Cc: "Eric W . Biederman" <ebiederm@xmission.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Michel Lespinasse <walken@google.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/exec.c
include/linux/mm_types.h
include/linux/mmap_lock.h