]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
parisc/entry: fix trace test in syscall exit path
authorSven Schnelle <svens@stackframe.org>
Sat, 13 Nov 2021 19:41:17 +0000 (20:41 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 13 Jan 2022 17:42:48 +0000 (18:42 +0100)
commit06e786ba5bab8d3324396abdbc840a4760a46988
treee46fd56c1494cfdd8acef0258bfbc8fd3f3b0778
parent6e74c25b14ce5423a3768229d89bb6f6d26598e7
parisc/entry: fix trace test in syscall exit path

BugLink: https://bugs.launchpad.net/bugs/1954828
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/parisc/kernel/entry.S