From: Sasha Levin Date: Wed, 15 Feb 2023 16:33:46 +0000 (-0500) Subject: Fixes for 4.19 X-Git-Tag: v4.14.306~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40d03d7c97e2d04e31e66af65dc1c59a8edff57a;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/asoc-cs42l56-fix-dt-probe.patch b/queue-4.19/asoc-cs42l56-fix-dt-probe.patch new file mode 100644 index 00000000000..5cff34a5f22 --- /dev/null +++ b/queue-4.19/asoc-cs42l56-fix-dt-probe.patch @@ -0,0 +1,56 @@ +From b5f89fef1bddf6844655b872d6d5e2073fcb7d49 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Jan 2023 17:21:24 +0100 +Subject: ASoC: cs42l56: fix DT probe + +From: Arnd Bergmann + +[ Upstream commit e18c6da62edc780e4f4f3c9ce07bdacd69505182 ] + +While looking through legacy platform data users, I noticed that +the DT probing never uses data from the DT properties, as the +platform_data structure gets overwritten directly after it +is initialized. + +There have never been any boards defining the platform_data in +the mainline kernel either, so this driver so far only worked +with patched kernels or with the default values. + +For the benefit of possible downstream users, fix the DT probe +by no longer overwriting the data. + +Signed-off-by: Arnd Bergmann +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20230126162203.2986339-1-arnd@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/cs42l56.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c +index deaad703a7dbf..a4826a7d0a98c 100644 +--- a/sound/soc/codecs/cs42l56.c ++++ b/sound/soc/codecs/cs42l56.c +@@ -1204,18 +1204,12 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client, + if (pdata) { + cs42l56->pdata = *pdata; + } else { +- pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata), +- GFP_KERNEL); +- if (!pdata) +- return -ENOMEM; +- + if (i2c_client->dev.of_node) { + ret = cs42l56_handle_of_data(i2c_client, + &cs42l56->pdata); + if (ret != 0) + return ret; + } +- cs42l56->pdata = *pdata; + } + + if (cs42l56->pdata.gpio_nreset) { +-- +2.39.0 + diff --git a/queue-4.19/net-rose-fix-to-not-accept-on-connected-socket.patch b/queue-4.19/net-rose-fix-to-not-accept-on-connected-socket.patch new file mode 100644 index 00000000000..eef0d599c3b --- /dev/null +++ b/queue-4.19/net-rose-fix-to-not-accept-on-connected-socket.patch @@ -0,0 +1,63 @@ +From e4b63226728cefd4cd0334d9e3d58c8093d7fa4f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 25 Jan 2023 02:59:44 -0800 +Subject: net/rose: Fix to not accept on connected socket + +From: Hyunwoo Kim + +[ Upstream commit 14caefcf9837a2be765a566005ad82cd0d2a429f ] + +If you call listen() and accept() on an already connect()ed +rose socket, accept() can successfully connect. +This is because when the peer socket sends data to sendmsg, +the skb with its own sk stored in the connected socket's +sk->sk_receive_queue is connected, and rose_accept() dequeues +the skb waiting in the sk->sk_receive_queue. + +This creates a child socket with the sk of the parent +rose socket, which can cause confusion. + +Fix rose_listen() to return -EINVAL if the socket has +already been successfully connected, and add lock_sock +to prevent this issue. + +Signed-off-by: Hyunwoo Kim +Reviewed-by: Kuniyuki Iwashima +Link: https://lore.kernel.org/r/20230125105944.GA133314@ubuntu +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/rose/af_rose.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c +index 03a1ee221112e..4edd127bb8928 100644 +--- a/net/rose/af_rose.c ++++ b/net/rose/af_rose.c +@@ -490,6 +490,12 @@ static int rose_listen(struct socket *sock, int backlog) + { + struct sock *sk = sock->sk; + ++ lock_sock(sk); ++ if (sock->state != SS_UNCONNECTED) { ++ release_sock(sk); ++ return -EINVAL; ++ } ++ + if (sk->sk_state != TCP_LISTEN) { + struct rose_sock *rose = rose_sk(sk); + +@@ -499,8 +505,10 @@ static int rose_listen(struct socket *sock, int backlog) + memset(rose->dest_digis, 0, AX25_ADDR_LEN * ROSE_MAX_DIGIS); + sk->sk_max_ack_backlog = backlog; + sk->sk_state = TCP_LISTEN; ++ release_sock(sk); + return 0; + } ++ release_sock(sk); + + return -EOPNOTSUPP; + } +-- +2.39.0 + diff --git a/queue-4.19/nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch b/queue-4.19/nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch new file mode 100644 index 00000000000..9de7ed5736a --- /dev/null +++ b/queue-4.19/nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch @@ -0,0 +1,41 @@ +From ff320d9b9b5c2c63d23eb3e8f03340ed57687e50 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 23 Jan 2023 14:37:28 +0200 +Subject: nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association + +From: Amit Engel + +[ Upstream commit 0cab4404874f2de52617de8400c844891c6ea1ce ] + +As part of nvmet_fc_ls_create_association there is a case where +nvmet_fc_alloc_target_queue fails right after a new association with an +admin queue is created. In this case, no one releases the get taken in +nvmet_fc_alloc_target_assoc. This fix is adding the missing put. + +Signed-off-by: Amit Engel +Reviewed-by: James Smart +Signed-off-by: Christoph Hellwig +Signed-off-by: Sasha Levin +--- + drivers/nvme/target/fc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c +index 77e4d184bc995..68d128b895abd 100644 +--- a/drivers/nvme/target/fc.c ++++ b/drivers/nvme/target/fc.c +@@ -1325,8 +1325,10 @@ nvmet_fc_ls_create_association(struct nvmet_fc_tgtport *tgtport, + else { + queue = nvmet_fc_alloc_target_queue(iod->assoc, 0, + be16_to_cpu(rqst->assoc_cmd.sqsize)); +- if (!queue) ++ if (!queue) { + ret = VERR_QUEUE_ALLOC_FAIL; ++ nvmet_fc_tgt_a_put(iod->assoc); ++ } + } + } + +-- +2.39.0 + diff --git a/queue-4.19/series b/queue-4.19/series index e287427ddc5..6ad580d628b 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -61,3 +61,7 @@ arm64-dts-meson-gx-make-mmc-host-controller-interrupts-level-sensitive.patch arm64-dts-meson-axg-make-mmc-host-controller-interrupts-level-sensitive.patch bpf-always-return-target-ifindex-in-bpf_fib_lookup.patch migrate-hugetlb-check-for-hugetlb-shared-pmd-in-node-migration.patch +asoc-cs42l56-fix-dt-probe.patch +tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch +net-rose-fix-to-not-accept-on-connected-socket.patch +nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch diff --git a/queue-4.19/tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch b/queue-4.19/tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch new file mode 100644 index 00000000000..cf6782ee31e --- /dev/null +++ b/queue-4.19/tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch @@ -0,0 +1,148 @@ +From f23f462aad777240a9ce89b52e600e8b4a9711e1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Jan 2023 12:43:10 +0900 +Subject: tools/virtio: fix the vringh test for virtio ring changes + +From: Shunsuke Mie + +[ Upstream commit 3f7b75abf41cc4143aa295f62acbb060a012868d ] + +Fix the build caused by missing kmsan_handle_dma() and is_power_of_2() that +are used in drivers/virtio/virtio_ring.c. + +Signed-off-by: Shunsuke Mie +Message-Id: <20230110034310.779744-1-mie@igel.co.jp> +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Sasha Levin +--- + tools/virtio/linux/bug.h | 8 +++----- + tools/virtio/linux/build_bug.h | 7 +++++++ + tools/virtio/linux/cpumask.h | 7 +++++++ + tools/virtio/linux/gfp.h | 7 +++++++ + tools/virtio/linux/kernel.h | 1 + + tools/virtio/linux/kmsan.h | 12 ++++++++++++ + tools/virtio/linux/scatterlist.h | 1 + + tools/virtio/linux/topology.h | 7 +++++++ + 8 files changed, 45 insertions(+), 5 deletions(-) + create mode 100644 tools/virtio/linux/build_bug.h + create mode 100644 tools/virtio/linux/cpumask.h + create mode 100644 tools/virtio/linux/gfp.h + create mode 100644 tools/virtio/linux/kmsan.h + create mode 100644 tools/virtio/linux/topology.h + +diff --git a/tools/virtio/linux/bug.h b/tools/virtio/linux/bug.h +index b14c2c3b6b857..74aef964f5099 100644 +--- a/tools/virtio/linux/bug.h ++++ b/tools/virtio/linux/bug.h +@@ -1,11 +1,9 @@ + /* SPDX-License-Identifier: GPL-2.0 */ +-#ifndef BUG_H +-#define BUG_H ++#ifndef _LINUX_BUG_H ++#define _LINUX_BUG_H + + #define BUG_ON(__BUG_ON_cond) assert(!(__BUG_ON_cond)) + +-#define BUILD_BUG_ON(x) +- + #define BUG() abort() + +-#endif /* BUG_H */ ++#endif /* _LINUX_BUG_H */ +diff --git a/tools/virtio/linux/build_bug.h b/tools/virtio/linux/build_bug.h +new file mode 100644 +index 0000000000000..cdbb75e28a604 +--- /dev/null ++++ b/tools/virtio/linux/build_bug.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_BUILD_BUG_H ++#define _LINUX_BUILD_BUG_H ++ ++#define BUILD_BUG_ON(x) ++ ++#endif /* _LINUX_BUILD_BUG_H */ +diff --git a/tools/virtio/linux/cpumask.h b/tools/virtio/linux/cpumask.h +new file mode 100644 +index 0000000000000..307da69d6b26c +--- /dev/null ++++ b/tools/virtio/linux/cpumask.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_CPUMASK_H ++#define _LINUX_CPUMASK_H ++ ++#include ++ ++#endif /* _LINUX_CPUMASK_H */ +diff --git a/tools/virtio/linux/gfp.h b/tools/virtio/linux/gfp.h +new file mode 100644 +index 0000000000000..43d146f236f14 +--- /dev/null ++++ b/tools/virtio/linux/gfp.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef __LINUX_GFP_H ++#define __LINUX_GFP_H ++ ++#include ++ ++#endif +diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h +index 7ef45a4a3cba7..0dc38fe2a4f16 100644 +--- a/tools/virtio/linux/kernel.h ++++ b/tools/virtio/linux/kernel.h +@@ -10,6 +10,7 @@ + #include + + #include ++#include + #include + #include + #include +diff --git a/tools/virtio/linux/kmsan.h b/tools/virtio/linux/kmsan.h +new file mode 100644 +index 0000000000000..272b5aa285d5a +--- /dev/null ++++ b/tools/virtio/linux/kmsan.h +@@ -0,0 +1,12 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_KMSAN_H ++#define _LINUX_KMSAN_H ++ ++#include ++ ++inline void kmsan_handle_dma(struct page *page, size_t offset, size_t size, ++ enum dma_data_direction dir) ++{ ++} ++ ++#endif /* _LINUX_KMSAN_H */ +diff --git a/tools/virtio/linux/scatterlist.h b/tools/virtio/linux/scatterlist.h +index 369ee308b6686..74d9e1825748e 100644 +--- a/tools/virtio/linux/scatterlist.h ++++ b/tools/virtio/linux/scatterlist.h +@@ -2,6 +2,7 @@ + #ifndef SCATTERLIST_H + #define SCATTERLIST_H + #include ++#include + + struct scatterlist { + unsigned long page_link; +diff --git a/tools/virtio/linux/topology.h b/tools/virtio/linux/topology.h +new file mode 100644 +index 0000000000000..910794afb993a +--- /dev/null ++++ b/tools/virtio/linux/topology.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_TOPOLOGY_H ++#define _LINUX_TOPOLOGY_H ++ ++#include ++ ++#endif /* _LINUX_TOPOLOGY_H */ +-- +2.39.0 +