diff options
8 files changed, 400 insertions, 0 deletions
diff --git a/queue-5.4/alsa-usb-audio-fix-out-of-bounds-read-in-snd_usb_get.patch b/queue-5.4/alsa-usb-audio-fix-out-of-bounds-read-in-snd_usb_get.patch new file mode 100644 index 0000000000..bc18b711b1 --- /dev/null +++ b/queue-5.4/alsa-usb-audio-fix-out-of-bounds-read-in-snd_usb_get.patch @@ -0,0 +1,47 @@ +From 9df1b28e9c17bc1992a6e09d25a8cbc4a886a852 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Mon, 23 Jun 2025 20:05:25 +0900 +Subject: ALSA: usb-audio: Fix out-of-bounds read in + snd_usb_get_audioformat_uac3() + +From: Youngjun Lee <yjjuny.lee@samsung.com> + +[ Upstream commit fb4e2a6e8f28a3c0ad382e363aeb9cd822007b8a ] + +In snd_usb_get_audioformat_uac3(), the length value returned from +snd_usb_ctl_msg() is used directly for memory allocation without +validation. This length is controlled by the USB device. + +The allocated buffer is cast to a uac3_cluster_header_descriptor +and its fields are accessed without verifying that the buffer +is large enough. If the device returns a smaller than expected +length, this leads to an out-of-bounds read. + +Add a length check to ensure the buffer is large enough for +uac3_cluster_header_descriptor. + +Signed-off-by: Youngjun Lee <yjjuny.lee@samsung.com> +Fixes: 9a2fe9b801f5 ("ALSA: usb: initial USB Audio Device Class 3.0 support") +Link: https://patch.msgid.link/20250623-uac3-oob-fix-v1-1-527303eaf40a@samsung.com +Signed-off-by: Takashi Iwai <tiwai@suse.de> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + sound/usb/stream.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/usb/stream.c b/sound/usb/stream.c +index 1c4ff57993240..d698b609fe524 100644 +--- a/sound/usb/stream.c ++++ b/sound/usb/stream.c +@@ -979,6 +979,8 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip, + * and request Cluster Descriptor + */ + wLength = le16_to_cpu(hc_header.wLength); ++ if (wLength < sizeof(cluster)) ++ return NULL; + cluster = kzalloc(wLength, GFP_KERNEL); + if (!cluster) + return ERR_PTR(-ENOMEM); +-- +2.39.5 + diff --git a/queue-5.4/atm-release-atm_dev_mutex-after-removing-procfs-in-a.patch b/queue-5.4/atm-release-atm_dev_mutex-after-removing-procfs-in-a.patch new file mode 100644 index 0000000000..284d6ac380 --- /dev/null +++ b/queue-5.4/atm-release-atm_dev_mutex-after-removing-procfs-in-a.patch @@ -0,0 +1,106 @@ +From d10df6ada517f981d7806e156b1db169869248c2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Tue, 24 Jun 2025 14:45:00 -0700 +Subject: atm: Release atm_dev_mutex after removing procfs in + atm_dev_deregister(). + +From: Kuniyuki Iwashima <kuniyu@google.com> + +[ Upstream commit a433791aeaea6e84df709e0b9584b9bbe040cd1c ] + +syzbot reported a warning below during atm_dev_register(). [0] + +Before creating a new device and procfs/sysfs for it, atm_dev_register() +looks up a duplicated device by __atm_dev_lookup(). These operations are +done under atm_dev_mutex. + +However, when removing a device in atm_dev_deregister(), it releases the +mutex just after removing the device from the list that __atm_dev_lookup() +iterates over. + +So, there will be a small race window where the device does not exist on +the device list but procfs/sysfs are still not removed, triggering the +splat. + +Let's hold the mutex until procfs/sysfs are removed in +atm_dev_deregister(). + +[0]: +proc_dir_entry 'atm/atmtcp:0' already registered +WARNING: CPU: 0 PID: 5919 at fs/proc/generic.c:377 proc_register+0x455/0x5f0 fs/proc/generic.c:377 +Modules linked in: +CPU: 0 UID: 0 PID: 5919 Comm: syz-executor284 Not tainted 6.16.0-rc2-syzkaller-00047-g52da431bf03b #0 PREEMPT(full) +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 +RIP: 0010:proc_register+0x455/0x5f0 fs/proc/generic.c:377 +Code: 48 89 f9 48 c1 e9 03 80 3c 01 00 0f 85 a2 01 00 00 48 8b 44 24 10 48 c7 c7 20 c0 c2 8b 48 8b b0 d8 00 00 00 e8 0c 02 1c ff 90 <0f> 0b 90 90 48 c7 c7 80 f2 82 8e e8 0b de 23 09 48 8b 4c 24 28 48 +RSP: 0018:ffffc9000466fa30 EFLAGS: 00010282 +RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff817ae248 +RDX: ffff888026280000 RSI: ffffffff817ae255 RDI: 0000000000000001 +RBP: ffff8880232bed48 R08: 0000000000000001 R09: 0000000000000000 +R10: 0000000000000000 R11: 0000000000000001 R12: ffff888076ed2140 +R13: dffffc0000000000 R14: ffff888078a61340 R15: ffffed100edda444 +FS: 00007f38b3b0c6c0(0000) GS:ffff888124753000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 00007f38b3bdf953 CR3: 0000000076d58000 CR4: 00000000003526f0 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +Call Trace: + <TASK> + proc_create_data+0xbe/0x110 fs/proc/generic.c:585 + atm_proc_dev_register+0x112/0x1e0 net/atm/proc.c:361 + atm_dev_register+0x46d/0x890 net/atm/resources.c:113 + atmtcp_create+0x77/0x210 drivers/atm/atmtcp.c:369 + atmtcp_attach drivers/atm/atmtcp.c:403 [inline] + atmtcp_ioctl+0x2f9/0xd60 drivers/atm/atmtcp.c:464 + do_vcc_ioctl+0x12c/0x930 net/atm/ioctl.c:159 + sock_do_ioctl+0x115/0x280 net/socket.c:1190 + sock_ioctl+0x227/0x6b0 net/socket.c:1311 + vfs_ioctl fs/ioctl.c:51 [inline] + __do_sys_ioctl fs/ioctl.c:907 [inline] + __se_sys_ioctl fs/ioctl.c:893 [inline] + __x64_sys_ioctl+0x18b/0x210 fs/ioctl.c:893 + do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] + do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 + entry_SYSCALL_64_after_hwframe+0x77/0x7f +RIP: 0033:0x7f38b3b74459 +Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 18 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 +RSP: 002b:00007f38b3b0c198 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 +RAX: ffffffffffffffda RBX: 00007f38b3bfe318 RCX: 00007f38b3b74459 +RDX: 0000000000000000 RSI: 0000000000006180 RDI: 0000000000000005 +RBP: 00007f38b3bfe310 R08: 65732f636f72702f R09: 65732f636f72702f +R10: 65732f636f72702f R11: 0000000000000246 R12: 00007f38b3bcb0ac +R13: 00007f38b3b0c1a0 R14: 0000200000000200 R15: 00007f38b3bcb03b + </TASK> + +Fixes: 64bf69ddff76 ("[ATM]: deregistration removes device from atm_devs list immediately") +Reported-by: syzbot+8bd335d2ad3b93e80715@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/netdev/685316de.050a0220.216029.0087.GAE@google.com/ +Tested-by: syzbot+8bd335d2ad3b93e80715@syzkaller.appspotmail.com +Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> +Link: https://patch.msgid.link/20250624214505.570679-1-kuni1840@gmail.com +Signed-off-by: Jakub Kicinski <kuba@kernel.org> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + net/atm/resources.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/net/atm/resources.c b/net/atm/resources.c +index 04b2235c5c261..e244c2576d1e0 100644 +--- a/net/atm/resources.c ++++ b/net/atm/resources.c +@@ -148,11 +148,10 @@ void atm_dev_deregister(struct atm_dev *dev) + */ + mutex_lock(&atm_dev_mutex); + list_del(&dev->dev_list); +- mutex_unlock(&atm_dev_mutex); +- + atm_dev_release_vccs(dev); + atm_unregister_sysfs(dev); + atm_proc_dev_deregister(dev); ++ mutex_unlock(&atm_dev_mutex); + + atm_dev_put(dev); + } +-- +2.39.5 + diff --git a/queue-5.4/attach_recursive_mnt-do-not-lock-the-covering-tree-w.patch b/queue-5.4/attach_recursive_mnt-do-not-lock-the-covering-tree-w.patch new file mode 100644 index 0000000000..d4b0427881 --- /dev/null +++ b/queue-5.4/attach_recursive_mnt-do-not-lock-the-covering-tree-w.patch @@ -0,0 +1,51 @@ +From 5bee90027ab1de60ef5122b6423e6d3839f5b9c5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Sun, 22 Jun 2025 18:03:29 -0400 +Subject: attach_recursive_mnt(): do not lock the covering tree when sliding + something under it + +From: Al Viro <viro@zeniv.linux.org.uk> + +[ Upstream commit ce7df19686530920f2f6b636e71ce5eb1d9303ef ] + +If we are propagating across the userns boundary, we need to lock the +mounts added there. However, in case when something has already +been mounted there and we end up sliding a new tree under that, +the stuff that had been there before should not get locked. + +IOW, lock_mnt_tree() should be called before we reparent the +preexisting tree on top of what we are adding. + +Fixes: 3bd045cc9c4b ("separate copying and locking mount tree on cross-userns copies") +Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + fs/namespace.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/fs/namespace.c b/fs/namespace.c +index 8a35144897686..ee5a87061f205 100644 +--- a/fs/namespace.c ++++ b/fs/namespace.c +@@ -2124,14 +2124,14 @@ static int attach_recursive_mnt(struct mount *source_mnt, + hlist_for_each_entry_safe(child, n, &tree_list, mnt_hash) { + struct mount *q; + hlist_del_init(&child->mnt_hash); +- q = __lookup_mnt(&child->mnt_parent->mnt, +- child->mnt_mountpoint); +- if (q) +- mnt_change_mountpoint(child, smp, q); + /* Notice when we are propagating across user namespaces */ + if (child->mnt_parent->mnt_ns->user_ns != user_ns) + lock_mnt_tree(child); + child->mnt.mnt_flags &= ~MNT_LOCKED; ++ q = __lookup_mnt(&child->mnt_parent->mnt, ++ child->mnt_mountpoint); ++ if (q) ++ mnt_change_mountpoint(child, smp, q); + commit_tree(child); + } + put_mountpoint(smp); +-- +2.39.5 + diff --git a/queue-5.4/net-enetc-correct-endianness-handling-in-_enetc_rd_r.patch b/queue-5.4/net-enetc-correct-endianness-handling-in-_enetc_rd_r.patch new file mode 100644 index 0000000000..fe1860e494 --- /dev/null +++ b/queue-5.4/net-enetc-correct-endianness-handling-in-_enetc_rd_r.patch @@ -0,0 +1,60 @@ +From 049d80e01251c1e7ef9e541e8509a0c293fb4c6c Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Tue, 24 Jun 2025 17:35:12 +0100 +Subject: net: enetc: Correct endianness handling in _enetc_rd_reg64 + +From: Simon Horman <horms@kernel.org> + +[ Upstream commit 7b515f35a911fdc31fbde6531828dcd6ae9803d3 ] + +enetc_hw.h provides two versions of _enetc_rd_reg64. +One which simply calls ioread64() when available. +And another that composes the 64-bit result from ioread32() calls. + +In the second case the code appears to assume that each ioread32() call +returns a little-endian value. However both the shift and logical or +used to compose the return value would not work correctly on big endian +systems if this were the case. Moreover, this is inconsistent with the +first case where the return value of ioread64() is assumed to be in host +byte order. + +It appears that the correct approach is for both versions to treat the +return value of ioread*() functions as being in host byte order. And +this patch corrects the ioread32()-based version to do so. + +This is a bug but would only manifest on big endian systems +that make use of the ioread32-based implementation of _enetc_rd_reg64. +While all in-tree users of this driver are little endian and +make use of the ioread64-based implementation of _enetc_rd_reg64. +Thus, no in-tree user of this driver is affected by this bug. + +Flagged by Sparse. +Compile tested only. + +Fixes: 16eb4c85c964 ("enetc: Add ethtool statistics") +Closes: https://lore.kernel.org/all/AM9PR04MB850500D3FC24FE23DEFCEA158879A@AM9PR04MB8505.eurprd04.prod.outlook.com/ +Signed-off-by: Simon Horman <horms@kernel.org> +Reviewed-by: Wei Fang <wei.fang@nxp.com> +Link: https://patch.msgid.link/20250624-etnetc-le-v1-1-a73a95d96e4e@kernel.org +Signed-off-by: Jakub Kicinski <kuba@kernel.org> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + drivers/net/ethernet/freescale/enetc/enetc_hw.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/ethernet/freescale/enetc/enetc_hw.h +index fac80831d5327..e99546b6a356c 100644 +--- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h ++++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h +@@ -319,7 +319,7 @@ static inline u64 enetc_rd_reg64(void __iomem *reg) + tmp = ioread32(reg + 4); + } while (high != tmp); + +- return le64_to_cpu((__le64)high << 32 | low); ++ return (u64)high << 32 | low; + } + #endif + +-- +2.39.5 + diff --git a/queue-5.4/series b/queue-5.4/series index cda16c08df..8d4a5a2342 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -41,3 +41,10 @@ rdma-core-use-refcount_t-instead-of-atomic_t-on-refc.patch rdma-iwcm-fix-use-after-free-of-work-objects-after-c.patch i2c-tiny-usb-disable-zero-length-read-messages.patch i2c-robotfuzz-osif-disable-zero-length-read-messages.patch +alsa-usb-audio-fix-out-of-bounds-read-in-snd_usb_get.patch +attach_recursive_mnt-do-not-lock-the-covering-tree-w.patch +wifi-mac80211-fix-beacon-interval-calculation-overfl.patch +vsock-uapi-fix-linux-vm_sockets.h-userspace-compilat.patch +um-ubd-add-missing-error-check-in-start_io_thread.patch +net-enetc-correct-endianness-handling-in-_enetc_rd_r.patch +atm-release-atm_dev_mutex-after-removing-procfs-in-a.patch diff --git a/queue-5.4/um-ubd-add-missing-error-check-in-start_io_thread.patch b/queue-5.4/um-ubd-add-missing-error-check-in-start_io_thread.patch new file mode 100644 index 0000000000..00186ab071 --- /dev/null +++ b/queue-5.4/um-ubd-add-missing-error-check-in-start_io_thread.patch @@ -0,0 +1,37 @@ +From bda766e29ecd541accd3b1afb1676796ed1ab4ad Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Fri, 6 Jun 2025 20:44:25 +0800 +Subject: um: ubd: Add missing error check in start_io_thread() + +From: Tiwei Bie <tiwei.btw@antgroup.com> + +[ Upstream commit c55c7a85e02a7bfee20a3ffebdff7cbeb41613ef ] + +The subsequent call to os_set_fd_block() overwrites the previous +return value. OR the two return values together to fix it. + +Fixes: f88f0bdfc32f ("um: UBD Improvements") +Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> +Link: https://patch.msgid.link/20250606124428.148164-2-tiwei.btw@antgroup.com +Signed-off-by: Johannes Berg <johannes.berg@intel.com> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + arch/um/drivers/ubd_user.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c +index a1afe414ce481..fb5b1e7c133d8 100644 +--- a/arch/um/drivers/ubd_user.c ++++ b/arch/um/drivers/ubd_user.c +@@ -41,7 +41,7 @@ int start_io_thread(unsigned long sp, int *fd_out) + *fd_out = fds[1]; + + err = os_set_fd_block(*fd_out, 0); +- err = os_set_fd_block(kernel_fd, 0); ++ err |= os_set_fd_block(kernel_fd, 0); + if (err) { + printk("start_io_thread - failed to set nonblocking I/O.\n"); + goto out_close; +-- +2.39.5 + diff --git a/queue-5.4/vsock-uapi-fix-linux-vm_sockets.h-userspace-compilat.patch b/queue-5.4/vsock-uapi-fix-linux-vm_sockets.h-userspace-compilat.patch new file mode 100644 index 0000000000..3321a37313 --- /dev/null +++ b/queue-5.4/vsock-uapi-fix-linux-vm_sockets.h-userspace-compilat.patch @@ -0,0 +1,54 @@ +From 257d9a4ea35ddf913ec5d8216280cfb95f940737 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Mon, 23 Jun 2025 12:00:53 +0200 +Subject: vsock/uapi: fix linux/vm_sockets.h userspace compilation errors +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Stefano Garzarella <sgarzare@redhat.com> + +[ Upstream commit 22bbc1dcd0d6785fb390c41f0dd5b5e218d23bdd ] + +If a userspace application just include <linux/vm_sockets.h> will fail +to build with the following errors: + + /usr/include/linux/vm_sockets.h:182:39: error: invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr’ + 182 | unsigned char svm_zero[sizeof(struct sockaddr) - + | ^~~~~~ + /usr/include/linux/vm_sockets.h:183:39: error: ‘sa_family_t’ undeclared here (not in a function) + 183 | sizeof(sa_family_t) - + | + +Include <sys/socket.h> for userspace (guarded by ifndef __KERNEL__) +where `struct sockaddr` and `sa_family_t` are defined. +We already do something similar in <linux/mptcp.h> and <linux/if.h>. + +Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") +Reported-by: Daan De Meyer <daan.j.demeyer@gmail.com> +Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> +Link: https://patch.msgid.link/20250623100053.40979-1-sgarzare@redhat.com +Signed-off-by: Jakub Kicinski <kuba@kernel.org> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + include/uapi/linux/vm_sockets.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h +index 68d57c5e99bc0..f763d1caf27df 100644 +--- a/include/uapi/linux/vm_sockets.h ++++ b/include/uapi/linux/vm_sockets.h +@@ -17,6 +17,10 @@ + #ifndef _UAPI_VM_SOCKETS_H + #define _UAPI_VM_SOCKETS_H + ++#ifndef __KERNEL__ ++#include <sys/socket.h> /* for struct sockaddr and sa_family_t */ ++#endif ++ + #include <linux/socket.h> + + /* Option name for STREAM socket buffer size. Use as the option name in +-- +2.39.5 + diff --git a/queue-5.4/wifi-mac80211-fix-beacon-interval-calculation-overfl.patch b/queue-5.4/wifi-mac80211-fix-beacon-interval-calculation-overfl.patch new file mode 100644 index 0000000000..2c8c49230e --- /dev/null +++ b/queue-5.4/wifi-mac80211-fix-beacon-interval-calculation-overfl.patch @@ -0,0 +1,38 @@ +From 0b192b27396ebb3f40efd9aa5002b78ede2a3be4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin <sashal@kernel.org> +Date: Sat, 21 Jun 2025 22:32:09 +1000 +Subject: wifi: mac80211: fix beacon interval calculation overflow + +From: Lachlan Hodges <lachlan.hodges@morsemicro.com> + +[ Upstream commit 7a3750ff0f2e8fee338a9c168f429f6c37f0e820 ] + +As we are converting from TU to usecs, a beacon interval of +100*1024 usecs will lead to integer wrapping. To fix change +to use a u32. + +Fixes: 057d5f4ba1e4 ("mac80211: sync dtim_count to TSF") +Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com> +Link: https://patch.msgid.link/20250621123209.511796-1-lachlan.hodges@morsemicro.com +Signed-off-by: Johannes Berg <johannes.berg@intel.com> +Signed-off-by: Sasha Levin <sashal@kernel.org> +--- + net/mac80211/util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/mac80211/util.c b/net/mac80211/util.c +index 515fe1d539b49..415cd7f50815f 100644 +--- a/net/mac80211/util.c ++++ b/net/mac80211/util.c +@@ -3807,7 +3807,7 @@ void ieee80211_recalc_dtim(struct ieee80211_local *local, + { + u64 tsf = drv_get_tsf(local, sdata); + u64 dtim_count = 0; +- u16 beacon_int = sdata->vif.bss_conf.beacon_int * 1024; ++ u32 beacon_int = sdata->vif.bss_conf.beacon_int * 1024; + u8 dtim_period = sdata->vif.bss_conf.dtim_period; + struct ps_data *ps; + u8 bcns_from_dtim; +-- +2.39.5 + |