提交 aa715284 编写于 作者: T Thomas Gleixner

futex: request only one page from get_user_pages()

Yanmin noticed that fault_in_user_writeable() requests 4 pages instead
of one.

That's the result of blindly trusting Linus' proposal :) I even looked
up the prototype to verify the correctness: the argument in question
is confusingly enough named "len" while in reality it means number of
pages.
Pointed-out-by: NYanmin Zhang <yanmin_zhang@linux.intel.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 28d0325c
...@@ -299,7 +299,7 @@ void put_futex_key(int fshared, union futex_key *key) ...@@ -299,7 +299,7 @@ void put_futex_key(int fshared, union futex_key *key)
static int fault_in_user_writeable(u32 __user *uaddr) static int fault_in_user_writeable(u32 __user *uaddr)
{ {
int ret = get_user_pages(current, current->mm, (unsigned long)uaddr, int ret = get_user_pages(current, current->mm, (unsigned long)uaddr,
sizeof(*uaddr), 1, 0, NULL, NULL); 1, 1, 0, NULL, NULL);
return ret < 0 ? ret : 0; return ret < 0 ? ret : 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册