Commit 626379c9 authored by Jann Horn's avatar Jann Horn Committed by Stephen Rothwell
Browse files

mm/gup: assert that the mmap lock is held in __get_user_pages()

After having cleaned up all GUP callers (except for the atomisp staging
driver, which currently gets mmap locking completely wrong [1]) to always
ensure that they hold the mmap lock when calling into GUP (unless the mm
is not yet globally visible), add an assertion to make sure it stays that
way going forward.



Signed-off-by: default avatarJann Horn <>
Reviewed-by: default avatarJason Gunthorpe <>
Acked-by: default avatarMichel Lespinasse <>
Cc: "Eric W . Biederman" <>
Cc: John Hubbard <>
Cc: Mauro Carvalho Chehab <>
Cc: Sakari Ailus <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarStephen Rothwell <>
parent 517a97fc
......@@ -1027,6 +1027,8 @@ static long __get_user_pages(struct mm_struct *mm,
struct vm_area_struct *vma = NULL;
struct follow_page_context ctx = { NULL };
if (!nr_pages)
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment