acrn-kernel/arch/arm/kernel
Kees Cook 085fe43238 ARM: ptrace: Restore syscall skipping for tracers
[ Upstream commit 4697b5848b ]

Since commit 4e57a4ddf6 ("ARM: 9107/1: syscall: always store
thread_info->abi_syscall"), the seccomp selftests "syscall_errno"
and "syscall_faked" have been broken. Both seccomp and PTRACE depend
on using the special value of "-1" for skipping syscalls. This value
wasn't working because it was getting masked by __NR_SYSCALL_MASK in
both PTRACE_SET_SYSCALL and get_syscall_nr().

Explicitly test for -1 in PTRACE_SET_SYSCALL and get_syscall_nr(),
leaving it exposed when present, allowing tracers to skip syscalls
again.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Fixes: 4e57a4ddf6 ("ARM: 9107/1: syscall: always store thread_info->abi_syscall")
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230810195422.2304827-2-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-13 09:42:28 +02:00
..
.gitignore
Makefile
arch_timer.c
armksyms.c
asm-offsets.c
atags.h
atags_compat.c
atags_parse.c
atags_proc.c
bios32.c
bugs.c
cpuidle.c
crash_dump.c
debug.S
devtree.c
dma.c
early_printk.c
efi.c
elf.c
entry-armv.S
entry-common.S ARM: ptrace: Restore syscall restart tracing 2023-09-13 09:42:28 +02:00
entry-ftrace.S
entry-header.S
entry-v7m.S
fiq.c
fiqasm.S
ftrace.c
head-common.S
head-inflate-data.c
head-nommu.S
head.S
hibernate.c
hw_breakpoint.c
hyp-stub.S
insn.c
io.c
irq.c
isa.c
iwmmxt.S
iwmmxt.h
jump_label.c
kgdb.c
machine_kexec.c
module-plts.c ARM: module: Use module_init_layout_section() to spot init sections 2023-09-02 09:16:19 +02:00
module.c
opcodes.c
paravirt.c
patch.c
perf_callchain.c
perf_event_v6.c
perf_event_v7.c
perf_event_xscale.c
perf_regs.c
phys2virt.S
pj4-cp0.c
process.c
psci_smp.c
ptrace.c ARM: ptrace: Restore syscall skipping for tracers 2023-09-13 09:42:28 +02:00
reboot.c
reboot.h
relocate_kernel.S
return_address.c
setup.c
signal.c
signal.h
sigreturn_codes.S
sleep.S
smccc-call.S
smp.c
smp_scu.c
smp_tlb.c
smp_twd.c
spectre.c
stacktrace.c
suspend.c
swp_emulate.c
sys_arm.c
sys_oabi-compat.c
tcm.c
thumbee.c
time.c
topology.c
traps.c
unwind.c
v7m.c
vdso.c
vmlinux-xip.lds.S
vmlinux.lds.S
xscale-cp0.c