Skip to content

Commit 3ec18fc

Browse files
Sven Schnellehdeller
authored andcommitted
parisc/entry: fix trace test in syscall exit path
commit 8779e05 ("parisc: Fix ptrace check on syscall return") fixed testing of TI_FLAGS. This uncovered a bug in the test mask. syscall_restore_rfi is only used when the kernel needs to exit to usespace with single or block stepping and the recovery counter enabled. The test however used _TIF_SYSCALL_TRACE_MASK, which includes a lot of bits that shouldn't be tested here. Fix this by using TIF_SINGLESTEP and TIF_BLOCKSTEP directly. I encountered this bug by enabling syscall tracepoints. Both in qemu and on real hardware. As soon as i enabled the tracepoint (sys_exit_read, but i guess it doesn't really matter which one), i got random page faults in userspace almost immediately. Signed-off-by: Sven Schnelle <svens@stackframe.org> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 38860b2 commit 3ec18fc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/parisc/kernel/entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ syscall_restore:
18051805

18061806
/* Are we being ptraced? */
18071807
LDREG TASK_TI_FLAGS(%r1),%r19
1808-
ldi _TIF_SYSCALL_TRACE_MASK,%r2
1808+
ldi _TIF_SINGLESTEP|_TIF_BLOCKSTEP,%r2
18091809
and,COND(=) %r19,%r2,%r0
18101810
b,n syscall_restore_rfi
18111811

0 commit comments

Comments
 (0)