]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jan 2024 23:44:40 +0000 (15:44 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jan 2024 23:44:40 +0000 (15:44 -0800)
added patches:
crypto-scompress-initialize-per-cpu-variables-on-each-cpu.patch

queue-4.19/crypto-scompress-initialize-per-cpu-variables-on-each-cpu.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/crypto-scompress-initialize-per-cpu-variables-on-each-cpu.patch b/queue-4.19/crypto-scompress-initialize-per-cpu-variables-on-each-cpu.patch
new file mode 100644 (file)
index 0000000..1018a99
--- /dev/null
@@ -0,0 +1,48 @@
+From 8c3fffe3993b06dd1955a79bd2f0f3b143d259b3 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Fri, 12 Apr 2019 17:14:15 +0200
+Subject: crypto: scompress - initialize per-CPU variables on each CPU
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+commit 8c3fffe3993b06dd1955a79bd2f0f3b143d259b3 upstream.
+
+In commit 71052dcf4be70 ("crypto: scompress - Use per-CPU struct instead
+multiple variables") I accidentally initialized multiple times the memory on a
+random CPU. I should have initialize the memory on every CPU like it has
+been done earlier. I didn't notice this because the scheduler didn't
+move the task to another CPU.
+Guenter managed to do that and the code crashed as expected.
+
+Allocate / free per-CPU memory on each CPU.
+
+Fixes: 71052dcf4be70 ("crypto: scompress - Use per-CPU struct instead multiple variables")
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Tested-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ crypto/scompress.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/crypto/scompress.c
++++ b/crypto/scompress.c
+@@ -79,7 +79,7 @@ static void crypto_scomp_free_scratches(
+       int i;
+       for_each_possible_cpu(i) {
+-              scratch = raw_cpu_ptr(&scomp_scratch);
++              scratch = per_cpu_ptr(&scomp_scratch, i);
+               vfree(scratch->src);
+               vfree(scratch->dst);
+@@ -96,7 +96,7 @@ static int crypto_scomp_alloc_scratches(
+       for_each_possible_cpu(i) {
+               void *mem;
+-              scratch = raw_cpu_ptr(&scomp_scratch);
++              scratch = per_cpu_ptr(&scomp_scratch, i);
+               mem = vmalloc_node(SCOMP_SCRATCH_SIZE, cpu_to_node(i));
+               if (!mem)
index 7abeeb208b78ed539f49d3e5f3586c7fd55305c4..fb98c85cf7e81bd3c7f11bd195135e5618ee4129 100644 (file)
@@ -145,3 +145,4 @@ kdb-fix-a-potential-buffer-overflow-in-kdb_local.patch
 i2c-s3c24xx-fix-read-transfers-in-polling-mode.patch
 i2c-s3c24xx-fix-transferring-more-than-one-message-i.patch
 revert-nfsd-fix-possible-sleep-during-nfsd4_release_lockowner.patch
+crypto-scompress-initialize-per-cpu-variables-on-each-cpu.patch