Commit 817be129 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds
Browse files

mm: validate get_user_pages_fast flags

We can only deal with FOLL_WRITE and/or FOLL_LONGTERM in
get_user_pages_fast, so reject all other flags.


Signed-off-by: default avatarChristoph Hellwig <>
Cc: Andrey Konovalov <>
Cc: Benjamin Herrenschmidt <>
Cc: David Miller <>
Cc: James Hogan <>
Cc: Jason Gunthorpe <>
Cc: Khalid Aziz <>
Cc: Michael Ellerman <>
Cc: Nicholas Piggin <>
Cc: Paul Burton <>
Cc: Paul Mackerras <>
Cc: Ralf Baechle <>
Cc: Rich Felker <>
Cc: Yoshinori Sato <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 050a9adc
......@@ -2317,6 +2317,9 @@ int get_user_pages_fast(unsigned long start, int nr_pages,
unsigned long addr, len, end;
int nr = 0, ret = 0;
return -EINVAL;
start = untagged_addr(start) & PAGE_MASK;
addr = start;
len = (unsigned long) nr_pages << PAGE_SHIFT;
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