]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Thu, 14 Nov 2024 12:39:19 +0000 (07:39 -0500)
committerSasha Levin <sashal@kernel.org>
Thu, 14 Nov 2024 12:39:19 +0000 (07:39 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/9p-avoid-creating-multiple-slab-caches-with-the-same.patch [new file with mode: 0644]
queue-5.10/bpf-use-kvzmalloc-to-allocate-bpf-verifier-environme.patch [new file with mode: 0644]
queue-5.10/crypto-marvell-cesa-disable-hash-algorithms.patch [new file with mode: 0644]
queue-5.10/hid-multitouch-add-quirk-for-honor-magicbook-art-14-.patch [new file with mode: 0644]
queue-5.10/powerpc-powernv-free-name-on-error-in-opal_event_ini.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/sound-make-config_snd-depend-on-indirect_iomem-inste.patch [new file with mode: 0644]

diff --git a/queue-5.10/9p-avoid-creating-multiple-slab-caches-with-the-same.patch b/queue-5.10/9p-avoid-creating-multiple-slab-caches-with-the-same.patch
new file mode 100644 (file)
index 0000000..0cc838b
--- /dev/null
@@ -0,0 +1,62 @@
+From 96b4607e2a64a169840b4eba9e19caad8f7719f0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 7 Aug 2024 10:47:25 +0100
+Subject: 9p: Avoid creating multiple slab caches with the same name
+
+From: Pedro Falcato <pedro.falcato@gmail.com>
+
+[ Upstream commit 79efebae4afc2221fa814c3cae001bede66ab259 ]
+
+In the spirit of [1], avoid creating multiple slab caches with the same
+name. Instead, add the dev_name into the mix.
+
+[1]: https://lore.kernel.org/all/20240807090746.2146479-1-pedro.falcato@gmail.com/
+
+Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
+Reported-by: syzbot+3c5d43e97993e1fa612b@syzkaller.appspotmail.com
+Message-ID: <20240807094725.2193423-1-pedro.falcato@gmail.com>
+Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/9p/client.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/net/9p/client.c b/net/9p/client.c
+index 0fa324e8b2451..2668a1a67c8a8 100644
+--- a/net/9p/client.c
++++ b/net/9p/client.c
+@@ -1006,6 +1006,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
+       int err;
+       struct p9_client *clnt;
+       char *client_id;
++      char *cache_name;
+       err = 0;
+       clnt = kmalloc(sizeof(struct p9_client), GFP_KERNEL);
+@@ -1058,15 +1059,22 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
+       if (err)
+               goto close_trans;
++      cache_name = kasprintf(GFP_KERNEL, "9p-fcall-cache-%s", dev_name);
++      if (!cache_name) {
++              err = -ENOMEM;
++              goto close_trans;
++      }
++
+       /* P9_HDRSZ + 4 is the smallest packet header we can have that is
+        * followed by data accessed from userspace by read
+        */
+       clnt->fcall_cache =
+-              kmem_cache_create_usercopy("9p-fcall-cache", clnt->msize,
++              kmem_cache_create_usercopy(cache_name, clnt->msize,
+                                          0, 0, P9_HDRSZ + 4,
+                                          clnt->msize - (P9_HDRSZ + 4),
+                                          NULL);
++      kfree(cache_name);
+       return clnt;
+ close_trans:
+-- 
+2.43.0
+
diff --git a/queue-5.10/bpf-use-kvzmalloc-to-allocate-bpf-verifier-environme.patch b/queue-5.10/bpf-use-kvzmalloc-to-allocate-bpf-verifier-environme.patch
new file mode 100644 (file)
index 0000000..48ebffc
--- /dev/null
@@ -0,0 +1,52 @@
+From aaa5290b8ab1eb5a729e3ffb3824a748545d17c1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 8 Oct 2024 17:07:35 -0400
+Subject: bpf: use kvzmalloc to allocate BPF verifier environment
+
+From: Rik van Riel <riel@surriel.com>
+
+[ Upstream commit 434247637c66e1be2bc71a9987d4c3f0d8672387 ]
+
+The kzmalloc call in bpf_check can fail when memory is very fragmented,
+which in turn can lead to an OOM kill.
+
+Use kvzmalloc to fall back to vmalloc when memory is too fragmented to
+allocate an order 3 sized bpf verifier environment.
+
+Admittedly this is not a very common case, and only happens on systems
+where memory has already been squeezed close to the limit, but this does
+not seem like much of a hot path, and it's a simple enough fix.
+
+Signed-off-by: Rik van Riel <riel@surriel.com>
+Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
+Link: https://lore.kernel.org/r/20241008170735.16766766@imladris.surriel.com
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/bpf/verifier.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
+index 60db311480d0a..931611d227369 100644
+--- a/kernel/bpf/verifier.c
++++ b/kernel/bpf/verifier.c
+@@ -12564,7 +12564,7 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,
+       /* 'struct bpf_verifier_env' can be global, but since it's not small,
+        * allocate/free it every time bpf_check() is called
+        */
+-      env = kzalloc(sizeof(struct bpf_verifier_env), GFP_KERNEL);
++      env = kvzalloc(sizeof(struct bpf_verifier_env), GFP_KERNEL);
+       if (!env)
+               return -ENOMEM;
+       log = &env->log;
+@@ -12755,6 +12755,6 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,
+               mutex_unlock(&bpf_verifier_lock);
+       vfree(env->insn_aux_data);
+ err_free_env:
+-      kfree(env);
++      kvfree(env);
+       return ret;
+ }
+-- 
+2.43.0
+
diff --git a/queue-5.10/crypto-marvell-cesa-disable-hash-algorithms.patch b/queue-5.10/crypto-marvell-cesa-disable-hash-algorithms.patch
new file mode 100644 (file)
index 0000000..22b8774
--- /dev/null
@@ -0,0 +1,81 @@
+From 175d23d21a7c2c27b9bc88f4936498283e15dec1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 9 Oct 2024 16:38:48 +0800
+Subject: crypto: marvell/cesa - Disable hash algorithms
+
+From: Herbert Xu <herbert@gondor.apana.org.au>
+
+[ Upstream commit e845d2399a00f866f287e0cefbd4fc7d8ef0d2f7 ]
+
+Disable cesa hash algorithms by lowering the priority because they
+appear to be broken when invoked in parallel.  This allows them to
+still be tested for debugging purposes.
+
+Reported-by: Klaus Kudielka <klaus.kudielka@gmail.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/crypto/marvell/cesa/hash.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/crypto/marvell/cesa/hash.c b/drivers/crypto/marvell/cesa/hash.c
+index add7ea011c987..8441c3198d460 100644
+--- a/drivers/crypto/marvell/cesa/hash.c
++++ b/drivers/crypto/marvell/cesa/hash.c
+@@ -923,7 +923,7 @@ struct ahash_alg mv_md5_alg = {
+               .base = {
+                       .cra_name = "md5",
+                       .cra_driver_name = "mv-md5",
+-                      .cra_priority = 300,
++                      .cra_priority = 0,
+                       .cra_flags = CRYPTO_ALG_ASYNC |
+                                    CRYPTO_ALG_ALLOCATES_MEMORY |
+                                    CRYPTO_ALG_KERN_DRIVER_ONLY,
+@@ -994,7 +994,7 @@ struct ahash_alg mv_sha1_alg = {
+               .base = {
+                       .cra_name = "sha1",
+                       .cra_driver_name = "mv-sha1",
+-                      .cra_priority = 300,
++                      .cra_priority = 0,
+                       .cra_flags = CRYPTO_ALG_ASYNC |
+                                    CRYPTO_ALG_ALLOCATES_MEMORY |
+                                    CRYPTO_ALG_KERN_DRIVER_ONLY,
+@@ -1068,7 +1068,7 @@ struct ahash_alg mv_sha256_alg = {
+               .base = {
+                       .cra_name = "sha256",
+                       .cra_driver_name = "mv-sha256",
+-                      .cra_priority = 300,
++                      .cra_priority = 0,
+                       .cra_flags = CRYPTO_ALG_ASYNC |
+                                    CRYPTO_ALG_ALLOCATES_MEMORY |
+                                    CRYPTO_ALG_KERN_DRIVER_ONLY,
+@@ -1303,7 +1303,7 @@ struct ahash_alg mv_ahmac_md5_alg = {
+               .base = {
+                       .cra_name = "hmac(md5)",
+                       .cra_driver_name = "mv-hmac-md5",
+-                      .cra_priority = 300,
++                      .cra_priority = 0,
+                       .cra_flags = CRYPTO_ALG_ASYNC |
+                                    CRYPTO_ALG_ALLOCATES_MEMORY |
+                                    CRYPTO_ALG_KERN_DRIVER_ONLY,
+@@ -1374,7 +1374,7 @@ struct ahash_alg mv_ahmac_sha1_alg = {
+               .base = {
+                       .cra_name = "hmac(sha1)",
+                       .cra_driver_name = "mv-hmac-sha1",
+-                      .cra_priority = 300,
++                      .cra_priority = 0,
+                       .cra_flags = CRYPTO_ALG_ASYNC |
+                                    CRYPTO_ALG_ALLOCATES_MEMORY |
+                                    CRYPTO_ALG_KERN_DRIVER_ONLY,
+@@ -1445,7 +1445,7 @@ struct ahash_alg mv_ahmac_sha256_alg = {
+               .base = {
+                       .cra_name = "hmac(sha256)",
+                       .cra_driver_name = "mv-hmac-sha256",
+-                      .cra_priority = 300,
++                      .cra_priority = 0,
+                       .cra_flags = CRYPTO_ALG_ASYNC |
+                                    CRYPTO_ALG_ALLOCATES_MEMORY |
+                                    CRYPTO_ALG_KERN_DRIVER_ONLY,
+-- 
+2.43.0
+
diff --git a/queue-5.10/hid-multitouch-add-quirk-for-honor-magicbook-art-14-.patch b/queue-5.10/hid-multitouch-add-quirk-for-honor-magicbook-art-14-.patch
new file mode 100644 (file)
index 0000000..6bea158
--- /dev/null
@@ -0,0 +1,47 @@
+From bf54596266803b77c60b7d5285d0df2241c0d2ae Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 7 Oct 2024 12:08:03 +0800
+Subject: HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad
+
+From: WangYuli <wangyuli@uniontech.com>
+
+[ Upstream commit 7a5ab8071114344f62a8b1e64ed3452a77257d76 ]
+
+The behavior of HONOR MagicBook Art 14 touchpad is not consistent
+after reboots, as sometimes it reports itself as a touchpad, and
+sometimes as a mouse.
+
+Similarly to GLO-GXXX it is possible to call MT_QUIRK_FORCE_GET_FEATURE as a
+workaround to force set feature in mt_set_input_mode() for such special touchpad
+device.
+
+[jkosina@suse.com: reword changelog a little bit]
+Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1040
+Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
+Signed-off-by: WangYuli <wangyuli@uniontech.com>
+Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
+Signed-off-by: Jiri Kosina <jkosina@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hid/hid-multitouch.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
+index e7b047421f3d9..f36ddcb4e2ef2 100644
+--- a/drivers/hid/hid-multitouch.c
++++ b/drivers/hid/hid-multitouch.c
+@@ -1967,6 +1967,11 @@ static const struct hid_device_id mt_devices[] = {
+               HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+                       0x347d, 0x7853) },
++      /* HONOR MagicBook Art 14 touchpad */
++      { .driver_data = MT_CLS_VTL,
++              HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
++                      0x35cc, 0x0104) },
++
+       /* Ilitek dual touch panel */
+       {  .driver_data = MT_CLS_NSMU,
+               MT_USB_DEVICE(USB_VENDOR_ID_ILITEK,
+-- 
+2.43.0
+
diff --git a/queue-5.10/powerpc-powernv-free-name-on-error-in-opal_event_ini.patch b/queue-5.10/powerpc-powernv-free-name-on-error-in-opal_event_ini.patch
new file mode 100644 (file)
index 0000000..2dd921d
--- /dev/null
@@ -0,0 +1,39 @@
+From 7bb88ad4e0863b0cebe553c87b4ff0a4addb46df Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 20 Sep 2024 19:35:20 +1000
+Subject: powerpc/powernv: Free name on error in opal_event_init()
+
+From: Michael Ellerman <mpe@ellerman.id.au>
+
+[ Upstream commit cf8989d20d64ad702a6210c11a0347ebf3852aa7 ]
+
+In opal_event_init() if request_irq() fails name is not freed, leading
+to a memory leak. The code only runs at boot time, there's no way for a
+user to trigger it, so there's no security impact.
+
+Fix the leak by freeing name in the error path.
+
+Reported-by: 2639161967 <2639161967@qq.com>
+Closes: https://lore.kernel.org/linuxppc-dev/87wmjp3wig.fsf@mail.lhotse
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://patch.msgid.link/20240920093520.67997-1-mpe@ellerman.id.au
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/platforms/powernv/opal-irqchip.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c
+index dcec0f760c8f8..522bda391179a 100644
+--- a/arch/powerpc/platforms/powernv/opal-irqchip.c
++++ b/arch/powerpc/platforms/powernv/opal-irqchip.c
+@@ -285,6 +285,7 @@ int __init opal_event_init(void)
+                                name, NULL);
+               if (rc) {
+                       pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start);
++                      kfree(name);
+                       continue;
+               }
+       }
+-- 
+2.43.0
+
index a9553514ccf4a1ddeb493e54ff7598e19873eead..09730bd9225854392a361d6619981108fb2ea8d9 100644 (file)
@@ -67,3 +67,9 @@ hv_sock-initializing-vsk-trans-to-null-to-prevent-a-dangling-pointer.patch
 vsock-virtio-initialization-of-the-dangling-pointer-occurring-in-vsk-trans.patch
 alsa-usb-audio-add-endianness-annotations.patch
 net-phy-ti-take-into-account-all-possible-interrupt-sources.patch
+9p-avoid-creating-multiple-slab-caches-with-the-same.patch
+hid-multitouch-add-quirk-for-honor-magicbook-art-14-.patch
+bpf-use-kvzmalloc-to-allocate-bpf-verifier-environme.patch
+crypto-marvell-cesa-disable-hash-algorithms.patch
+sound-make-config_snd-depend-on-indirect_iomem-inste.patch
+powerpc-powernv-free-name-on-error-in-opal_event_ini.patch
diff --git a/queue-5.10/sound-make-config_snd-depend-on-indirect_iomem-inste.patch b/queue-5.10/sound-make-config_snd-depend-on-indirect_iomem-inste.patch
new file mode 100644 (file)
index 0000000..f152d01
--- /dev/null
@@ -0,0 +1,40 @@
+From 72d7b3d4dfacdb2d0f5290d8e878d3be64bd3a71 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 10 Oct 2024 14:46:01 +0200
+Subject: sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML
+
+From: Julian Vetter <jvetter@kalrayinc.com>
+
+[ Upstream commit ad6639f143a0b42d7fb110ad14f5949f7c218890 ]
+
+When building for the UM arch and neither INDIRECT_IOMEM=y, nor
+HAS_IOMEM=y is selected, it will fall back to the implementations from
+asm-generic/io.h for IO memcpy. But these fall-back functions just do a
+memcpy. So, instead of depending on UML, add dependency on 'HAS_IOMEM ||
+INDIRECT_IOMEM'.
+
+Reviewed-by: Yann Sionneau <ysionneau@kalrayinc.com>
+Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
+Link: https://patch.msgid.link/20241010124601.700528-1-jvetter@kalrayinc.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/Kconfig b/sound/Kconfig
+index aaf2022ffc57d..cb4cb0d5b9591 100644
+--- a/sound/Kconfig
++++ b/sound/Kconfig
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0-only
+ menuconfig SOUND
+       tristate "Sound card support"
+-      depends on HAS_IOMEM || UML
++      depends on HAS_IOMEM || INDIRECT_IOMEM
+       help
+         If you have a sound card in your computer, i.e. if it can say more
+         than an occasional beep, say Y.
+-- 
+2.43.0
+