diff options
author | Sven Schnelle <svens@stackframe.org> | 2021-11-13 20:41:17 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-26 11:36:18 +0100 |
commit | bb07fc138e61cef1640fdd136272febc7453b428 (patch) | |
tree | 9e6cba75de2bfd9bb4029970fe65492dd3809e22 /arch/parisc | |
parent | 9000f2a528c0b58deea62a911454323090a67492 (diff) | |
download | linux-stable-bb07fc138e61cef1640fdd136272febc7453b428.tar.gz linux-stable-bb07fc138e61cef1640fdd136272febc7453b428.tar.bz2 linux-stable-bb07fc138e61cef1640fdd136272febc7453b428.zip |
parisc/entry: fix trace test in syscall exit path
commit 3ec18fc7831e7d79e2d536dd1f3bc0d3ba425e8a upstream.
commit 8779e05ba8aa ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/kernel/entry.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index f7e09fbf78f5..e8b503cd54f5 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -1852,7 +1852,7 @@ syscall_restore: /* Are we being ptraced? */ LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 - ldi _TIF_SYSCALL_TRACE_MASK,%r2 + ldi _TIF_SINGLESTEP|_TIF_BLOCKSTEP,%r2 and,COND(=) %r19,%r2,%r0 b,n syscall_restore_rfi |