| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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. |
|---|
| 7 | 4 | * |
|---|
| 8 | 5 | * Vineetg: August 2010: From Android kernel work |
|---|
| 9 | 6 | */ |
|---|
| .. | .. |
|---|
| 78 | 75 | { |
|---|
| 79 | 76 | int oldval = 0, ret; |
|---|
| 80 | 77 | |
|---|
| 78 | + if (!access_ok(uaddr, sizeof(u32))) |
|---|
| 79 | + return -EFAULT; |
|---|
| 80 | + |
|---|
| 81 | 81 | #ifndef CONFIG_ARC_HAS_LLSC |
|---|
| 82 | 82 | preempt_disable(); /* to guarantee atomic r-m-w of futex op */ |
|---|
| 83 | 83 | #endif |
|---|
| 84 | | - pagefault_disable(); |
|---|
| 85 | 84 | |
|---|
| 86 | 85 | switch (op) { |
|---|
| 87 | 86 | case FUTEX_OP_SET: |
|---|
| .. | .. |
|---|
| 104 | 103 | ret = -ENOSYS; |
|---|
| 105 | 104 | } |
|---|
| 106 | 105 | |
|---|
| 107 | | - pagefault_enable(); |
|---|
| 108 | 106 | #ifndef CONFIG_ARC_HAS_LLSC |
|---|
| 109 | 107 | preempt_enable(); |
|---|
| 110 | 108 | #endif |
|---|
| .. | .. |
|---|
| 126 | 124 | int ret = 0; |
|---|
| 127 | 125 | u32 existval; |
|---|
| 128 | 126 | |
|---|
| 129 | | - if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
|---|
| 127 | + if (!access_ok(uaddr, sizeof(u32))) |
|---|
| 130 | 128 | return -EFAULT; |
|---|
| 131 | 129 | |
|---|
| 132 | 130 | #ifndef CONFIG_ARC_HAS_LLSC |
|---|