]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Mon, 11 Oct 2021 01:12:28 +0000 (21:12 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 11 Oct 2021 01:12:28 +0000 (21:12 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/bpf-s390-fix-potential-memory-leak-about-jit_data.patch [new file with mode: 0644]
queue-5.4/i2c-acpi-fix-resource-leak-in-reconfiguration-device.patch [new file with mode: 0644]
queue-5.4/powerpc-bpf-fix-bpf_mod-when-imm-1.patch [new file with mode: 0644]
queue-5.4/risc-v-include-clone3-on-rv32.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/bpf-s390-fix-potential-memory-leak-about-jit_data.patch b/queue-5.4/bpf-s390-fix-potential-memory-leak-about-jit_data.patch
new file mode 100644 (file)
index 0000000..d06da51
--- /dev/null
@@ -0,0 +1,38 @@
+From fc0dc3cff1cd5134210f80f5f722d0ad1b9712aa Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 27 Sep 2021 15:06:14 +0800
+Subject: bpf, s390: Fix potential memory leak about jit_data
+
+From: Tiezhu Yang <yangtiezhu@loongson.cn>
+
+[ Upstream commit 686cb8b9f6b46787f035afe8fbd132a74e6b1bdd ]
+
+Make sure to free jit_data through kfree() in the error path.
+
+Fixes: 1c8f9b91c456 ("bpf: s390: add JIT support for multi-function programs")
+Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
+Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
+Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/s390/net/bpf_jit_comp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
+index 2d2996627629..f63e4cb6c9b3 100644
+--- a/arch/s390/net/bpf_jit_comp.c
++++ b/arch/s390/net/bpf_jit_comp.c
+@@ -1385,7 +1385,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
+       jit.addrs = kvcalloc(fp->len + 1, sizeof(*jit.addrs), GFP_KERNEL);
+       if (jit.addrs == NULL) {
+               fp = orig_fp;
+-              goto out;
++              goto free_addrs;
+       }
+       /*
+        * Three initial passes:
+-- 
+2.33.0
+
diff --git a/queue-5.4/i2c-acpi-fix-resource-leak-in-reconfiguration-device.patch b/queue-5.4/i2c-acpi-fix-resource-leak-in-reconfiguration-device.patch
new file mode 100644 (file)
index 0000000..e882215
--- /dev/null
@@ -0,0 +1,40 @@
+From a8f872f0eff3194ed73f01a66387b8bddc53e918 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 22 Sep 2021 17:57:18 +0100
+Subject: i2c: acpi: fix resource leak in reconfiguration device addition
+
+From: Jamie Iles <quic_jiles@quicinc.com>
+
+[ Upstream commit 6558b646ce1c2a872fe1c2c7cb116f05a2c1950f ]
+
+acpi_i2c_find_adapter_by_handle() calls bus_find_device() which takes a
+reference on the adapter which is never released which will result in a
+reference count leak and render the adapter unremovable.  Make sure to
+put the adapter after creating the client in the same manner that we do
+for OF.
+
+Fixes: 525e6fabeae2 ("i2c / ACPI: add support for ACPI reconfigure notifications")
+Signed-off-by: Jamie Iles <quic_jiles@quicinc.com>
+Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+[wsa: fixed title]
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/i2c-core-acpi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
+index c70983780ae7..fe466ee4c49b 100644
+--- a/drivers/i2c/i2c-core-acpi.c
++++ b/drivers/i2c/i2c-core-acpi.c
+@@ -436,6 +436,7 @@ static int i2c_acpi_notify(struct notifier_block *nb, unsigned long value,
+                       break;
+               i2c_acpi_register_device(adapter, adev, &info);
++              put_device(&adapter->dev);
+               break;
+       case ACPI_RECONFIG_DEVICE_REMOVE:
+               if (!acpi_device_enumerated(adev))
+-- 
+2.33.0
+
diff --git a/queue-5.4/powerpc-bpf-fix-bpf_mod-when-imm-1.patch b/queue-5.4/powerpc-bpf-fix-bpf_mod-when-imm-1.patch
new file mode 100644 (file)
index 0000000..251eb79
--- /dev/null
@@ -0,0 +1,48 @@
+From e0c5e87fa166904cd133acc8da185b24fe28726e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 6 Oct 2021 01:55:22 +0530
+Subject: powerpc/bpf: Fix BPF_MOD when imm == 1
+
+From: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
+
+[ Upstream commit 8bbc9d822421d9ac8ff9ed26a3713c9afc69d6c8 ]
+
+Only ignore the operation if dividing by 1.
+
+Fixes: 156d0e290e969c ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF")
+Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
+Tested-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
+Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
+Acked-by: Song Liu <songliubraving@fb.com>
+Acked-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/c674ca18c3046885602caebb326213731c675d06.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/net/bpf_jit_comp64.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
+index 20bfd753bcba..a05386318f70 100644
+--- a/arch/powerpc/net/bpf_jit_comp64.c
++++ b/arch/powerpc/net/bpf_jit_comp64.c
+@@ -408,8 +408,14 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
+               case BPF_ALU64 | BPF_DIV | BPF_K: /* dst /= imm */
+                       if (imm == 0)
+                               return -EINVAL;
+-                      else if (imm == 1)
+-                              goto bpf_alu32_trunc;
++                      if (imm == 1) {
++                              if (BPF_OP(code) == BPF_DIV) {
++                                      goto bpf_alu32_trunc;
++                              } else {
++                                      EMIT(PPC_RAW_LI(dst_reg, 0));
++                                      break;
++                              }
++                      }
+                       PPC_LI32(b2p[TMP_REG_1], imm);
+                       switch (BPF_CLASS(code)) {
+-- 
+2.33.0
+
diff --git a/queue-5.4/risc-v-include-clone3-on-rv32.patch b/queue-5.4/risc-v-include-clone3-on-rv32.patch
new file mode 100644 (file)
index 0000000..06f7339
--- /dev/null
@@ -0,0 +1,42 @@
+From 7101173ed505b552a75a547af23c980ee87ca9eb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 2 Oct 2021 17:21:20 -0700
+Subject: RISC-V: Include clone3() on rv32
+
+From: Palmer Dabbelt <palmerdabbelt@google.com>
+
+[ Upstream commit 59a4e0d5511ba61353ea9a4efdb1b86c23ecf134 ]
+
+As far as I can tell this should be enabled on rv32 as well, I'm not
+sure why it's rv64-only.  checksyscalls is complaining about our lack of
+clone3() on rv32.
+
+Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
+Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
+Reviewed-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
+Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/riscv/include/uapi/asm/unistd.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h
+index 13ce76cc5aff..80dff2c2bf67 100644
+--- a/arch/riscv/include/uapi/asm/unistd.h
++++ b/arch/riscv/include/uapi/asm/unistd.h
+@@ -18,9 +18,10 @@
+ #ifdef __LP64__
+ #define __ARCH_WANT_NEW_STAT
+ #define __ARCH_WANT_SET_GET_RLIMIT
+-#define __ARCH_WANT_SYS_CLONE3
+ #endif /* __LP64__ */
++#define __ARCH_WANT_SYS_CLONE3
++
+ #include <asm-generic/unistd.h>
+ /*
+-- 
+2.33.0
+
index d989b0b269f8ab9312b8c9e236a9dafc886f83b6..4eef662b663cac73754ad3cf2a1a5575e1102400 100644 (file)
@@ -43,3 +43,7 @@ gve-fix-gve_get_stats.patch
 i40e-fix-endless-loop-under-rtnl.patch
 i40e-fix-freeing-of-uninitialized-misc-irq-vector.patch
 net-prefer-socket-bound-to-interface-when-not-in-vrf.patch
+i2c-acpi-fix-resource-leak-in-reconfiguration-device.patch
+bpf-s390-fix-potential-memory-leak-about-jit_data.patch
+risc-v-include-clone3-on-rv32.patch
+powerpc-bpf-fix-bpf_mod-when-imm-1.patch