forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/arch/arm64/kernel/sys_compat.c
....@@ -1,21 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Based on arch/arm/kernel/sys_arm.c
34 *
45 * Copyright (C) People who wrote linux/arch/i386/kernel/sys_i386.c
56 * Copyright (C) 1995, 1996 Russell King.
67 * Copyright (C) 2012 ARM Ltd.
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
198 */
209
2110 #include <linux/compat.h>
....@@ -69,7 +58,7 @@
6958 if (end < start || flags)
7059 return -EINVAL;
7160
72
- if (!access_ok(VERIFY_READ, (const void __user *)start, end - start))
61
+ if (!access_ok((const void __user *)start, end - start))
7362 return -EFAULT;
7463
7564 return __do_compat_cache_op(start, end);
....@@ -79,7 +68,7 @@
7968 */
8069 long compat_arm_syscall(struct pt_regs *regs, int scno)
8170 {
82
- siginfo_t info;
71
+ unsigned long addr;
8372
8473 switch (scno) {
8574 /*
....@@ -122,13 +111,9 @@
122111 break;
123112 }
124113
125
- clear_siginfo(&info);
126
- info.si_signo = SIGILL;
127
- info.si_errno = 0;
128
- info.si_code = ILL_ILLTRP;
129
- info.si_addr = (void __user *)instruction_pointer(regs) -
130
- (compat_thumb_mode(regs) ? 2 : 4);
114
+ addr = instruction_pointer(regs) - (compat_thumb_mode(regs) ? 2 : 4);
131115
132
- arm64_notify_die("Oops - bad compat syscall(2)", regs, &info, scno);
116
+ arm64_notify_die("Oops - bad compat syscall(2)", regs,
117
+ SIGILL, ILL_ILLTRP, addr, 0);
133118 return 0;
134119 }