]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 09:50:24 +0000 (11:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 09:50:24 +0000 (11:50 +0200)
added patches:
powerpc-enable-execve-syscall-exit-tracepoint.patch
xtensa-fix-refcount-leak-bug-in-time.c.patch
xtensa-xtfpga-fix-refcount-leak-bug-in-setup.patch

queue-4.9/powerpc-enable-execve-syscall-exit-tracepoint.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/xtensa-fix-refcount-leak-bug-in-time.c.patch [new file with mode: 0644]
queue-4.9/xtensa-xtfpga-fix-refcount-leak-bug-in-setup.patch [new file with mode: 0644]

diff --git a/queue-4.9/powerpc-enable-execve-syscall-exit-tracepoint.patch b/queue-4.9/powerpc-enable-execve-syscall-exit-tracepoint.patch
new file mode 100644 (file)
index 0000000..eb017fe
--- /dev/null
@@ -0,0 +1,58 @@
+From ec6d0dde71d760aa60316f8d1c9a1b0d99213529 Mon Sep 17 00:00:00 2001
+From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
+Date: Thu, 9 Jun 2022 16:03:28 +0530
+Subject: powerpc: Enable execve syscall exit tracepoint
+
+From: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
+
+commit ec6d0dde71d760aa60316f8d1c9a1b0d99213529 upstream.
+
+On execve[at], we are zero'ing out most of the thread register state
+including gpr[0], which contains the syscall number. Due to this, we
+fail to trigger the syscall exit tracepoint properly. Fix this by
+retaining gpr[0] in the thread register state.
+
+Before this patch:
+  # tail /sys/kernel/debug/tracing/trace
+              cat-123     [000] .....    61.449351: sys_execve(filename:
+  7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8)
+              cat-124     [000] .....    62.428481: sys_execve(filename:
+  7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8)
+             echo-125     [000] .....    65.813702: sys_execve(filename:
+  7fffa6b23378, argv: 7fffa6b233a0, envp: 7fffa6b233b0)
+             echo-125     [000] .....    65.822214: sys_execveat(fd: 0,
+  filename: 1009ac48, argv: 7ffff65d0c98, envp: 7ffff65d0ca8, flags: 0)
+
+After this patch:
+  # tail /sys/kernel/debug/tracing/trace
+              cat-127     [000] .....   100.416262: sys_execve(filename:
+  7fffa41b3448, argv: 7fffa41b33e0, envp: 7fffa41b33f8)
+              cat-127     [000] .....   100.418203: sys_execve -> 0x0
+             echo-128     [000] .....   103.873968: sys_execve(filename:
+  7fffa41b3378, argv: 7fffa41b33a0, envp: 7fffa41b33b0)
+             echo-128     [000] .....   103.875102: sys_execve -> 0x0
+             echo-128     [000] .....   103.882097: sys_execveat(fd: 0,
+  filename: 1009ac48, argv: 7fffd10d2148, envp: 7fffd10d2158, flags: 0)
+             echo-128     [000] .....   103.883225: sys_execveat -> 0x0
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
+Tested-by: Sumit Dubey2 <Sumit.Dubey2@ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20220609103328.41306-1-naveen.n.rao@linux.vnet.ibm.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/kernel/process.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/powerpc/kernel/process.c
++++ b/arch/powerpc/kernel/process.c
+@@ -1591,7 +1591,7 @@ void start_thread(struct pt_regs *regs,
+               tm_reclaim_current(0);
+ #endif
+-      memset(regs->gpr, 0, sizeof(regs->gpr));
++      memset(&regs->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0]));
+       regs->ctr = 0;
+       regs->link = 0;
+       regs->xer = 0;
index 92c966c6e4634a751297d1f686d1e2f9454f31b1..822177303f8dc416b811d39bc1942a027e34cdf3 100644 (file)
@@ -13,3 +13,6 @@ usb-chipidea-udc-check-request-status-before-setting-device-address.patch
 iio-accel-bma180-rearrange-iio-trigger-get-and-register.patch
 iio-accel-mma8452-ignore-the-return-value-of-reset-operation.patch
 iio-trigger-sysfs-fix-use-after-free-on-remove.patch
+xtensa-xtfpga-fix-refcount-leak-bug-in-setup.patch
+xtensa-fix-refcount-leak-bug-in-time.c.patch
+powerpc-enable-execve-syscall-exit-tracepoint.patch
diff --git a/queue-4.9/xtensa-fix-refcount-leak-bug-in-time.c.patch b/queue-4.9/xtensa-fix-refcount-leak-bug-in-time.c.patch
new file mode 100644 (file)
index 0000000..05a97bc
--- /dev/null
@@ -0,0 +1,32 @@
+From a0117dc956429f2ede17b323046e1968d1849150 Mon Sep 17 00:00:00 2001
+From: Liang He <windhl@126.com>
+Date: Fri, 17 Jun 2022 20:44:32 +0800
+Subject: xtensa: Fix refcount leak bug in time.c
+
+From: Liang He <windhl@126.com>
+
+commit a0117dc956429f2ede17b323046e1968d1849150 upstream.
+
+In calibrate_ccount(), of_find_compatible_node() will return a node
+pointer with refcount incremented. We should use of_node_put() when
+it is not used anymore.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Liang He <windhl@126.com>
+Message-Id: <20220617124432.4049006-1-windhl@126.com>
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/xtensa/kernel/time.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/xtensa/kernel/time.c
++++ b/arch/xtensa/kernel/time.c
+@@ -146,6 +146,7 @@ static void __init calibrate_ccount(void
+       cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");
+       if (cpu) {
+               clk = of_clk_get(cpu, 0);
++              of_node_put(cpu);
+               if (!IS_ERR(clk)) {
+                       ccount_freq = clk_get_rate(clk);
+                       return;
diff --git a/queue-4.9/xtensa-xtfpga-fix-refcount-leak-bug-in-setup.patch b/queue-4.9/xtensa-xtfpga-fix-refcount-leak-bug-in-setup.patch
new file mode 100644 (file)
index 0000000..3c76030
--- /dev/null
@@ -0,0 +1,32 @@
+From 173940b3ae40114d4179c251a98ee039dc9cd5b3 Mon Sep 17 00:00:00 2001
+From: Liang He <windhl@126.com>
+Date: Fri, 17 Jun 2022 19:53:23 +0800
+Subject: xtensa: xtfpga: Fix refcount leak bug in setup
+
+From: Liang He <windhl@126.com>
+
+commit 173940b3ae40114d4179c251a98ee039dc9cd5b3 upstream.
+
+In machine_setup(), of_find_compatible_node() will return a node
+pointer with refcount incremented. We should use of_node_put() when
+it is not used anymore.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Liang He <windhl@126.com>
+Message-Id: <20220617115323.4046905-1-windhl@126.com>
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/xtensa/platforms/xtfpga/setup.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/xtensa/platforms/xtfpga/setup.c
++++ b/arch/xtensa/platforms/xtfpga/setup.c
+@@ -152,6 +152,7 @@ static int __init machine_setup(void)
+       if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
+               update_local_mac(eth);
++      of_node_put(eth);
+       return 0;
+ }
+ arch_initcall(machine_setup);