Thread (12 messages) flat view 12 messages, 2 authors, 2015-12-21

Re: [PATCH v1 1/4] um: Fix ptrace GETREGS/SETREGS bugs

From: Richard Weinberger <richard@nod.at>
Date: 2015-12-21 10:13:44
Also in: linux-um, lkml

Am 21.12.2015 um 10:23 schrieb Mickaël Salaün:
quoted
quoted
quoted
Doesn't this break the support for changing syscall numbers using PTRACE_SETREGS?
The logic is unchanged except updating the UPT_SYSCALL_NR before syscall_trace_enter(). I did my last tests with the x86_32 subarchitecture and all tests (from selftest/seccomp), including PTRACE_SETREGS for syscall numbers tests, passed. However, 2 of this tests still fail for x86_64 (only).
No, the logic is different.
syscall_trace_enter(regs) enters the ptrace() path and here registers can be changed.
Hence "syscall = UPT_SYSCALL_NR(r);" will see the old syscall number.
UPT_SYSCALL_NR() returns the syscall number before the ptrace() path...
The thing is, PTRACE_SETREGS give access to *orig_ax* in the user_regs_struct from arch/x86/include/asm/user_*.h and selftest/seccomp only update this (virtual) register, not the EAX/RAX. Am I missing something?
Sorry, meant orig...

Please see the attached program. It proves that your patch is breaking stuff.
The test is extracted from UML's selftests.

Thanks,
//richard

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help