| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
|---|
| 3 | 3 | |
|---|
| 4 | 4 | #ifndef __NDS32_FUTEX_H__ |
|---|
| .. | .. |
|---|
| 40 | 40 | int ret = 0; |
|---|
| 41 | 41 | u32 val, tmp, flags; |
|---|
| 42 | 42 | |
|---|
| 43 | | - if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
|---|
| 43 | + if (!access_ok(uaddr, sizeof(u32))) |
|---|
| 44 | 44 | return -EFAULT; |
|---|
| 45 | 45 | |
|---|
| 46 | 46 | smp_mb(); |
|---|
| .. | .. |
|---|
| 66 | 66 | { |
|---|
| 67 | 67 | int oldval = 0, ret; |
|---|
| 68 | 68 | |
|---|
| 69 | | - |
|---|
| 70 | | - pagefault_disable(); |
|---|
| 69 | + if (!access_ok(uaddr, sizeof(u32))) |
|---|
| 70 | + return -EFAULT; |
|---|
| 71 | 71 | switch (op) { |
|---|
| 72 | 72 | case FUTEX_OP_SET: |
|---|
| 73 | 73 | __futex_atomic_op("move %0, %3", ret, oldval, tmp, uaddr, |
|---|
| .. | .. |
|---|
| 92 | 92 | default: |
|---|
| 93 | 93 | ret = -ENOSYS; |
|---|
| 94 | 94 | } |
|---|
| 95 | | - |
|---|
| 96 | | - pagefault_enable(); |
|---|
| 97 | 95 | |
|---|
| 98 | 96 | if (!ret) |
|---|
| 99 | 97 | *oval = oldval; |
|---|