|
@@ -251,6 +251,9 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
|
|
|
return -EINVAL;
|
|
|
address -= key->both.offset;
|
|
|
|
|
|
+ if (unlikely(!access_ok(rw, uaddr, sizeof(u32))))
|
|
|
+ return -EFAULT;
|
|
|
+
|
|
|
/*
|
|
|
* PROCESS_PRIVATE futexes are fast.
|
|
|
* As the mm cannot disappear under us and the 'key' only needs
|
|
@@ -259,8 +262,6 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
|
|
|
* but access_ok() should be faster than find_vma()
|
|
|
*/
|
|
|
if (!fshared) {
|
|
|
- if (unlikely(!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))))
|
|
|
- return -EFAULT;
|
|
|
key->private.mm = mm;
|
|
|
key->private.address = address;
|
|
|
get_futex_key_refs(key);
|