Skip to content

Commit 4286d19

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Bring the PTRACE_SYSEMU semantics in line with the man page. - Annotate variable assignment in get_user() with the type to avoid sparse warnings. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Add get_user() type annotation on the !access_ok() path arm64: Fix PTRACE_SYSEMU semantics
2 parents f5ca7a7 + 8cfb347 commit 4286d19

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

arch/arm64/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ do { \
304304
__p = uaccess_mask_ptr(__p); \
305305
__raw_get_user((x), __p, (err)); \
306306
} else { \
307-
(x) = 0; (err) = -EFAULT; \
307+
(x) = (__force __typeof__(x))0; (err) = -EFAULT; \
308308
} \
309309
} while (0)
310310

arch/arm64/kernel/ptrace.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,10 +1829,11 @@ static void tracehook_report_syscall(struct pt_regs *regs,
18291829

18301830
int syscall_trace_enter(struct pt_regs *regs)
18311831
{
1832-
if (test_thread_flag(TIF_SYSCALL_TRACE) ||
1833-
test_thread_flag(TIF_SYSCALL_EMU)) {
1832+
unsigned long flags = READ_ONCE(current_thread_info()->flags);
1833+
1834+
if (flags & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
18341835
tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
1835-
if (!in_syscall(regs) || test_thread_flag(TIF_SYSCALL_EMU))
1836+
if (!in_syscall(regs) || (flags & _TIF_SYSCALL_EMU))
18361837
return -1;
18371838
}
18381839

0 commit comments

Comments
 (0)