From: Sasha Levin Date: Mon, 11 Oct 2021 01:12:28 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v5.14.12~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5878a16cf13ae636ef090bed27af301a48f3f6ff;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- 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 index 00000000000..d06da510a25 --- /dev/null +++ b/queue-5.4/bpf-s390-fix-potential-memory-leak-about-jit_data.patch @@ -0,0 +1,38 @@ +From fc0dc3cff1cd5134210f80f5f722d0ad1b9712aa Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 27 Sep 2021 15:06:14 +0800 +Subject: bpf, s390: Fix potential memory leak about jit_data + +From: Tiezhu Yang + +[ 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 +Acked-by: Ilya Leoshkevich +Reviewed-by: Christian Borntraeger +Signed-off-by: Christian Borntraeger +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + 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 index 00000000000..e8822152625 --- /dev/null +++ b/queue-5.4/i2c-acpi-fix-resource-leak-in-reconfiguration-device.patch @@ -0,0 +1,40 @@ +From a8f872f0eff3194ed73f01a66387b8bddc53e918 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Sep 2021 17:57:18 +0100 +Subject: i2c: acpi: fix resource leak in reconfiguration device addition + +From: Jamie Iles + +[ 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 +Acked-by: Mika Westerberg +[wsa: fixed title] +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + 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 index 00000000000..251eb790255 --- /dev/null +++ b/queue-5.4/powerpc-bpf-fix-bpf_mod-when-imm-1.patch @@ -0,0 +1,48 @@ +From e0c5e87fa166904cd133acc8da185b24fe28726e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Oct 2021 01:55:22 +0530 +Subject: powerpc/bpf: Fix BPF_MOD when imm == 1 + +From: Naveen N. Rao + +[ 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 +Tested-by: Johan Almbladh +Reviewed-by: Christophe Leroy +Acked-by: Song Liu +Acked-by: Johan Almbladh +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/c674ca18c3046885602caebb326213731c675d06.1633464148.git.naveen.n.rao@linux.vnet.ibm.com +Signed-off-by: Sasha Levin +--- + 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 index 00000000000..06f7339721b --- /dev/null +++ b/queue-5.4/risc-v-include-clone3-on-rv32.patch @@ -0,0 +1,42 @@ +From 7101173ed505b552a75a547af23c980ee87ca9eb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 Oct 2021 17:21:20 -0700 +Subject: RISC-V: Include clone3() on rv32 + +From: Palmer Dabbelt + +[ 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 +Reviewed-by: Arnd Bergmann +Acked-by: Christian Brauner +Signed-off-by: Palmer Dabbelt +Signed-off-by: Sasha Levin +--- + 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 + + /* +-- +2.33.0 + diff --git a/queue-5.4/series b/queue-5.4/series index d989b0b269f..4eef662b663 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -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