hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/arc/include/asm/futex.h
....@@ -1,9 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 *
85 * Vineetg: August 2010: From Android kernel work
96 */
....@@ -78,10 +75,12 @@
7875 {
7976 int oldval = 0, ret;
8077
78
+ if (!access_ok(uaddr, sizeof(u32)))
79
+ return -EFAULT;
80
+
8181 #ifndef CONFIG_ARC_HAS_LLSC
8282 preempt_disable(); /* to guarantee atomic r-m-w of futex op */
8383 #endif
84
- pagefault_disable();
8584
8685 switch (op) {
8786 case FUTEX_OP_SET:
....@@ -104,7 +103,6 @@
104103 ret = -ENOSYS;
105104 }
106105
107
- pagefault_enable();
108106 #ifndef CONFIG_ARC_HAS_LLSC
109107 preempt_enable();
110108 #endif
....@@ -126,7 +124,7 @@
126124 int ret = 0;
127125 u32 existval;
128126
129
- if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
127
+ if (!access_ok(uaddr, sizeof(u32)))
130128 return -EFAULT;
131129
132130 #ifndef CONFIG_ARC_HAS_LLSC