From: Greg Kroah-Hartman Date: Thu, 12 Jan 2023 12:56:26 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v5.10.163~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=faf6e8ee9dd4927d9b78325dc3cfdfee597f091b;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: serial-fixup-backport-of-serial-deassert-transmit-enable-on-probe-in-driver-specific-way.patch --- diff --git a/queue-5.15/selftests-vm-pkeys-add-a-regression-test-for-setting-pkru-through-ptrace.patch b/queue-5.15/selftests-vm-pkeys-add-a-regression-test-for-setting-pkru-through-ptrace.patch index 01fa7210954..4162f5dbb8f 100644 --- a/queue-5.15/selftests-vm-pkeys-add-a-regression-test-for-setting-pkru-through-ptrace.patch +++ b/queue-5.15/selftests-vm-pkeys-add-a-regression-test-for-setting-pkru-through-ptrace.patch @@ -8,9 +8,7 @@ Message-ID: <20230109210214.71068-7-khuey@kylehuey.com> From: Kyle Huey -From: Kyle Huey - -commit 6ea25770b043 upstream +commit 6ea25770b043c7997ab21d1ce95ba5de4d3d85d9 upstream This tests PTRACE_SETREGSET with NT_X86_XSTATE modifying PKRU directly and removing the PKRU bit from XSTATE_BV. diff --git a/queue-5.15/serial-fixup-backport-of-serial-deassert-transmit-enable-on-probe-in-driver-specific-way.patch b/queue-5.15/serial-fixup-backport-of-serial-deassert-transmit-enable-on-probe-in-driver-specific-way.patch new file mode 100644 index 00000000000..13e17922c67 --- /dev/null +++ b/queue-5.15/serial-fixup-backport-of-serial-deassert-transmit-enable-on-probe-in-driver-specific-way.patch @@ -0,0 +1,60 @@ +From linux@rasmusvillemoes.dk Thu Jan 12 13:40:41 2023 +From: Rasmus Villemoes +Date: Thu, 22 Dec 2022 12:44:14 +0100 +Subject: serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way" +To: "Greg Kroah-Hartman" , "Jiri Slaby" , "Lukas Wunner" , "Dominique Martinet" , "Daisuke Mizobuchi" , "Ilpo Järvinen" +Cc: linux-serial@vger.kernel.org, stable@vger.kernel.org, Rasmus Villemoes +Message-ID: <20221222114414.1886632-1-linux@rasmusvillemoes.dk> + +From: Rasmus Villemoes + +When 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in +driver-specific way") got backported to 5.15.y, there known as +b079d3775237, some hunks were accidentally left out. + +In fsl_lpuart.c, this amounts to uart_remove_one_port() being called +in an error path despite uart_add_one_port() not having been called. + +In serial_core.c, it is possible that the omission in +uart_suspend_port() is harmless, but the backport did have the +corresponding hunk in uart_resume_port(), it runs counter to the +original commit's intention of + + Skip any invocation of ->set_mctrl() if RS485 is enabled. + +and it's certainly better to be aligned with upstream. + +Fixes: b079d3775237 ("serial: Deassert Transmit Enable on probe in driver-specific way") +Signed-off-by: Rasmus Villemoes +Reviewed-by: Dominique MARTINET +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/fsl_lpuart.c | 2 +- + drivers/tty/serial/serial_core.c | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/fsl_lpuart.c ++++ b/drivers/tty/serial/fsl_lpuart.c +@@ -2784,9 +2784,9 @@ static int lpuart_probe(struct platform_ + return 0; + + failed_irq_request: +-failed_get_rs485: + uart_remove_one_port(&lpuart_reg, &sport->port); + failed_attach_port: ++failed_get_rs485: + failed_reset: + lpuart_disable_clks(sport); + return ret; +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -2225,7 +2225,8 @@ int uart_suspend_port(struct uart_driver + + spin_lock_irq(&uport->lock); + ops->stop_tx(uport); +- ops->set_mctrl(uport, 0); ++ if (!(uport->rs485.flags & SER_RS485_ENABLED)) ++ ops->set_mctrl(uport, 0); + ops->stop_rx(uport); + spin_unlock_irq(&uport->lock); + diff --git a/queue-5.15/series b/queue-5.15/series index d74ee0a8d3b..227bb825ad4 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -5,3 +5,4 @@ x86-fpu-add-a-pkru-argument-to-copy_uabi_to_xstate.patch x86-fpu-allow-pkru-to-be-once-again-written-by-ptrace.patch x86-fpu-emulate-xrstor-s-behavior-if-the-xfeatures-pkru-bit-is-not-set.patch selftests-vm-pkeys-add-a-regression-test-for-setting-pkru-through-ptrace.patch +serial-fixup-backport-of-serial-deassert-transmit-enable-on-probe-in-driver-specific-way.patch diff --git a/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_from_kernel_to_xstate.patch b/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_from_kernel_to_xstate.patch index d9e6fdb8855..ee296cf1a51 100644 --- a/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_from_kernel_to_xstate.patch +++ b/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_from_kernel_to_xstate.patch @@ -8,9 +8,7 @@ Message-ID: <20230109210214.71068-3-khuey@kylehuey.com> From: Kyle Huey -From: Kyle Huey - -commit 1c813ce03055 upstream +commit 1c813ce0305571e1b2e4cc4acca451da9e6ad18f upstream ptrace (through PTRACE_SETREGSET with NT_X86_XSTATE) ultimately calls copy_uabi_from_kernel_to_xstate(). In preparation for eventually handling diff --git a/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_to_xstate.patch b/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_to_xstate.patch index 3647345a54a..e8a3229c410 100644 --- a/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_to_xstate.patch +++ b/queue-5.15/x86-fpu-add-a-pkru-argument-to-copy_uabi_to_xstate.patch @@ -8,9 +8,7 @@ Message-ID: <20230109210214.71068-4-khuey@kylehuey.com> From: Kyle Huey -From: Kyle Huey - -commit 2c87767c35ee upstream +commit 2c87767c35ee9744f666ccec869d5fe742c3de0a upstream In preparation for adding PKRU handling code into copy_uabi_to_xstate(), add an argument that copy_uabi_from_kernel_to_xstate() can use to pass the diff --git a/queue-5.15/x86-fpu-allow-pkru-to-be-once-again-written-by-ptrace.patch b/queue-5.15/x86-fpu-allow-pkru-to-be-once-again-written-by-ptrace.patch index 7544095c340..c9f33c842cd 100644 --- a/queue-5.15/x86-fpu-allow-pkru-to-be-once-again-written-by-ptrace.patch +++ b/queue-5.15/x86-fpu-allow-pkru-to-be-once-again-written-by-ptrace.patch @@ -8,9 +8,7 @@ Message-ID: <20230109210214.71068-5-khuey@kylehuey.com> From: Kyle Huey -From: Kyle Huey - -commit 4a804c4f8356 upstream +commit 4a804c4f8356393d6b5eff7600f07615d7869c13 upstream Handle PKRU in copy_uabi_to_xstate() for the benefit of APIs that write the XSTATE such as PTRACE_SETREGSET with NT_X86_XSTATE. diff --git a/queue-5.15/x86-fpu-emulate-xrstor-s-behavior-if-the-xfeatures-pkru-bit-is-not-set.patch b/queue-5.15/x86-fpu-emulate-xrstor-s-behavior-if-the-xfeatures-pkru-bit-is-not-set.patch index 1a436a368d4..77ad03f415b 100644 --- a/queue-5.15/x86-fpu-emulate-xrstor-s-behavior-if-the-xfeatures-pkru-bit-is-not-set.patch +++ b/queue-5.15/x86-fpu-emulate-xrstor-s-behavior-if-the-xfeatures-pkru-bit-is-not-set.patch @@ -8,9 +8,7 @@ Message-ID: <20230109210214.71068-6-khuey@kylehuey.com> From: Kyle Huey -From: Kyle Huey - -commit d7e5aceace51 upstream +commit d7e5aceace514a2b1b3ca3dc44f93f1704766ca7 upstream The hardware XRSTOR instruction resets the PKRU register to its hardware init value (namely 0) if the PKRU bit is not set in the xfeatures mask. diff --git a/queue-5.15/x86-fpu-take-task_struct-in-copy_sigframe_from_user_to_xstate.patch b/queue-5.15/x86-fpu-take-task_struct-in-copy_sigframe_from_user_to_xstate.patch index 3eef25b3a3d..0e9f9e137a2 100644 --- a/queue-5.15/x86-fpu-take-task_struct-in-copy_sigframe_from_user_to_xstate.patch +++ b/queue-5.15/x86-fpu-take-task_struct-in-copy_sigframe_from_user_to_xstate.patch @@ -8,9 +8,7 @@ Message-ID: <20230109210214.71068-2-khuey@kylehuey.com> From: Kyle Huey -From: Kyle Huey - -commit 6a877d2450ac upstream +commit 6a877d2450ace4f27c012519e5a1ae818f931983 upstream This will allow copy_sigframe_from_user_to_xstate() to grab the address of thread_struct's pkru value in a later patch.