From: Greg Kroah-Hartman Date: Fri, 19 Nov 2021 13:37:48 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v5.4.161~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b3285e32f2064d3d8d8e91b54ab82049aa3f73e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: parisc-entry-fix-trace-test-in-syscall-exit-path.patch --- diff --git a/queue-4.19/parisc-entry-fix-trace-test-in-syscall-exit-path.patch b/queue-4.19/parisc-entry-fix-trace-test-in-syscall-exit-path.patch new file mode 100644 index 00000000000..8a74492d12a --- /dev/null +++ b/queue-4.19/parisc-entry-fix-trace-test-in-syscall-exit-path.patch @@ -0,0 +1,42 @@ +From 3ec18fc7831e7d79e2d536dd1f3bc0d3ba425e8a Mon Sep 17 00:00:00 2001 +From: Sven Schnelle +Date: Sat, 13 Nov 2021 20:41:17 +0100 +Subject: parisc/entry: fix trace test in syscall exit path + +From: Sven Schnelle + +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 +Signed-off-by: Helge Deller +Signed-off-by: Greg Kroah-Hartman + +--- + arch/parisc/kernel/entry.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- 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 + diff --git a/queue-4.19/series b/queue-4.19/series index 8a64e06d572..dca4dbdcd2e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -250,3 +250,4 @@ fuse-truncate-pagecache-on-atomic_o_trunc.patch x86-cpu-fix-migration-safety-with-x86_bug_null_sel.patch ext4-fix-lazy-initialization-next-schedule-time-computation-in-more-granular-unit.patch fortify-explicitly-disable-clang-support.patch +parisc-entry-fix-trace-test-in-syscall-exit-path.patch