6.1.161-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 6.1.161-rc1 review
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 17 Jan 2026 16:41:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.161-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.1.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.1.161-rc1
Shardul Bankar <[email protected]>
bpf: test_run: Fix ctx leak in bpf_prog_test_run_xdp error path
Michal Rábek <[email protected]>
scsi: sg: Fix occasional bogus elapsed time that exceeds timeout
Alexander Stein <[email protected]>
ASoC: fsl_sai: Add missing registers to cache default
Andrew Elantsev <[email protected]>
ASoC: amd: yc: Add quirk for Honor MagicBook X16 2025
Tetsuo Handa <[email protected]>
can: j1939: make j1939_session_activate() fail if device is no longer registered
Sumeet Pawnikar <[email protected]>
powercap: fix sscanf() error return value handling
Sumeet Pawnikar <[email protected]>
powercap: fix race condition in register_control_type()
Tetsuo Handa <[email protected]>
bpf: Fix reference count leak in bpf_prog_test_run_xdp()
Toke Høiland-Jørgensen <[email protected]>
bpf, test_run: Subtract size of xdp_frame from allowed metadata size
Amery Hung <[email protected]>
bpf: Support specifying linear xdp packet data size for BPF_PROG_TEST_RUN
Amery Hung <[email protected]>
bpf: Make variables in bpf_prog_test_run_xdp less confusing
Yonghong Song <[email protected]>
bpf: Fix an issue in bpf_prog_test_run_xdp when page size greater than 4K
Chuck Lever <[email protected]>
NFSD: Remove NFSERR_EAGAIN
Mike Snitzer <[email protected]>
nfs_common: factor out nfs_errtbl and nfs_stat_to_errno
Chen Hanxiao <[email protected]>
NFS: trace: show TIMEDOUT instead of 0x6e
NeilBrown <[email protected]>
nfsd: provide locking for v4_end_grace
Haoxiang Li <[email protected]>
ALSA: ac97: fix a double free in snd_ac97_controller_register()
Takashi Iwai <[email protected]>
ALSA: ac97bus: Use guard() for mutex locks
Pedro Demarchi Gomes <[email protected]>
ksm: use range-walk function to jump over holes in scan_get_next_rmap_item
David Hildenbrand <[email protected]>
mm/pagewalk: add walk_page_range_vma()
Bartosz Golaszewski <[email protected]>
pinctrl: qcom: lpass-lpi: mark the GPIO controller as sleeping
Eric Dumazet <[email protected]>
arp: do not assume dev_hard_header() does not change skb->head
Wei Fang <[email protected]>
net: enetc: fix build warning when PAGE_SIZE is greater than 128K
Petko Manolov <[email protected]>
net: usb: pegasus: fix memory leak in update_eth_regs_async()
Xiang Mei <[email protected]>
net/sched: sch_qfq: Fix NULL deref when deactivating inactive aggregate in qfq_reset
René Rebe <[email protected]>
HID: quirks: work around VID/PID conflict for appledisplay
Mohammad Heib <[email protected]>
net: fix memory leak in skb_segment_list for GRO packets
Srijit Bose <[email protected]>
bnxt_en: Fix potential data corruption with HW GRO/LRO
Jakub Kicinski <[email protected]>
eth: bnxt: move and rename reset helpers
Zilin Guan <[email protected]>
net: wwan: iosm: Fix memory leak in ipc_mux_deinit()
Gal Pressman <[email protected]>
net/mlx5e: Don't print error message due to invalid module
Di Zhu <[email protected]>
netdev: preserve NETIF_F_ALL_FOR_ALL across TSO updates
Weiming Shi <[email protected]>
net: sock: fix hardened usercopy panic in sock_recv_errqueue
yuan.gao <[email protected]>
inet: ping: Fix icmp out counting
Jerry Wu <[email protected]>
net: mscc: ocelot: Fix crash when adding interface under a lag
Alexandre Knecht <[email protected]>
bridge: fix C-VLAN preservation in 802.1ad vlan_tunnel egress
Alok Tiwari <[email protected]>
net: marvell: prestera: fix NULL dereference on devlink_alloc() failure
Fernando Fernandez Mancera <[email protected]>
netfilter: nf_conncount: update last_gc only when GC has been performed
Zilin Guan <[email protected]>
netfilter: nf_tables: fix memory leak in nf_tables_newrule()
Fernando Fernandez Mancera <[email protected]>
netfilter: nft_synproxy: avoid possible data-race on update operation
Marek Vasut <[email protected]>
arm64: dts: imx8mp: Fix LAN8740Ai PHY reference clock on DH electronics i.MX8M Plus DHCOM
Ian Ray <[email protected]>
ARM: dts: imx6q-ba16: fix RTC interrupt level
Haibo Chen <[email protected]>
arm64: dts: add off-on-delay-us for usdhc2 regulator
Xingui Yang <[email protected]>
scsi: Revert "scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed"
Brian Kao <[email protected]>
scsi: ufs: core: Fix EH failure after W-LUN resume error
Wen Xiong <[email protected]>
scsi: ipr: Enable/disable IRQD_NO_BALANCING during reset
ChenXiaoSong <[email protected]>
smb/client: fix NT_STATUS_NO_DATA_DETECTED value
ChenXiaoSong <[email protected]>
smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
ChenXiaoSong <[email protected]>
smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
Trond Myklebust <[email protected]>
NFS: Fix up the automount fs_context to use the correct cred
Scott Mayhew <[email protected]>
NFSv4: ensure the open stateid seqid doesn't go backwards
Sam James <[email protected]>
alpha: don't reference obsolete termio struct for TC* constants
Sebastian Andrzej Siewior <[email protected]>
ARM: 9461/1: Disable HIGHPTE on PREEMPT_RT kernels
Yang Li <[email protected]>
csky: fix csky_cmpxchg_fixup not working
Kuniyuki Iwashima <[email protected]>
tls: Use __sk_dst_get() and dst_dev_rcu() in get_netdev_for_sock().
Sharath Chandra Vurukala <[email protected]>
net: Add locking to protect skb->dev access in ip_output
Ye Bin <[email protected]>
ext4: fix out-of-bound read in ext4_xattr_inode_dec_ref_all()
Ye Bin <[email protected]>
ext4: introduce ITAIL helper
Ilya Dryomov <[email protected]>
libceph: make calc_target() set t->paused, not just clear it
Ilya Dryomov <[email protected]>
libceph: return the handler error from mon_handle_auth_done()
Tuo Li <[email protected]>
libceph: make free_choose_arg_map() resilient to partial allocation
Ilya Dryomov <[email protected]>
libceph: replace overzealous BUG_ON in osdmap_apply_incremental()
ziming zhang <[email protected]>
libceph: prevent potential out-of-bounds reads in handle_auth_done()
Eric Dumazet <[email protected]>
wifi: avoid kernel-infoleak from struct iw_point
Bartosz Golaszewski <[email protected]>
gpio: rockchip: mark the GPIO controller as sleeping
Miaoqian Lin <[email protected]>
drm/pl111: Fix error handling in pl111_amba_probe
Alexander Sverdlin <[email protected]>
counter: interrupt-cnt: Drop IRQF_NO_THREAD flag
Eric Biggers <[email protected]>
lib/crypto: aes: Fix missing MMU protection for AES S-box
Alexander Usyskin <[email protected]>
mei: me: add nova lake point S DID
Filipe Manana <[email protected]>
btrfs: always detect conflicting inodes when logging inode refs
Thomas Fourier <[email protected]>
net: 3com: 3c59x: fix possible null dereference in vortex_probe1()
Thomas Fourier <[email protected]>
atm: Fix dma_free_coherent() size
-------------
Diffstat:
Makefile | 4 +- arch/alpha/include/uapi/asm/ioctls.h | 8 +- arch/arm/Kconfig | 2 +- arch/arm/boot/dts/imx6q-ba16.dtsi | 2 +- .../arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi | 1 + arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 1 + arch/csky/mm/fault.c | 4 +- drivers/atm/he.c | 3 +- drivers/counter/interrupt-cnt.c | 3 +- drivers/gpio/gpio-rockchip.c | 1 + drivers/gpu/drm/pl111/pl111_drv.c | 2 +- drivers/hid/hid-quirks.c | 9 ++ drivers/misc/mei/hw-me-regs.h | 2 + drivers/misc/mei/pci-me.c | 2 + drivers/net/ethernet/3com/3c59x.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 87 +++++++------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 4 +- drivers/net/ethernet/freescale/enetc/enetc.h | 4 +- .../ethernet/marvell/prestera/prestera_devlink.c | 2 + drivers/net/ethernet/mellanox/mlx5/core/port.c | 3 +- drivers/net/ethernet/mscc/ocelot.c | 6 +- drivers/net/usb/pegasus.c | 2 + drivers/net/wwan/iosm/iosm_ipc_mux.c | 6 + drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 2 +- drivers/powercap/powercap_sys.c | 22 ++-- drivers/scsi/ipr.c | 28 ++++- drivers/scsi/libsas/sas_internal.h | 14 --- drivers/scsi/sg.c | 20 ++-- drivers/ufs/core/ufshcd.c | 40 +++++-- fs/btrfs/tree-log.c | 6 +- fs/ext4/inode.c | 5 + fs/ext4/xattr.c | 32 +----- fs/ext4/xattr.h | 10 ++ fs/nfs/Kconfig | 1 + fs/nfs/namespace.c | 5 + fs/nfs/nfs2xdr.c | 70 +----------- fs/nfs/nfs3xdr.c | 108 ++++-------------- fs/nfs/nfs4proc.c | 13 ++- fs/nfs/nfs4trace.h | 1 + fs/nfs/nfs4xdr.c | 4 +- fs/nfs_common/Makefile | 2 + fs/nfs_common/common.c | 66 +++++++++++ fs/nfsd/Kconfig | 1 + fs/nfsd/netns.h | 2 + fs/nfsd/nfs4proc.c | 2 +- fs/nfsd/nfs4state.c | 42 ++++++- fs/nfsd/nfsctl.c | 3 +- fs/nfsd/nfsd.h | 1 - fs/nfsd/state.h | 2 +- fs/smb/client/nterr.h | 6 +- include/linux/netdevice.h | 3 +- include/linux/nfs_common.h | 16 +++ include/linux/pagewalk.h | 3 + include/net/dst.h | 12 ++ include/trace/misc/nfs.h | 3 +- include/uapi/linux/nfs.h | 1 - lib/crypto/aes.c | 4 +- mm/ksm.c | 126 ++++++++++++++++++--- mm/pagewalk.c | 20 ++++ net/bpf/test_run.c | 60 ++++++---- net/bridge/br_vlan_tunnel.c | 11 +- net/can/j1939/transport.c | 2 + net/ceph/messenger_v2.c | 2 + net/ceph/mon_client.c | 2 +- net/ceph/osd_client.c | 11 +- net/ceph/osdmap.c | 24 ++-- net/core/skbuff.c | 8 +- net/core/sock.c | 7 +- net/ipv4/arp.c | 7 +- net/ipv4/ip_output.c | 16 ++- net/ipv4/ping.c | 4 +- net/netfilter/nf_conncount.c | 2 +- net/netfilter/nf_tables_api.c | 3 +- net/netfilter/nft_synproxy.c | 6 +- net/sched/sch_qfq.c | 2 +- net/tls/tls_device.c | 18 +-- net/wireless/wext-core.c | 4 + net/wireless/wext-priv.c | 4 + sound/ac97/bus.c | 32 +++--- sound/soc/amd/yc/acp6x-mach.c | 7 ++ sound/soc/fsl/fsl_sai.c | 3 + .../selftests/bpf/prog_tests/xdp_adjust_tail.c | 96 ++++++++++++++-- .../bpf/prog_tests/xdp_context_test_run.c | 4 +- .../bpf/progs/test_xdp_adjust_tail_grow.c | 8 +- 84 files changed, 776 insertions(+), 423 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/72 atm: Fix dma_free_coherent() size
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Fourier <[email protected]>
commit 4d984b0574ff708e66152763fbfdef24ea40933f upstream.
The size of the buffer is not the same when alloc'd with dma_alloc_coherent() in he_init_tpdrq() and freed.
--- drivers/atm/he.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/atm/he.c +2 -1
@@ -1587,7 +1587,8 @@ he_stop(struct he_dev *he_dev) he_dev->tbrq_base, he_dev->tbrq_phys);if (he_dev->tpdrq_base) -dma_free_coherent (&he_dev->pci_dev->dev,CONFIG_TBRQ_SIZE *sizeof (struct he_tbrq ), +dma_free_coherent (&he_dev->pci_dev->dev, +CONFIG_TPDRQ_SIZE *sizeof (struct he_tpdrq ), he_dev->tpdrq_base, he_dev->tpdrq_phys);dma_pool_destroy (he_dev->tpd_pool);
Greg Kroah-Hartman
maintainerPATCH 2/72 net: 3com: 3c59x: fix possible null dereference in vortex_probe1()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Fourier <[email protected]>
commit a4e305ed60f7c41bbf9aabc16dd75267194e0de3 upstream.
pdev can be null and free_ring: can be called in 1297 with a null pdev.
--- drivers/net/ethernet/3com/3c59x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/3com/3c59x.c +1 -1
@@ -1473,7 +1473,7 @@ static int vortex_probe1(struct device *return 0 ; free_ring: -dma_free_coherent (&pdev->dev, +dma_free_coherent (gendev,sizeof (struct boom_rx_desc ) *RX_RING_SIZE +sizeof (struct boom_tx_desc ) *TX_RING_SIZE , vp->rx_ring, vp->rx_ring_dma);
Greg Kroah-Hartman
maintainerPATCH 3/72 btrfs: always detect conflicting inodes when logging inode refs
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
commit 7ba0b6461bc4edb3005ea6e00cdae189bcf908a5 upstream.
After rename exchanging (either with the rename exchange operation or regular renames in multiple non-atomic steps) two inodes and at least one of them is a directory, we can end up with a log tree that contains only of the inodes and after a power failure that can result in an attempt to delete the other inode when it should not because it was not deleted before the power failure. In some case that delete attempt fails when the target inode is a directory that contains a subvolume inside it, since the log replay code is not prepared to deal with directory entries that point to root items (only inode items).
1) We have directories "dir1" (inode A) and "dir2" (inode B) under the same parent directory;
2) We have a file (inode C) under directory "dir1" (inode A);
3) We have a subvolume inside directory "dir2" (inode B);
4) All these inodes were persisted in a past transaction and we are currently at transaction N;
5) We rename the file (inode C), so at btrfs_log_new_name() we update inode C's last_unlink_trans to N;
6) We get a rename exchange for "dir1" (inode A) and "dir2" (inode B), so after the exchange "dir1" is inode B and "dir2" is inode A. During the rename exchange we call btrfs_log_new_name() for inodes A and B, but because they are directories, we don't update their last_unlink_trans to N;
7) An fsync against the file (inode C) is done, and because its inode has a last_unlink_trans with a value of N we log its parent directory (inode A) (through btrfs_log_all_parents(), called from btrfs_log_inode_parent()).
8) So we end up with inode B not logged, which now has the old name of inode A. At copy_inode_items_to_log(), when logging inode A, we did not check if we had any conflicting inode to log because inode A has a generation lower than the current transaction (created in a past transaction);
9) After a power failure, when replaying the log tree, since we find that inode A has a new name that conflicts with the name of inode B in the fs tree, we attempt to delete inode B... this is wrong since that directory was never deleted before the power failure, and because there is a subvolume inside that directory, attempting to delete it will fail since replay_dir_deletes() and btrfs_unlink_inode() are not prepared to deal with dir items that point to roots instead of inodes.
When that happens the mount fails and we get a stack trace like the following:
[87.2314] BTRFS info (device dm-0): start tree-log replay [87.2318] BTRFS critical (device dm-0): failed to delete reference to subvol, root 5 inode 256 parent 259 [87.2332] ------------[ cut here ]------------ [87.2338] BTRFS: Transaction aborted (error -2) [87.2346] WARNING: CPU: 1 PID: 638968 at fs/btrfs/inode.c:4345 __btrfs_unlink_inode+0x416/0x440 [btrfs] [87.2368] Modules linked in: btrfs loop dm_thin_pool (...) [87.2470] CPU: 1 UID: 0 PID: 638968 Comm: mount Tainted: G W 6.18.0-rc7-btrfs-next-218+ #2 PREEMPT(full) [87.2489] Tainted: [W]=WARN [87.2494] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 [87.2514] RIP: 0010:__btrfs_unlink_inode+0x416/0x440 [btrfs] [87.2538] Code: c0 89 04 24 (...) [87.2568] RSP: 0018:ffffc0e741f4b9b8 EFLAGS: 00010286 [87.2574] RAX: 0000000000000000 RBX: ffff9d3ec8a6cf60 RCX: 0000000000000000 [87.2582] RDX: 0000000000000002 RSI: ffffffff84ab45a1 RDI: 00000000ffffffff [87.2591] RBP: ffff9d3ec8a6ef20 R08: 0000000000000000 R09: ffffc0e741f4b840 [87.2599] R10: ffff9d45dc1fffa8 R11: 0000000000000003 R12: ffff9d3ee26d77e0 [87.2608] R13: ffffc0e741f4ba98 R14: ffff9d4458040800 R15: ffff9d44b6b7ca10 [87.2618] FS: 00007f7b9603a840(0000) GS:ffff9d4658982000(0000) knlGS:0000000000000000 [87.2629] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [87.2637] CR2: 00007ffc9ec33b98 CR3: 000000011273e003 CR4: 0000000000370ef0 [87.2648] Call Trace: [87.2651] <TASK> [87.2654] btrfs_unlink_inode+0x15/0x40 [btrfs] [87.2661] unlink_inode_for_log_replay+0x27/0xf0 [btrfs] [87.2669] check_item_in_log+0x1ea/0x2c0 [btrfs] [87.2676] replay_dir_deletes+0x16b/0x380 [btrfs] [87.2684] fixup_inode_link_count+0x34b/0x370 [btrfs] [87.2696] fixup_inode_link_counts+0x41/0x160 [btrfs] [87.2703] btrfs_recover_log_trees+0x1ff/0x7c0 [btrfs] [87.2711] ? __pfx_replay_one_buffer+0x10/0x10 [btrfs] [87.2719] open_ctree+0x10bb/0x15f0 [btrfs] [87.2726] btrfs_get_tree.cold+0xb/0x16c [btrfs] [87.2734] ? fscontext_read+0x15c/0x180 [87.2740] ? rw_verify_area+0x50/0x180 [87.2746] vfs_get_tree+0x25/0xd0 [87.2750] vfs_cmd_create+0x59/0xe0 [87.2755] __do_sys_fsconfig+0x4f6/0x6b0 [87.2760] do_syscall_64+0x50/0x1220 [87.2764] entry_SYSCALL_64_after_hwframe+0x76/0x7e [87.2770] RIP: 0033:0x7f7b9625f4aa [87.2775] Code: 73 01 c3 48 (...) [87.2803] RSP: 002b:00007ffc9ec35b08 EFLAGS: 00000246 ORIG_RAX: 00000000000001af [87.2817] RAX: ffffffffffffffda RBX: 0000558bfa91ac20 RCX: 00007f7b9625f4aa [87.2829] RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003 [87.2842] RBP: 0000558bfa91b120 R08: 0000000000000000 R09: 0000000000000000 [87.2854] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [87.2864] R13: 00007f7b963f1580 R14: 00007f7b963f326c R15: 00007f7b963d8a23 [87.2877] </TASK> [87.2882] ---[ end trace 0000000000000000 ]--- [87.2891] BTRFS: error (device dm-0 state A) in __btrfs_unlink_inode:4345: errno=-2 No such entry [87.2904] BTRFS: error (device dm-0 state EAO) in do_abort_log_replay:191: errno=-2 No such entry [87.2915] BTRFS critical (device dm-0 state EAO): log tree (for root 5) leaf currently being processed (slot 7 key (258 12 257)): [87.2929] BTRFS info (device dm-0 state EAO): leaf 30736384 gen 10 total ptrs 7 free space 15712 owner 18446744073709551610 [87.2929] BTRFS info (device dm-0 state EAO): refs 3 lock_owner 0 current 638968 [87.2929] item 0 key (257 INODE_ITEM 0) itemoff 16123 itemsize 160 [87.2929] inode generation 9 transid 10 size 0 nbytes 0 [87.2929] block group 0 mode 40755 links 1 uid 0 gid 0 [87.2929] rdev 0 sequence 7 flags 0x0 [87.2929] atime 1765464494.678070921 [87.2929] ctime 1765464494.686606513 [87.2929] mtime 1765464494.686606513 [87.2929] otime 1765464494.678070921 [87.2929] item 1 key (257 INODE_REF 256) itemoff 16109 itemsize 14 [87.2929] index 4 name_len 4 [87.2929] item 2 key (257 DIR_LOG_INDEX 2) itemoff 16101 itemsize 8 [87.2929] dir log end 2 [87.2929] item 3 key (257 DIR_LOG_INDEX 3) itemoff 16093 itemsize 8 [87.2929] dir log end 18446744073709551615 [87.2930] item 4 key (257 DIR_INDEX 3) itemoff 16060 itemsize 33 [87.2930] location key (258 1 0) type 1 [87.2930] transid 10 data_len 0 name_len 3 [87.2930] item 5 key (258 INODE_ITEM 0) itemoff 15900 itemsize 160 [87.2930] inode generation 9 transid 10 size 0 nbytes 0 [87.2930] block group 0 mode 100644 links 1 uid 0 gid 0 [87.2930] rdev 0 sequence 2 flags 0x0 [87.2930] atime 1765464494.678456467 [87.2930] ctime 1765464494.686606513 [87.2930] mtime 1765464494.678456467 [87.2930] otime 1765464494.678456467 [87.2930] item 6 key (258 INODE_REF 257) itemoff 15887 itemsize 13 [87.2930] index 3 name_len 3 [87.2930] BTRFS critical (device dm-0 state EAO): log replay failed in unlink_inode_for_log_replay:1045 for root 5, stage 3, with error -2: failed to unlink inode 256 parent dir 259 name subvol root 5 [87.2963] BTRFS: error (device dm-0 state EAO) in btrfs_recover_log_trees:7743: errno=-2 No such entry [87.2981] BTRFS: error (device dm-0 state EAO) in btrfs_replay_log:2083: errno=-2 No such entry (Failed to recover log tr
So fix this by changing copy_inode_items_to_log() to always detect if there are conflicting inodes for the ref/extref of the inode being logged even if the inode was created in a past transaction.
A test case for fstests will follow soon.
--- fs/btrfs/tree-log.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/btrfs/tree-log.c +2 -4
@@ -5940,10 +5940,8 @@ again:* and no keys greater than that, so bail out. */ break ; - }else if ((min_key->type ==BTRFS_INODE_REF_KEY || - min_key->type ==BTRFS_INODE_EXTREF_KEY ) && - (inode->generation == trans->transid || - ctx->logging_conflict_inodes)) { + }else if (min_key->type ==BTRFS_INODE_REF_KEY || + min_key->type ==BTRFS_INODE_EXTREF_KEY ) {u64 other_ino =0 ;u64 other_parent =0 ;
Greg Kroah-Hartman
maintainerPATCH 4/72 mei: me: add nova lake point S DID
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Usyskin <[email protected]>
commit 420f423defcf6d0af2263d38da870ca4a20c0990 upstream.
Add Nova Lake S device id.
--- drivers/misc/mei/hw-me-regs.h | 2 ++ drivers/misc/mei/pci-me.c | 2 ++ 2 files changed, 4 insertions(+)
drivers/misc/mei/hw-me-regs.h +2 -0
@@ -122,6 +122,8 @@#define MEI_DEV_ID_WCL_P 0x4D70/* Wildcat Lake P */ +#define MEI_DEV_ID_NVL_S 0x6E68/* Nova Lake Point S */ +/* * MEI HW Section */
drivers/misc/mei/pci-me.c +2 -0
@@ -129,6 +129,8 @@ static const struct pci_device_id mei_me {MEI_PCI_DEVICE(MEI_DEV_ID_WCL_P, MEI_ME_PCH15_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_NVL_S, MEI_ME_PCH15_CFG)}, +/* required last entry */ {0, } };
Greg Kroah-Hartman
maintainerPATCH 5/72 lib/crypto: aes: Fix missing MMU protection for AES S-box
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <[email protected]>
commit 74d74bb78aeccc9edc10db216d6be121cf7ec176 upstream.
__cacheline_aligned puts the data in the ".data..cacheline_aligned" section, which isn't marked read-only i.e. it doesn't receive MMU protection. Replace it with ____cacheline_aligned which does the right thing and just aligns the data while keeping it in ".rodata".
--- lib/crypto/aes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/crypto/aes.c +2 -2
@@ -12,7 +12,7 @@* Emit the sbox as volatile const to prevent the compiler from doing * constant folding on sbox references involving fixed indexes. */ -static volatile const u8 __cacheline_aligned aes_sbox[] = { +static volatile const u8 ____cacheline_aligned aes_sbox[] = {0x63 ,0x7c ,0x77 ,0x7b ,0xf2 ,0x6b ,0x6f ,0xc5 ,0x30 ,0x01 ,0x67 ,0x2b ,0xfe ,0xd7 ,0xab ,0x76 ,0xca ,0x82 ,0xc9 ,0x7d ,0xfa ,0x59 ,0x47 ,0xf0 ,
@@ -47,7 +47,7 @@ static volatile const u8 __cacheline_ali 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16, }; -static volatile const u8 __cacheline_aligned aes_inv_sbox[] = { +static volatile const u8 ____cacheline_aligned aes_inv_sbox[] = {0x52 ,0x09 ,0x6a ,0xd5 ,0x30 ,0x36 ,0xa5 ,0x38 ,0xbf ,0x40 ,0xa3 ,0x9e ,0x81 ,0xf3 ,0xd7 ,0xfb ,0x7c ,0xe3 ,0x39 ,0x82 ,0x9b ,0x2f ,0xff ,0x87 ,
Greg Kroah-Hartman
maintainerPATCH 6/72 counter: interrupt-cnt: Drop IRQF_NO_THREAD flag
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Sverdlin <[email protected]>
commit 23f9485510c338476b9735d516c1d4aacb810d46 upstream.
An IRQ handler can either be IRQF_NO_THREAD or acquire spinlock_t, as CONFIG_PROVE_RAW_LOCK_NESTING warns:
=============================
[ BUG: Invalid wait context ]
6.18.0-rc1+git... #1
-----------------------------
some-user-space-process/1251 is trying to lock:
(&counter->events_list_lock){....}-{3:3}, at: counter_push_event [counter] other info that might help us debug this:
context-{2:2}
no locks held by some-user-space-process/....
stack backtrace: CPU: 0 UID: 0 PID: 1251 Comm: some-user-space-process 6.18.0-rc1+git... #1 PREEMPT Call trace: show_stack (C) dump_stack_lvl dump_stack __lock_acquire lock_acquire _raw_spin_lock_irqsave counter_push_event [counter] interrupt_cnt_isr [interrupt_cnt] __handle_irq_event_percpu handle_irq_event handle_simple_irq handle_irq_desc generic_handle_domain_irq gpio_irq_handler handle_irq_desc generic_handle_domain_irq gic_handle_irq call_on_irq_stack do_interrupt_handler el0_interrupt __el0_irq_handler_common el0t_64_irq_handler el0t_64_irq
... and Sebastian correctly points out. Remove IRQF_NO_THREAD as an alternative to switching to raw_spinlock_t, because the latter would limit all potential nested locks to raw_spinlock_t only.
--- drivers/counter/interrupt-cnt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/counter/interrupt-cnt.c +1 -2
@@ -229,8 +229,7 @@ static int interrupt_cnt_probe(struct plirq_set_status_flags (priv->irq,IRQ_NOAUTOEN ); ret =devm_request_irq (dev, priv->irq, interrupt_cnt_isr, -IRQF_TRIGGER_RISING |IRQF_NO_THREAD , -dev_name (dev), counter); +IRQF_TRIGGER_RISING ,dev_name (dev), counter);if (ret)return ret;
Greg Kroah-Hartman
maintainerPATCH 7/72 drm/pl111: Fix error handling in pl111_amba_probe
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
commit 0ddd3bb4b14c9102c0267b3fd916c81fe5ab89c1 upstream.
Jump to the existing dev_put label when devm_request_irq() fails so drm_dev_put() and of_reserved_mem_device_release() run instead of returning early and leaking resources.
Found via static analysis and code review.
--- drivers/gpu/drm/pl111/pl111_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/pl111/pl111_drv.c +1 -1
@@ -297,7 +297,7 @@ static int pl111_amba_probe(struct amba_ variant->name, priv);if (ret !=0 ) {dev_err (dev,"%s failed irq %d\n" , __func__, ret); -return ret; + goto dev_put; } ret =pl111_modeset_init (drm);
Greg Kroah-Hartman
maintainerPATCH 8/72 gpio: rockchip: mark the GPIO controller as sleeping
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
commit 20cf2aed89ac6d78a0122e31c875228e15247194 upstream.
The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization.
This can cause the following lockdep splat with shared GPIOs enabled on boards which have multiple devices using the same GPIO:
BUG: sleeping function called from invalid context at
kernel/locking/mutex.c:591in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 12, name:
kworker/u16:0preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
6 locks held by kworker/u16:0/12:
#0: ffff0001f0018d48 ((wq_completion)events_unbound#2){+.+.}-{0:0},
at: process_one_work+0x18c/0x604
#1: ffff8000842dbdf0 (deferred_probe_work){+.+.}-{0:0}, at:
process_one_work+0x1b4/0x604
#2: ffff0001f18498f8 (&dev->mutex){....}-{4:4}, at:
__device_attach+0x38/0x1b0
#3: ffff0001f75f1e90 (&gdev->srcu){.+.?}-{0:0}, at:
gpiod_direction_output_raw_commit+0x0/0x360
#4: ffff0001f46e3db8 (&shared_desc->spinlock){....}-{3:3}, at:
gpio_shared_proxy_direction_output+0xd0/0x144 [gpio_shared_proxy]
#5: ffff0001f180ee90 (&gdev->srcu){.+.?}-{0:0}, at:
gpiod_direction_output_raw_commit+0x0/0x360
irq event stamp: 81450
hardirqs last enabled at (81449): [<ffff8000813acba4>]
_raw_spin_unlock_irqrestore+0x74/0x78
hardirqs last disabled at (81450): [<ffff8000813abfb8>]
_raw_spin_lock_irqsave+0x84/0x88
softirqs last enabled at (79616): [<ffff8000811455fc>]
__alloc_skb+0x17c/0x1e8
softirqs last disabled at (79614): [<ffff8000811455fc>]
__alloc_skb+0x17c/0x1e8
CPU: 2 UID: 0 PID: 12 Comm: kworker/u16:0 Not tainted
6.19.0-rc4-next-20260105+ #11975 PREEMPT
Hardware name: Hardkernel ODROID-M1 (DT)
Workqueue: events_unbound deferred_probe_work_func
Call trace:
show_stack+0x18/0x24 (C)
dump_stack_lvl+0x90/0xd0
dump_stack+0x18/0x24
__might_resched+0x144/0x248
__might_sleep+0x48/0x98
__mutex_lock+0x5c/0x894
mutex_lock_nested+0x24/0x30
pinctrl_get_device_gpio_range+0x44/0x128
pinctrl_gpio_direction+0x3c/0xe0
pinctrl_gpio_direction_output+0x14/0x20
rockchip_gpio_direction_output+0xb8/0x19c
gpiochip_direction_output+0x38/0x94
gpiod_direction_output_raw_commit+0x1d8/0x360
gpiod_direction_output_nonotify+0x7c/0x230
gpiod_direction_output+0x34/0xf8
gpio_shared_proxy_direction_output+0xec/0x144 [gpio_shared_proxy]
gpiochip_direction_output+0x38/0x94
gpiod_direction_output_raw_commit+0x1d8/0x360
gpiod_direction_output_nonotify+0x7c/0x230
gpiod_configure_flags+0xbc/0x480
gpiod_find_and_request+0x1a0/0x574
gpiod_get_index+0x58/0x84
devm_gpiod_get_index+0x20/0xb4
devm_gpiod_get_optional+0x18/0x30
rockchip_pcie_probe+0x98/0x380
platform_probe+0x5c/0xac
really_probe+0xbc/0x298--- drivers/gpio/gpio-rockchip.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-rockchip.c +1 -0
@@ -584,6 +584,7 @@ static int rockchip_gpiolib_register(str gc->ngpio = bank->nr_pins; gc->label = bank->name; gc->parent = bank->dev; + gc->can_sleep = true; ret =gpiochip_add_data (gc, bank);if (ret) {
Greg Kroah-Hartman
maintainerPATCH 9/72 wifi: avoid kernel-infoleak from struct iw_point
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 21cbf883d073abbfe09e3924466aa5e0449e7261 upstream.
struct iw_point has a 32bit hole on 64bit arches.
struct iw_point {
void __user *pointer; /* Pointer to the data (in user space) */ __u16 length; /* number of fields or size in bytes */ __u16 flags; /* Optional params */
};
Make sure to zero the structure to avoid disclosing 32bits of kernel data to user space.
--- net/wireless/wext-core.c | 4 ++++ net/wireless/wext-priv.c | 4 ++++ 2 files changed, 8 insertions(+)
net/wireless/wext-core.c +4 -0
@@ -1084,6 +1084,10 @@ static int compat_standard_call(struct nreturn ioctl_standard_call (dev, iwr, cmd, info, handler); iwp_compat = (struct compat_iw_point *) &iwr->u.data; + +/* struct iw_point has a 32bit hole on 64bit arches. */ +memset (&iwp,0 ,sizeof (iwp)); + iwp.pointer =compat_ptr (iwp_compat->pointer); iwp.length = iwp_compat->length; iwp.flags = iwp_compat->flags;
net/wireless/wext-priv.c +4 -0
@@ -228,6 +228,10 @@ int compat_private_call(struct net_devicstruct iw_point iwp; iwp_compat = (struct compat_iw_point *) &iwr->u.data; + +/* struct iw_point has a 32bit hole on 64bit arches. */ +memset (&iwp,0 ,sizeof (iwp)); + iwp.pointer =compat_ptr (iwp_compat->pointer); iwp.length = iwp_compat->length; iwp.flags = iwp_compat->flags;
Greg Kroah-Hartman
maintainerPATCH 10/72 libceph: prevent potential out-of-bounds reads in handle_auth_done()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: ziming zhang <[email protected]>
commit 818156caffbf55cb4d368f9c3cac64e458fb49c9 upstream.
Perform an explicit bounds check on payload_len to avoid a possible out-of-bounds access in the callout.
[ idryomov: changelog ]
--- net/ceph/messenger_v2.c | 2 ++ 1 file changed, 2 insertions(+)
net/ceph/messenger_v2.c +2 -0
@@ -2187,7 +2187,9 @@ static int process_auth_done(struct cephceph_decode_64_safe (&p, end, global_id, bad);ceph_decode_32_safe (&p, end, con->v2.con_mode, bad); +ceph_decode_32_safe (&p, end, payload_len, bad); +ceph_decode_need (&p, end, payload_len, bad);dout ("%s con %p global_id %llu con_mode %d payload_len %d\n" , __func__, con, global_id, con->v2.con_mode, payload_len);
Greg Kroah-Hartman
maintainerPATCH 11/72 libceph: replace overzealous BUG_ON in osdmap_apply_incremental()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit e00c3f71b5cf75681dbd74ee3f982a99cb690c2b upstream.
If the osdmap is (maliciously) corrupted such that the incremental osdmap epoch is different from what is expected, there is no need to BUG. Instead, just declare the incremental osdmap to be invalid.
--- net/ceph/osdmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ceph/osdmap.c +3 -1
@@ -1979,11 +1979,13 @@ struct ceph_osdmap *osdmap_apply_increme sizeof(u64) + sizeof(u32), e_inval);ceph_decode_copy (p, &fsid,sizeof (fsid)); epoch =ceph_decode_32 (p); -BUG_ON (epoch != map->epoch+1 );ceph_decode_copy (p, &modified,sizeof (modified)); new_pool_max =ceph_decode_64 (p); new_flags =ceph_decode_32 (p); +if (epoch != map->epoch +1 ) + goto e_inval; +/* full map? */ ceph_decode_32_safe (p, end, len, e_inval);if (len >0 ) {
Greg Kroah-Hartman
maintainerPATCH 12/72 libceph: make free_choose_arg_map() resilient to partial allocation
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tuo Li <[email protected]>
commit e3fe30e57649c551757a02e1cad073c47e1e075e upstream.
free_choose_arg_map() may dereference a NULL pointer if its caller fails after a partial allocation.
For example, in decode_choose_args(), if allocation of arg_map->args fails, execution jumps to the fail label and free_choose_arg_map() is called. Since arg_map->size is updated to a non-zero value before memory allocation, free_choose_arg_map() will iterate over arg_map->args and dereference a NULL pointer.
To prevent this potential NULL pointer dereference and make free_choose_arg_map() more resilient, add checks for pointers before iterating.
--- net/ceph/osdmap.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
net/ceph/osdmap.c +12 -8
@@ -241,22 +241,26 @@ static struct crush_choose_arg_map *allostatic void free_choose_arg_map (struct crush_choose_arg_map *arg_map) { -if (arg_map) { -int i, j; +int i, j; -WARN_ON (!RB_EMPTY_NODE (&arg_map->node)); +if (!arg_map) +return ; +WARN_ON (!RB_EMPTY_NODE (&arg_map->node)); + +if (arg_map->args) {for (i =0 ; i < arg_map->size; i++) {struct crush_choose_arg *arg = &arg_map->args[i]; - -for (j =0 ; j < arg->weight_set_size; j++) -kfree (arg->weight_set[j].weights); -kfree (arg->weight_set); +if (arg->weight_set) { +for (j =0 ; j < arg->weight_set_size; j++) +kfree (arg->weight_set[j].weights); +kfree (arg->weight_set); + }kfree (arg->ids); }kfree (arg_map->args); -kfree (arg_map); } +kfree (arg_map); } DEFINE_RB_FUNCS(choose_arg_map, struct crush_choose_arg_map, choose_args_index,
Greg Kroah-Hartman
maintainerPATCH 13/72 libceph: return the handler error from mon_handle_auth_done()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit e84b48d31b5008932c0a0902982809fbaa1d3b70 upstream.
Currently any error from ceph_auth_handle_reply_done() is propagated via finish_auth() but isn't returned from mon_handle_auth_done(). This results in higher layers learning that (despite the monitor considering us to be successfully authenticated) something went wrong in the authentication phase and reacting accordingly, but msgr2 still trying to proceed with establishing the session in the background. In the case of secure mode this can trigger a WARN in setup_crypto() and later lead to a NULL pointer dereference inside of prepare_auth_signature().
--- net/ceph/mon_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ceph/mon_client.c +1 -1
@@ -1417,7 +1417,7 @@ static int mon_handle_auth_done(struct cif (!ret)finish_hunting (monc);mutex_unlock (&monc->mutex); -return 0 ; +return ret; } static int mon_handle_auth_bad_method(struct ceph_connection *con,
Greg Kroah-Hartman
maintainerPATCH 14/72 libceph: make calc_target() set t->paused, not just clear it
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit c0fe2994f9a9d0a2ec9e42441ea5ba74b6a16176 upstream.
Currently calc_target() clears t->paused if the request shouldn't be paused anymore, but doesn't ever set t->paused even though it's able to determine when the request should be paused. Setting t->paused is left to __submit_request() which is fine for regular requests but doesn't work for linger requests -- since __submit_request() doesn't operate on linger requests, there is nowhere for lreq->t.paused to be set. One consequence of this is that watches don't get reestablished on paused -> unpaused transitions in cases where requests have been paused long enough for the (paused) unwatch request to time out and for the subsequent (re)watch request to enter the paused state. On top of the watch not getting reestablished, rbd_reregister_watch() gets stuck with rbd_dev->watch_mutex held:
rbd_register_watch
__rbd_register_watch
ceph_osdc_watch
linger_reg_commit_wait
It's waiting for lreq->reg_commit_wait to be completed, but for that to happen the respective request needs to end up on need_resend_linger list and be kicked when requests are unpaused. There is no chance for that if the request in question is never marked paused in the first place.
The fact that rbd_dev->watch_mutex remains taken out forever then prevents the image from getting unmapped -- "rbd unmap" would inevitably hang in D state on an attempt to grab the mutex.
--- net/ceph/osd_client.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
net/ceph/osd_client.c +9 -2
@@ -1529,6 +1529,7 @@ static enum calc_target_result calc_targstruct ceph_pg_pool_info *pi;struct ceph_pg pgid, last_pgid;struct ceph_osds up, acting; +bool should_be_paused;bool is_read = t->flags &CEPH_OSD_FLAG_READ ;bool is_write = t->flags &CEPH_OSD_FLAG_WRITE ;bool force_resend = false;
@@ -1597,10 +1598,16 @@ static enum calc_target_result calc_targ &last_pgid)) force_resend = true; -if (t->paused && !target_should_be_paused (osdc, t, pi)) { - t->paused = false; + should_be_paused =target_should_be_paused (osdc, t, pi); +if (t->paused && !should_be_paused) { unpaused = true; } +if (t->paused != should_be_paused) { +dout ("%s t %p paused %d -> %d\n" , __func__, t, t->paused, + should_be_paused); + t->paused = should_be_paused; + } + legacy_change =ceph_pg_compare (&t->pgid, &pgid) ||ceph_osds_changed (&t->acting, &acting, t->used_replica || any_change);
Greg Kroah-Hartman
maintainerPATCH 15/72 ext4: introduce ITAIL helper
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ye Bin <[email protected]>
[ Upstream commit 69f3a3039b0d0003de008659cafd5a1eaaa0a7a4 ]
Introduce ITAIL helper to get the bound of xattr in inode.
--- fs/ext4/xattr.c | 10 +++++----- fs/ext4/xattr.h | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-)
fs/ext4/xattr.c +5 -5
@@ -599,7 +599,7 @@ ext4_xattr_ibody_get(struct inode *inodereturn error; raw_inode =ext4_raw_inode (&iloc); header =IHDR (inode, raw_inode); - end = (void *)raw_inode +EXT4_SB (inode->i_sb)->s_inode_size; + end =ITAIL (inode, raw_inode); error =xattr_check_inode (inode, header, end);if (error) goto cleanup;
@@ -744,7 +744,7 @@ ext4_xattr_ibody_list(struct dentry *denreturn error; raw_inode =ext4_raw_inode (&iloc); header =IHDR (inode, raw_inode); - end = (void *)raw_inode +EXT4_SB (inode->i_sb)->s_inode_size; + end =ITAIL (inode, raw_inode); error =xattr_check_inode (inode, header, end);if (error) goto cleanup;
@@ -830,7 +830,7 @@ int ext4_get_inode_usage(struct inode *i goto out; raw_inode =ext4_raw_inode (&iloc); header =IHDR (inode, raw_inode); - end = (void *)raw_inode +EXT4_SB (inode->i_sb)->s_inode_size; + end =ITAIL (inode, raw_inode); ret =xattr_check_inode (inode, header, end);if (ret) goto out;
@@ -2195,7 +2195,7 @@ int ext4_xattr_ibody_find(struct inode * header =IHDR (inode, raw_inode); is->s.base = is->s.first =IFIRST (header); is->s.here = is->s.first; - is->s.end = (void *)raw_inode +EXT4_SB (inode->i_sb)->s_inode_size; + is->s.end =ITAIL (inode, raw_inode);if (ext4_test_inode_state (inode,EXT4_STATE_XATTR )) { error =xattr_check_inode (inode, header, is->s.end);if (error)
@@ -2746,7 +2746,7 @@ retry:*/ base =IFIRST (header); - end = (void *)raw_inode +EXT4_SB (inode->i_sb)->s_inode_size; + end =ITAIL (inode, raw_inode); min_offs = end - base; total_ino =sizeof (struct ext4_xattr_ibody_header ) +sizeof (u32);
fs/ext4/xattr.h +3 -0
@@ -68,6 +68,9 @@ struct ext4_xattr_entry { ((void *)raw_inode + \ EXT4_GOOD_OLD_INODE_SIZE + \ EXT4_I(inode)->i_extra_isize)) +#define ITAIL (inode, raw_inode) \ + ((void *)(raw_inode) + \ + EXT4_SB((inode)->i_sb)->s_inode_size)#define IFIRST (hdr) ((struct ext4_xattr_entry *)((hdr)+1))/*
Greg Kroah-Hartman
maintainerPATCH 16/72 ext4: fix out-of-bound read in ext4_xattr_inode_dec_ref_all()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ye Bin <[email protected]>
[ Upstream commit 5701875f9609b000d91351eaa6bfd97fe2f157f4 ]
There's issue as follows:
BUG: KASAN: use-after-free in ext4_xattr_inode_dec_ref_all+0x6ff/0x790
Read of size 4 at addr ffff88807b003000 by task syz-executor.0/15172
CPU: 3 PID: 15172 Comm: syz-executor.0
Call Trace:
__dump_stack lib/dump_stack.c:82 [inline]
dump_stack+0xbe/0xfd lib/dump_stack.c:123
print_address_description.constprop.0+0x1e/0x280 mm/kasan/report.c:400
__kasan_report.cold+0x6c/0x84 mm/kasan/report.c:560
kasan_report+0x3a/0x50 mm/kasan/report.c:585
ext4_xattr_inode_dec_ref_all+0x6ff/0x790 fs/ext4/xattr.c:1137
ext4_xattr_delete_inode+0x4c7/0xda0 fs/ext4/xattr.c:2896
ext4_evict_inode+0xb3b/0x1670 fs/ext4/inode.c:323
evict+0x39f/0x880 fs/inode.c:622
iput_final fs/inode.c:1746 [inline]
iput fs/inode.c:1772 [inline]
iput+0x525/0x6c0 fs/inode.c:1758
ext4_orphan_cleanup fs/ext4/super.c:3298 [inline]
ext4_fill_super+0x8c57/0xba40 fs/ext4/super.c:5300
mount_bdev+0x355/0x410 fs/super.c:1446
legacy_get_tree+0xfe/0x220 fs/fs_context.c:611
vfs_get_tree+0x8d/0x2f0 fs/super.c:1576
do_new_mount fs/namespace.c:2983 [inline]
path_mount+0x119a/0x1ad0 fs/namespace.c:3316
do_mount+0xfc/0x110 fs/namespace.c:3329
__do_sys_mount fs/namespace.c:3540 [inline]
__se_sys_mount+0x219/0x2e0 fs/namespace.c:3514
do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x67/0xd1
Memory state around the buggy address:
ffff88807b002f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88807b002f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88807b003000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88807b003080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88807b003100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffAbove issue happens as ext4_xattr_delete_inode() isn't check xattr is valid if xattr is in inode.
To solve above issue call xattr_check_inode() check if xattr if valid in inode. In fact, we can directly verify in ext4_iget_extra_inode(), so that there is no divergent verification.
--- fs/ext4/inode.c | 5 +++++ fs/ext4/xattr.c | 26 +------------------------- fs/ext4/xattr.h | 7 +++++++ 3 files changed, 13 insertions(+), 25 deletions(-)
fs/ext4/inode.c +5 -0
@@ -4752,6 +4752,11 @@ static inline int ext4_iget_extra_inode( *magic == cpu_to_le32(EXT4_XATTR_MAGIC)) {int err; + err =xattr_check_inode (inode,IHDR (inode, raw_inode), +ITAIL (inode, raw_inode)); +if (err) +return err; +ext4_set_inode_state (inode,EXT4_STATE_XATTR ); err =ext4_find_inline_data_nolock (inode);if (!err &&ext4_has_inline_data (inode))
fs/ext4/xattr.c +1 -25
@@ -263,7 +263,7 @@ errout: __ext4_xattr_check_block((inode), (bh), __func__, __LINE__) -static int +int __xattr_check_inode (struct inode *inode,struct ext4_xattr_ibody_header *header,void *end,const char *function,unsigned int line) {
@@ -280,9 +280,6 @@ errout:return error; } -#define xattr_check_inode (inode, header, end) \ - __xattr_check_inode((inode), (header), (end), __func__, __LINE__) -static int xattr_find_entry (struct inode *inode,struct ext4_xattr_entry **pentry,void *end,int name_index,const char *name,int sorted)
@@ -600,9 +597,6 @@ ext4_xattr_ibody_get(struct inode *inode raw_inode =ext4_raw_inode (&iloc); header =IHDR (inode, raw_inode); end =ITAIL (inode, raw_inode); - error =xattr_check_inode (inode, header, end); -if (error) - goto cleanup; entry =IFIRST (header); error =xattr_find_entry (inode, &entry, end, name_index, name,0 );if (error)
@@ -734,7 +728,6 @@ ext4_xattr_ibody_list(struct dentry *denstruct ext4_xattr_ibody_header *header;struct ext4_inode *raw_inode;struct ext4_iloc iloc; -void *end;int error;if (!ext4_test_inode_state (inode,EXT4_STATE_XATTR ))
@@ -744,14 +737,9 @@ ext4_xattr_ibody_list(struct dentry *denreturn error; raw_inode =ext4_raw_inode (&iloc); header =IHDR (inode, raw_inode); - end =ITAIL (inode, raw_inode); - error =xattr_check_inode (inode, header, end); -if (error) - goto cleanup; error =ext4_xattr_list_entries (dentry,IFIRST (header), buffer, buffer_size); -cleanup:brelse (iloc.bh);return error; }
@@ -819,7 +807,6 @@ int ext4_get_inode_usage(struct inode *istruct ext4_xattr_ibody_header *header;struct ext4_xattr_entry *entry;qsize_t ea_inode_refs =0 ; -void *end;int ret;lockdep_assert_held_read (&EXT4_I (inode)->xattr_sem);
@@ -830,10 +817,6 @@ int ext4_get_inode_usage(struct inode *i goto out; raw_inode =ext4_raw_inode (&iloc); header =IHDR (inode, raw_inode); - end =ITAIL (inode, raw_inode); - ret =xattr_check_inode (inode, header, end); -if (ret) - goto out;for (entry =IFIRST (header); !IS_LAST_ENTRY (entry); entry =EXT4_XATTR_NEXT (entry))
@@ -2197,9 +2180,6 @@ int ext4_xattr_ibody_find(struct inode * is->s.here = is->s.first; is->s.end =ITAIL (inode, raw_inode);if (ext4_test_inode_state (inode,EXT4_STATE_XATTR )) { - error =xattr_check_inode (inode, header, is->s.end); -if (error) -return error;/* Find the named attribute. */ error =xattr_find_entry (inode, &is->s.here, is->s.end, i->name_index, i->name,0 );
@@ -2750,10 +2730,6 @@ retry: min_offs = end - base; total_ino =sizeof (struct ext4_xattr_ibody_header ) +sizeof (u32); - error =xattr_check_inode (inode, header, end); -if (error) - goto cleanup; - ifree =ext4_xattr_free_space (base, &min_offs, base, &total_ino);if (ifree >= isize_diff) goto shift;
fs/ext4/xattr.h +7 -0
@@ -210,6 +210,13 @@ extern int ext4_xattr_ibody_set(handle_textern struct mb_cache *ext4_xattr_create_cache (void );extern void ext4_xattr_destroy_cache (struct mb_cache *); +extern int +__xattr_check_inode (struct inode *inode,struct ext4_xattr_ibody_header *header, +void *end,const char *function,unsigned int line); + +#define xattr_check_inode (inode, header, end) \ + __xattr_check_inode((inode), (header), (end), __func__, __LINE__) +#ifdef CONFIG_EXT4_FS_SECURITY extern int ext4_init_security (handle_t *handle,struct inode *inode,struct inode *dir,const struct qstr *qstr);
Greg Kroah-Hartman
maintainerPATCH 17/72 net: Add locking to protect skb->dev access in ip_output
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sharath Chandra Vurukala <[email protected]>
[ Upstream commit 1dbf1d590d10a6d1978e8184f8dfe20af22d680a]
In ip_output() skb->dev is updated from the skb_dst(skb)->dev this can become invalid when the interface is unregistered and freed,
Introduced new skb_dst_dev_rcu() function to be used instead of skb_dst_dev() within rcu_locks in ip_output.This will ensure that all the skb's associated with the dev being deregistered will be transnmitted out first, before freeing the dev.
Given that ip_output() is called within an rcu_read_lock() critical section or from a bottom-half context, it is safe to introduce an RCU read-side critical section within it.
Multiple panic call stacks were observed when UL traffic was run in concurrency with device deregistration from different functions, pasting one sample for reference.
[496733.627565][T13385] Call trace: [496733.627570][T13385] bpf_prog_ce7c9180c3b128ea_cgroupskb_egres+0x24c/0x7f0 [496733.627581][T13385] __cgroup_bpf_run_filter_skb+0x128/0x498 [496733.627595][T13385] ip_finish_output+0xa4/0xf4 [496733.627605][T13385] ip_output+0x100/0x1a0 [496733.627613][T13385] ip_send_skb+0x68/0x100 [496733.627618][T13385] udp_send_skb+0x1c4/0x384 [496733.627625][T13385] udp_sendmsg+0x7b0/0x898 [496733.627631][T13385] inet_sendmsg+0x5c/0x7c [496733.627639][T13385] __sys_sendto+0x174/0x1e4 [496733.627647][T13385] __arm64_sys_sendto+0x28/0x3c [496733.627653][T13385] invoke_syscall+0x58/0x11c [496733.627662][T13385] el0_svc_common+0x88/0xf4 [496733.627669][T13385] do_el0_svc+0x2c/0xb0 [496733.627676][T13385] el0_svc+0x2c/0xa4 [496733.627683][T13385] el0t_64_sync_handler+0x68/0xb4 [496733.627689][T13385] el0t_64_sync+0x1a4/0x1a8
Changes in v3:
- Replaced WARN_ON() with WARN_ON_ONCE(), as suggested by Willem de Bruijn.
- Dropped legacy lines mistakenly pulled in from an outdated branch.
Changes in v2:
- Addressed review comments from Eric Dumazet
- Used READ_ONCE() to prevent potential load/store tearing
- Added skb_dst_dev_rcu() and used along with rcu_read_lock() in ip_output
--- include/net/dst.h | 12 ++++++++++++ net/ipv4/ip_output.c | 16 +++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-)
include/net/dst.h +12 -0
@@ -555,6 +555,18 @@ static inline void skb_dst_update_pmtu_n dst->ops->update_pmtu (dst,NULL , skb, mtu, false); } +static inline struct net_device *dst_dev_rcu (const struct dst_entry *dst) +{ +/* In the future, use rcu_dereference(dst->dev) */ +WARN_ON_ONCE (!rcu_read_lock_held ()); +return READ_ONCE (dst->dev); +} + +static inline struct net_device *skb_dst_dev_rcu (const struct sk_buff *skb) +{ +return dst_dev_rcu (skb_dst (skb)); +} +struct dst_entry *dst_blackhole_check (struct dst_entry *dst,u32 cookie);void dst_blackhole_update_pmtu (struct dst_entry *dst,struct sock *sk,struct sk_buff *skb,u32 mtu,bool confirm_neigh);
net/ipv4/ip_output.c +11 -5
@@ -420,17 +420,23 @@ int ip_mc_output(struct net *net, structint ip_output (struct net *net,struct sock *sk,struct sk_buff *skb) { -struct net_device *dev =skb_dst (skb)->dev, *indev = skb->dev; +struct net_device *dev, *indev = skb->dev; +int ret_val; + +rcu_read_lock (); + dev =skb_dst_dev_rcu (skb);IP_UPD_PO_STATS (net,IPSTATS_MIB_OUT , skb->len); skb->dev = dev; skb->protocol =htons (ETH_P_IP ); -return NF_HOOK_COND (NFPROTO_IPV4 ,NF_INET_POST_ROUTING , - net, sk, skb, indev, dev, - ip_finish_output, - !(IPCB (skb)->flags &IPSKB_REROUTED )); + ret_val =NF_HOOK_COND (NFPROTO_IPV4 ,NF_INET_POST_ROUTING , + net, sk, skb, indev, dev, + ip_finish_output, + !(IPCB (skb)->flags &IPSKB_REROUTED )); +rcu_read_unlock (); +return ret_val; }EXPORT_SYMBOL (ip_output);
Greg Kroah-Hartman
maintainerPATCH 18/72 tls: Use __sk_dst_get() and dst_dev_rcu() in get_netdev_for_sock().
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit c65f27b9c3be2269918e1cbad6d8884741f835c5 ]
get_netdev_for_sock() is called during setsockopt(), so not under RCU.
Using sk_dst_get(sk)->dev could trigger UAF.
Let's use __sk_dst_get() and dst_dev_rcu().
Note that the only ->ndo_sk_get_lower_dev() user is bond_sk_get_lower_dev(), which uses RCU.
--- net/tls/tls_device.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
net/tls/tls_device.c +10 -8
@@ -125,17 +125,19 @@ static void tls_device_queue_ctx_destruc/* We assume that the socket is already connected */ static struct net_device *get_netdev_for_sock (struct sock *sk) { -struct dst_entry *dst =sk_dst_get (sk); -struct net_device *netdev =NULL ; +struct net_device *dev, *lowest_dev =NULL ; +struct dst_entry *dst; -if (likely (dst)) { - netdev =netdev_sk_get_lowest_dev (dst->dev, sk); -dev_hold (netdev); +rcu_read_lock (); + dst =__sk_dst_get (sk); + dev = dst ?dst_dev_rcu (dst) :NULL ; +if (likely (dev)) { + lowest_dev =netdev_sk_get_lowest_dev (dev, sk); +dev_hold (lowest_dev); } +rcu_read_unlock (); -dst_release (dst); - -return netdev; +return lowest_dev; }static void destroy_record (struct tls_record_info *record)
Greg Kroah-Hartman
maintainerPATCH 19/72 csky: fix csky_cmpxchg_fixup not working
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Li <[email protected]>
[ Upstream commit 809ef03d6d21d5fea016bbf6babeec462e37e68c ]
In the csky_cmpxchg_fixup function, it is incorrect to use the global variable csky_cmpxchg_stw to determine the address where the exception occurred.The global variable csky_cmpxchg_stw stores the opcode at the time of the exception, while &csky_cmpxchg_stw shows the address where the exception occurred.
--- arch/csky/mm/fault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/csky/mm/fault.c +2 -2
@@ -45,8 +45,8 @@ static inline void csky_cmpxchg_fixup(struct pt_regs *regs)if (trap_no (regs) !=VEC_TLBMODIFIED )return ; -if (instruction_pointer (regs) == csky_cmpxchg_stw) -instruction_pointer_set (regs, csky_cmpxchg_ldw); +if (instruction_pointer (regs) == (unsigned long )&csky_cmpxchg_stw) +instruction_pointer_set (regs, (unsigned long )&csky_cmpxchg_ldw); return; }#endif
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 20/72 ARM: 9461/1: Disable HIGHPTE on PREEMPT_RT kernels
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit fedadc4137234c3d00c4785eeed3e747fe9036ae ]
gup_pgd_range() is invoked with disabled interrupts and invokes __kmap_local_page_prot() via pte_offset_map(), gup_p4d_range(). With HIGHPTE enabled, __kmap_local_page_prot() invokes kmap_high_get() which uses a spinlock_t via lock_kmap_any(). This leads to an sleeping-while-atomic error on PREEMPT_RT because spinlock_t becomes a sleeping lock and must not be acquired in atomic context.
The loop in map_new_virtual() uses wait_queue_head_t for wake up which also is using a spinlock_t.
Since HIGHPTE is rarely needed at all, turn it off for PREEMPT_RT to allow the use of get_user_pages_fast().
[arnd: rework patch to turn off HIGHPTE instead of HAVE_PAST_GUP]
--- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
@@ -1318,7 +1318,7 @@ config HIGHMEM config HIGHPTE bool "Allocate 2nd-level pagetables from highmem" if EXPERT - depends on HIGHMEM + depends on HIGHMEM && !PREEMPT_RT default y help The VM uses one page of physical memory for each page table.
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 21/72 alpha: dont reference obsolete termio struct for TC* constants
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sam James <[email protected]>
[ Upstream commit 9aeed9041929812a10a6d693af050846942a1d16 ]
Similar in nature to ab107276607af90b13a5994997e19b7b9731e251. glibc-2.42 drops the legacy termio struct, but the ioctls.h header still defines some TC* constants in terms of termio (via sizeof). Hardcode the values instead.
This fixes building Python for example, which falls over like:
./Modules/termios.c:1119:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
--- arch/alpha/include/uapi/asm/ioctls.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/alpha/include/uapi/asm/ioctls.h +4 -4
@@ -23,10 +23,10 @@#define TCSETSW _IOW('t', 21, struct termios)#define TCSETSF _IOW('t', 22, struct termios) -#define TCGETA _IOR('t', 23, struct termio) -#define TCSETA _IOW('t', 24, struct termio) -#define TCSETAW _IOW('t', 25, struct termio) -#define TCSETAF _IOW('t', 28, struct termio) +#define TCGETA 0x40127417 +#define TCSETA 0x80127418 +#define TCSETAW 0x80127419 +#define TCSETAF 0x8012741c#define TCSBRK _IO('t', 29)#define TCXONC _IO('t', 30)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 22/72 NFSv4: ensure the open stateid seqid doesnt go backwards
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Scott Mayhew <[email protected]>
[ Upstream commit 2e47c3cc64b44b0b06cd68c2801db92ff143f2b2 ]
We have observed an NFSv4 client receiving a LOCK reply with a status of NFS4ERR_OLD_STATEID and subsequently retrying the LOCK request with an earlier seqid value in the stateid. As this was for a new lockowner, that would imply that nfs_set_open_stateid_locked() had updated the open stateid seqid with an earlier value.
Looking at nfs_set_open_stateid_locked(), if the incoming seqid is out of sequence, the task will sleep on the state->waitq for up to 5 seconds. If the task waits for the full 5 seconds, then after finishing the wait it'll update the open stateid seqid with whatever value the incoming seqid has. If there are multiple waiters in this scenario, then the last one to perform said update may not be the one with the highest seqid.
Add a check to ensure that the seqid can only be incremented, and add a tracepoint to indicate when old seqids are skipped.
--- fs/nfs/nfs4proc.c | 13 +++++++++++-- fs/nfs/nfs4trace.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +11 -2
@@ -1700,8 +1700,17 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,if (nfs_stateid_is_sequential (state, stateid))break ; -if (status) -break ; +if (status) { +if (nfs4_stateid_match_other (stateid, &state->open_stateid) && + !nfs4_stateid_is_newer (stateid, &state->open_stateid)) { +trace_nfs4_open_stateid_update_skip (state->inode, + stateid, status); +return ; + }else { +break ; + } + } +/* Rely on seqids for serialisation with NFSv4.0 */ if (!nfs4_has_session (NFS_SERVER (state->inode)->nfs_client))break ;
fs/nfs/nfs4trace.h +1 -0
@@ -1248,6 +1248,7 @@ DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr);DEFINE_NFS4_INODE_STATEID_EVENT (nfs4_delegreturn);DEFINE_NFS4_INODE_STATEID_EVENT (nfs4_open_stateid_update);DEFINE_NFS4_INODE_STATEID_EVENT (nfs4_open_stateid_update_wait); +DEFINE_NFS4_INODE_STATEID_EVENT (nfs4_open_stateid_update_skip);DEFINE_NFS4_INODE_STATEID_EVENT (nfs4_close_stateid_update_wait); DECLARE_EVENT_CLASS(nfs4_getattr_event,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 23/72 NFS: Fix up the automount fs_context to use the correct cred
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit a2a8fc27dd668e7562b5326b5ed2f1604cb1e2e9 ]
When automounting, the fs_context should be fixed up to use the cred from the parent filesystem, since the operation is just extending the namespace. Authorisation to enter that namespace will already have been provided by the preceding lookup.
--- fs/nfs/namespace.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/nfs/namespace.c +5 -0
@@ -170,6 +170,11 @@ struct vfsmount *nfs_d_automount(struct path *path)if (!ctx->clone_data.fattr) goto out_fc; +if (fc->cred != server->cred) { +put_cred (fc->cred); + fc->cred =get_cred (server->cred); + } +if (fc->net_ns != client->cl_net) {put_net (fc->net_ns); fc->net_ns =get_net (client->cl_net);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 24/72 smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: ChenXiaoSong <[email protected]>
[ Upstream commit 9f99caa8950a76f560a90074e3a4b93cfa8b3d84 ]
This was reported by the KUnit tests in the later patches.
See MS-ERREF 2.3.1 STATUS_UNABLE_TO_FREE_VM. Keep it consistent with the value in the documentation.
--- fs/smb/client/nterr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/nterr.h +1 -1
@@ -70,7 +70,7 @@ extern const struct nt_err_code_struct nt_errs[];#define NT_STATUS_NO_MEMORY 0xC0000000 | 0x0017#define NT_STATUS_CONFLICTING_ADDRESSES 0xC0000000 | 0x0018#define NT_STATUS_NOT_MAPPED_VIEW 0xC0000000 | 0x0019 -#define NT_STATUS_UNABLE_TO_FREE_VM 0x80000000 | 0x001a +#define NT_STATUS_UNABLE_TO_FREE_VM 0xC0000000 | 0x001a#define NT_STATUS_UNABLE_TO_DELETE_SECTION 0xC0000000 | 0x001b#define NT_STATUS_INVALID_SYSTEM_SERVICE 0xC0000000 | 0x001c#define NT_STATUS_ILLEGAL_INSTRUCTION 0xC0000000 | 0x001d
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 25/72 smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: ChenXiaoSong <[email protected]>
[ Upstream commit b2b50fca34da5ec231008edba798ddf92986bd7f ]
This was reported by the KUnit tests in the later patches.
See MS-ERREF 2.3.1 STATUS_DEVICE_DOOR_OPEN. Keep it consistent with the value in the documentation.
--- fs/smb/client/nterr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/nterr.h +1 -1
@@ -44,7 +44,7 @@ extern const struct nt_err_code_struct nt_errs[];#define NT_STATUS_NO_DATA_DETECTED 0x8000001c#define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d#define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288 -#define NT_STATUS_DEVICE_DOOR_OPEN 0x80000288 +#define NT_STATUS_DEVICE_DOOR_OPEN 0x80000289#define NT_STATUS_UNSUCCESSFUL 0xC0000000 | 0x0001#define NT_STATUS_NOT_IMPLEMENTED 0xC0000000 | 0x0002#define NT_STATUS_INVALID_INFO_CLASS 0xC0000000 | 0x0003
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 26/72 smb/client: fix NT_STATUS_NO_DATA_DETECTED value
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: ChenXiaoSong <[email protected]>
[ Upstream commit a1237c203f1757480dc2f3b930608ee00072d3cc ]
This was reported by the KUnit tests in the later patches.
See MS-ERREF 2.3.1 STATUS_NO_DATA_DETECTED. Keep it consistent with the value in the documentation.
--- fs/smb/client/nterr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/nterr.h +1 -1
@@ -41,7 +41,7 @@ extern const struct nt_err_code_struct nt_errs[];#define NT_STATUS_MEDIA_CHANGED 0x8000001c#define NT_STATUS_END_OF_MEDIA 0x8000001e#define NT_STATUS_MEDIA_CHECK 0x80000020 -#define NT_STATUS_NO_DATA_DETECTED 0x8000001c +#define NT_STATUS_NO_DATA_DETECTED 0x80000022#define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d#define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288#define NT_STATUS_DEVICE_DOOR_OPEN 0x80000289
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 27/72 scsi: ipr: Enable/disable IRQD_NO_BALANCING during reset
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wen Xiong <[email protected]>
[ Upstream commit 6ac3484fb13b2fc7f31cfc7f56093e7d0ce646a5 ]
A dynamic remove/add storage adapter test hits EEH on PowerPC:
EEH: [c00000000004f75c] __eeh_send_failure_event+0x7c/0x160
EEH: [c000000000048444] eeh_dev_check_failure.part.0+0x254/0x650
EEH: [c008000001650678] eeh_readl+0x60/0x90 [ipr]
EEH: [c00800000166746c] ipr_cancel_op+0x2b8/0x524 [ipr]
EEH: [c008000001656524] ipr_eh_abort+0x6c/0x130 [ipr]
EEH: [c000000000ab0d20] scmd_eh_abort_handler+0x140/0x440
EEH: [c00000000017e558] process_one_work+0x298/0x590
EEH: [c00000000017eef8] worker_thread+0xa8/0x620
EEH: [c00000000018be34] kthread+0x124/0x130
EEH: [c00000000000cd64] ret_from_kernel_thread+0x5c/0x64
A PCIe bus trace reveals that a vector of MSI-X is cleared to 0 by irqbalance daemon. If we disable irqbalance daemon, we won't see the issue.
With debug enabled in ipr driver:
[ 44.103071] ipr: Entering __ipr_remove [ 44.103083] ipr: Entering ipr_initiate_ioa_bringdown [ 44.103091] ipr: Entering ipr_reset_shutdown_ioa [ 44.103099] ipr: Leaving ipr_reset_shutdown_ioa [ 44.103105] ipr: Leaving ipr_initiate_ioa_bringdown [ 44.149918] ipr: Entering ipr_reset_ucode_download [ 44.149935] ipr: Entering ipr_reset_alert [ 44.150032] ipr: Entering ipr_reset_start_timer [ 44.150038] ipr: Leaving ipr_reset_alert [ 44.244343] scsi 1:2:3:0: alua: Detached [ 44.254300] ipr: Entering ipr_reset_start_bist [ 44.254320] ipr: Entering ipr_reset_start_timer [ 44.254325] ipr: Leaving ipr_reset_start_bist [ 44.364329] scsi 1:2:4:0: alua: Detached [ 45.134341] scsi 1:2:5:0: alua: Detached [ 45.860949] ipr: Entering ipr_reset_shutdown_ioa [ 45.860962] ipr: Leaving ipr_reset_shutdown_ioa [ 45.860966] ipr: Entering ipr_reset_alert [ 45.861028] ipr: Entering ipr_reset_start_timer [ 45.861035] ipr: Leaving ipr_reset_alert [ 45.964302] ipr: Entering ipr_reset_start_bist [ 45.964309] ipr: Entering ipr_reset_start_timer [ 45.964313] ipr: Leaving ipr_reset_start_bist [ 46.264301] ipr: Entering ipr_reset_bist_done [ 46.264309] ipr: Leaving ipr_reset_bist_done
During adapter reset, ipr device driver blocks config space access but can't block MMIO access for MSI-X entries. There is very small window:
irqbalance daemon kicks in during adapter reset before ipr driver calls pci_restore_state(pdev) to restore MSI-X table.
irqbalance daemon reads back all 0 for that MSI-X vector in __pci_read_msi_msg().
irqbalance daemon:
msi_domain_set_affinity()
->irq_chip_set_affinity_patent()
->xive_irq_set_affinity()
->irq_chip_compose_msi_msg()
->pseries_msi_compose_msg()
->__pci_read_msi_msg(): read all 0 since didn't call pci_restore_state
->irq_chip_write_msi_msg()
-> pci_write_msg_msi(): write 0 to the msix vector entryWhen ipr driver calls pci_restore_state(pdev) in ipr_reset_restore_cfg_space(), the MSI-X vector entry has been cleared by irqbalance daemon in pci_write_msg_msix().
pci_restore_state()
->__pci_restore_msix_state()
Below is the MSI-X table for ipr adapter after irqbalance daemon kicked in during adapter reset:
Dump MSIx table: index=0 address_lo=c800 address_hi=10000000 msg_data=0 Dump MSIx table: index=1 address_lo=c810 address_hi=10000000 msg_data=0 Dump MSIx table: index=2 address_lo=c820 address_hi=10000000 msg_data=0 Dump MSIx table: index=3 address_lo=c830 address_hi=10000000 msg_data=0 Dump MSIx table: index=4 address_lo=c840 address_hi=10000000 msg_data=0 Dump MSIx table: index=5 address_lo=c850 address_hi=10000000 msg_data=0 Dump MSIx table: index=6 address_lo=c860 address_hi=10000000 msg_data=0 Dump MSIx table: index=7 address_lo=c870 address_hi=10000000 msg_data=0 Dump MSIx table: index=8 address_lo=0 address_hi=0 msg_data=0 ---------> Hit EEH since msix vector of index=8 are 0
Dump MSIx table: index=9 address_lo=c890 address_hi=10000000 msg_data=0 Dump MSIx table: index=10 address_lo=c8a0 address_hi=10000000 msg_data=0 Dump MSIx table: index=11 address_lo=c8b0 address_hi=10000000 msg_data=0 Dump MSIx table: index=12 address_lo=c8c0 address_hi=10000000 msg_data=0 Dump MSIx table: index=13 address_lo=c8d0 address_hi=10000000 msg_data=0 Dump MSIx table: index=14 address_lo=c8e0 address_hi=10000000 msg_data=0 Dump MSIx table: index=15 address_lo=c8f0 address_hi=10000000 msg_data=0
[ 46.264312] ipr: Entering ipr_reset_restore_cfg_space [ 46.267439] ipr: Entering ipr_fail_all_ops [ 46.267447] ipr: Leaving ipr_fail_all_ops [ 46.267451] ipr: Leaving ipr_reset_restore_cfg_space [ 46.267454] ipr: Entering ipr_ioa_bringdown_done [ 46.267458] ipr: Leaving ipr_ioa_bringdown_done [ 46.267467] ipr: Entering ipr_worker_thread [ 46.267470] ipr: Leaving ipr_worker_thread
IRQ balancing is not required during adapter reset.
Enable "IRQ_NO_BALANCING" flag before starting adapter reset and disable it after calling pci_restore_state(). The irqbalance daemon is disabled for this short period of time (~2s).
--- drivers/scsi/ipr.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
drivers/scsi/ipr.c +27 -1
@@ -62,8 +62,8 @@#include <linux/hdreg.h> #include <linux/reboot.h> #include <linux/stringify.h> +#include <linux/irq.h> #include <asm/io.h> -#include <asm/irq.h> #include <asm/processor.h> #include <scsi/scsi.h> #include <scsi/scsi_host.h>
@@ -8669,6 +8669,30 @@ static int ipr_dump_mailbox_wait(struct ipr_cmnd *ipr_cmd)return IPR_RC_JOB_RETURN ; } +/** +* ipr_set_affinity_nobalance +* @ioa_cfg: ipr_ioa_cfg struct for an ipr device +* @flag: bool +* true: ensable "IRQ_NO_BALANCING" bit for msix interrupt +* false: disable "IRQ_NO_BALANCING" bit for msix interrupt +* Description: This function will be called to disable/enable +* "IRQ_NO_BALANCING" to avoid irqbalance daemon +* kicking in during adapter reset. +**/ +static void ipr_set_affinity_nobalance (struct ipr_ioa_cfg *ioa_cfg,bool flag) +{ +int irq, i; + +for (i =0 ; i < ioa_cfg->nvectors; i++) { + irq =pci_irq_vector (ioa_cfg->pdev, i); + +if (flag) +irq_set_status_flags (irq,IRQ_NO_BALANCING ); +else +irq_clear_status_flags (irq,IRQ_NO_BALANCING ); + } +} +/** * ipr_reset_restore_cfg_space - Restore PCI config space. * @ipr_cmd: ipr command struct
@@ -8693,6 +8717,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)return IPR_RC_JOB_CONTINUE ; } +ipr_set_affinity_nobalance (ioa_cfg, false);ipr_fail_all_ops (ioa_cfg);if (ioa_cfg->sis64) {
@@ -8772,6 +8797,7 @@ static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd) rc =pci_write_config_byte (ioa_cfg->pdev,PCI_BIST ,PCI_BIST_START );if (rc ==PCIBIOS_SUCCESSFUL ) { +ipr_set_affinity_nobalance (ioa_cfg, true); ipr_cmd->job_step = ipr_reset_bist_done;ipr_reset_start_timer (ipr_cmd,IPR_WAIT_FOR_BIST_TIMEOUT ); rc =IPR_RC_JOB_RETURN ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 28/72 scsi: ufs: core: Fix EH failure after W-LUN resume error
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Kao <[email protected]>
[ Upstream commit b4bb6daf4ac4d4560044ecdd81e93aa2f6acbb06 ]
When a W-LUN resume fails, its parent devices in the SCSI hierarchy, including the scsi_target, may be runtime suspended. Subsequently, the error handler in ufshcd_recover_pm_error() fails to set the W-LUN device back to active because the parent target is not active. This results in the following errors:
google-ufshcd 3c2d0000.ufs: ufshcd_err_handler started; HBA state eh_fatal; ...
ufs_device_wlun 0:0:0:49488: START_STOP failed for power mode: 1, result 40000
ufs_device_wlun 0:0:0:49488: ufshcd_wl_runtime_resume failed: -5
...
ufs_device_wlun 0:0:0:49488: runtime PM trying to activate child device 0:0:0:49488 but parent (target0:0:0) is not active
Address this by:
1. Ensuring the W-LUN's parent scsi_target is runtime resumed before attempting to set the W-LUN to active within ufshcd_recover_pm_error().
2. Explicitly checking for power.runtime_error on the HBA and W-LUN devices before calling pm_runtime_set_active() to clear the error state.
3. Adding pm_runtime_get_sync(hba->dev) in ufshcd_err_handling_prepare() to ensure the HBA itself is active during error recovery, even if a child device resume failed.
These changes ensure the device power states are managed correctly during error recovery.
--- drivers/ufs/core/ufshcd.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-)
drivers/ufs/core/ufshcd.c +28 -8
@@ -6154,6 +6154,11 @@ static void ufshcd_clk_scaling_suspend(struct ufs_hba *hba, bool suspend)static void ufshcd_err_handling_prepare (struct ufs_hba *hba) { +/* +* A WLUN resume failure could potentially lead to the HBA being +* runtime suspended, so take an extra reference on hba->dev. +*/ +pm_runtime_get_sync (hba->dev);ufshcd_rpm_get_sync (hba);if (pm_runtime_status_suspended (&hba->ufs_device_wlun->sdev_gendev) || hba->is_sys_suspended) {
@@ -6194,6 +6199,7 @@ static void ufshcd_err_handling_unprepare(struct ufs_hba *hba)if (ufshcd_is_clkscaling_supported (hba))ufshcd_clk_scaling_suspend (hba, false);ufshcd_rpm_put (hba); +pm_runtime_put (hba->dev); }static inline bool ufshcd_err_handling_should_stop (struct ufs_hba *hba)
@@ -6208,28 +6214,42 @@ static inline bool ufshcd_err_handling_should_stop(struct ufs_hba *hba)#ifdef CONFIG_PM static void ufshcd_recover_pm_error (struct ufs_hba *hba) { +struct scsi_target *starget = hba->ufs_device_wlun->sdev_target;struct Scsi_Host *shost = hba->host;struct scsi_device *sdev;struct request_queue *q; -int ret; +bool resume_sdev_queues = false; hba->is_sys_suspended = false; +/* -* Set RPM status of wlun device to RPM_ACTIVE, -* this also clears its runtime error. +* Ensure the parent's error status is cleared before proceeding +* to the child, as the parent must be active to activate the child. */ - ret =pm_runtime_set_active (&hba->ufs_device_wlun->sdev_gendev); +if (hba->dev->power.runtime_error) { +/* hba->dev has no functional parent thus simplily set RPM_ACTIVE */ +pm_runtime_set_active (hba->dev); + resume_sdev_queues = true; + } + +if (hba->ufs_device_wlun->sdev_gendev.power.runtime_error) { +/* +* starget, parent of wlun, might be suspended if wlun resume failed. +* Make sure parent is resumed before set child (wlun) active. +*/ +pm_runtime_get_sync (&starget->dev); +pm_runtime_set_active (&hba->ufs_device_wlun->sdev_gendev); +pm_runtime_put_sync (&starget->dev); + resume_sdev_queues = true; + } -/* hba device might have a runtime error otherwise */ -if (ret) - ret =pm_runtime_set_active (hba->dev);/* * If wlun device had runtime error, we also need to resume those * consumer scsi devices in case any of them has failed to be * resumed due to supplier runtime resume failure. This is to unblock * blk_queue_enter in case there are bios waiting inside it. */ -if (!ret) { +if (resume_sdev_queues) {shost_for_each_device (sdev, shost) { q = sdev->request_queue; if (q->dev && (q->rpm_status == RPM_SUSPENDED ||
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 29/72 scsi: Revert "scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed"
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xingui Yang <[email protected]>
[ Upstream commit 278712d20bc8ec29d1ad6ef9bdae9000ef2c220c ]
This reverts commit ab2068a6fb84751836a84c26ca72b3beb349619d.
When probing the exp-attached sata device, libsas/libata will issue a hard reset in sas_probe_sata() -> ata_sas_async_probe(), then a broadcast event will be received after the disk probe fails, and this commit causes the probe will be re-executed on the disk, and a faulty disk may get into an indefinite loop of probe.
Therefore, revert this commit, although it can fix some temporary issues with disk probe failure.
--- drivers/scsi/libsas/sas_internal.h | 14 -------------- 1 file changed, 14 deletions(-)
drivers/scsi/libsas/sas_internal.h +0 -14
@@ -119,20 +119,6 @@ static inline void sas_fail_probe(struct domain_device *dev, const char *func, i func, dev->parent ?"exp-attached" :"direct-attached" , SAS_ADDR(dev->sas_addr), err); - -/* -* If the device probe failed, the expander phy attached address -* needs to be reset so that the phy will not be treated as flutter -* in the next revalidation -*/ -if (dev->parent && !dev_is_expander (dev->dev_type)) { -struct sas_phy *phy = dev->phy; -struct domain_device *parent = dev->parent; -struct ex_phy *ex_phy = &parent->ex_dev.ex_phy[phy->number]; - -memset (ex_phy->attached_sas_addr,0 ,SAS_ADDR_SIZE ); - } -sas_unregister_dev (dev->port, dev); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 30/72 arm64: dts: add off-on-delay-us for usdhc2 regulator
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haibo Chen <[email protected]>
[ Upstream commit ca643894a37a25713029b36cfe7d1bae515cac08 ]
For SD card, according to the spec requirement, for sd card power reset operation, it need sd card supply voltage to be lower than 0.5v and keep over 1ms, otherwise, next time power back the sd card supply voltage to 3.3v, sd card can't support SD3.0 mode again.
To match such requirement on imx8qm-mek board, add 4.8ms delay between sd power off and power on.
--- arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx8qm-mek.dts +1 -0
@@ -34,6 +34,7 @@ reg_usdhc2_vmmc: usdhc2-vmmc { regulator-max-microvolt = <3000000>; gpio = <&lsio_gpio4 7 GPIO_ACTIVE_HIGH>; enable-active-high; + off-on-delay-us = <4800>; }; };
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 31/72 ARM: dts: imx6q-ba16: fix RTC interrupt level
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Ray <[email protected]>
[ Upstream commit e6a4eedd49ce27c16a80506c66a04707e0ee0116 ]
RTC interrupt level should be set to "LOW". This was revealed by the introduction of commit:
f181987ef477 ("rtc: m41t80: use IRQ flags obtained from fwnode")
which changed the way IRQ type is obtained.
--- arch/arm/boot/dts/imx6q-ba16.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6q-ba16.dtsi +1 -1
@@ -335,7 +335,7 @@ rtc@32 { pinctrl-0 = <&pinctrl_rtc>; reg = <0x32>; interrupt-parent = <&gpio4>; - interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <10 IRQ_TYPE_LEVEL_LOW>; }; };
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 32/72 arm64: dts: imx8mp: Fix LAN8740Ai PHY reference clock on DH electronics i.MX8M Plus DHCOM
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit c63749a7ddc59ac6ec0b05abfa0a21af9f2c1d38 ]
Add missing 'clocks' property to LAN8740Ai PHY node, to allow the PHY driver to manage LAN8740Ai CLKIN reference clock supply. This fixes sporadic link bouncing caused by interruptions on the PHY reference clock, by letting the PHY driver manage the reference clock and assure there are no interruptions.
This follows the matching PHY driver recommendation described in commit bedd8d78aba3 ("net: phy: smsc: LAN8710/20: add phy refclk in support")
--- arch/arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi +1 -0
@@ -97,6 +97,7 @@ mdio { ethphy0f: ethernet-phy@1 { /* SMSC LAN8740Ai */ compatible = "ethernet-phy-id0007.c110", "ethernet-phy-ieee802.3-c22"; + clocks = <&clk IMX8MP_CLK_ENET_QOS>; interrupt-parent = <&gpio3>; interrupts = <19 IRQ_TYPE_LEVEL_LOW>; pinctrl-0 = <&pinctrl_ethphy0>;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 33/72 netfilter: nft_synproxy: avoid possible data-race on update operation
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fernando Fernandez Mancera <[email protected]>
[ Upstream commit 36a3200575642846a96436d503d46544533bb943 ]
During nft_synproxy eval we are reading nf_synproxy_info struct which can be modified on update operation concurrently. As nf_synproxy_info struct fits in 32 bits, use READ_ONCE/WRITE_ONCE annotations.
--- net/netfilter/nft_synproxy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/netfilter/nft_synproxy.c +3 -3
@@ -48,7 +48,7 @@ static void nft_synproxy_eval_v4(const struct nft_synproxy *priv,struct tcphdr *_tcph, struct synproxy_options *opts) { - struct nf_synproxy_info info = priv->info; + struct nf_synproxy_info info = READ_ONCE(priv->info);struct net *net =nft_net (pkt);struct synproxy_net *snet =synproxy_pernet (net);struct sk_buff *skb = pkt->skb;
@@ -79,7 +79,7 @@ static void nft_synproxy_eval_v6(const struct nft_synproxy *priv,struct tcphdr *_tcph, struct synproxy_options *opts) { - struct nf_synproxy_info info = priv->info; + struct nf_synproxy_info info = READ_ONCE(priv->info);struct net *net =nft_net (pkt);struct synproxy_net *snet =synproxy_pernet (net);struct sk_buff *skb = pkt->skb;
@@ -340,7 +340,7 @@ static void nft_synproxy_obj_update(struct nft_object *obj,struct nft_synproxy *newpriv =nft_obj_data (newobj);struct nft_synproxy *priv =nft_obj_data (obj); - priv->info = newpriv->info; +WRITE_ONCE (priv->info, newpriv->info); }static struct nft_object_type nft_synproxy_obj_type;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 34/72 netfilter: nf_tables: fix memory leak in nf_tables_newrule()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zilin Guan <[email protected]>
[ Upstream commit d077e8119ddbb4fca67540f1a52453631a47f221 ]
In nf_tables_newrule(), if nft_use_inc() fails, the function jumps to the err_release_rule label without freeing the allocated flow, leading to a memory leak.
Fix this by adding a new label err_destroy_flow and jumping to it when nft_use_inc() fails. This ensures that the flow is properly released in this error case.
--- net/netfilter/nf_tables_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +2 -1
@@ -3811,7 +3811,7 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info,if (!nft_use_inc (&chain->use)) { err = -EMFILE ; - goto err_release_rule; + goto err_destroy_flow; }if (info->nlh->nlmsg_flags &NLM_F_REPLACE ) {
@@ -3861,6 +3861,7 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info, err_destroy_flow_rule:nft_use_dec_restore (&chain->use); +err_destroy_flow:if (flow)nft_flow_rule_destroy (flow); err_release_rule:
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 35/72 netfilter: nf_conncount: update last_gc only when GC has been performed
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fernando Fernandez Mancera <[email protected]>
[ Upstream commit 7811ba452402d58628e68faedf38745b3d485e3c ]
Currently last_gc is being updated everytime a new connection is tracked, that means that it is updated even if a GC wasn't performed. With a sufficiently high packet rate, it is possible to always bypass the GC, causing the list to grow infinitely.
Update the last_gc value only when a GC has been actually performed.
--- net/netfilter/nf_conncount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conncount.c +1 -1
@@ -229,6 +229,7 @@ static int __nf_conncount_add(struct net *net,nf_ct_put (found_ct); } + list->last_gc = (u32 )jiffies; add_new_node:if (WARN_ON_ONCE (list->count >INT_MAX )) {
@@ -248,7 +249,6 @@ static int __nf_conncount_add(struct net *net, conn->jiffies32 = (u32 )jiffies;list_add_tail (&conn->node, &list->head); list->count++; - list->last_gc = (u32 )jiffies; out_put:if (refcounted)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 36/72 net: marvell: prestera: fix NULL dereference on devlink_alloc() failure
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alok Tiwari <[email protected]>
[ Upstream commit a428e0da1248c353557970848994f35fd3f005e2 ]
devlink_alloc() may return NULL on allocation failure, but prestera_devlink_alloc() unconditionally calls devlink_priv() on the returned pointer.
This leads to a NULL pointer dereference if devlink allocation fails. Add a check for a NULL devlink pointer and return NULL early to avoid the crash.
--- drivers/net/ethernet/marvell/prestera/prestera_devlink.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/prestera/prestera_devlink.c +2 -0
@@ -392,6 +392,8 @@ struct prestera_switch *prestera_devlink_alloc(struct prestera_device *dev) dl =devlink_alloc (&prestera_dl_ops,sizeof (struct prestera_switch ), dev->dev); +if (!dl) +return NULL ;return devlink_priv (dl); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 37/72 bridge: fix C-VLAN preservation in 802.1ad vlan_tunnel egress
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Knecht <[email protected]>
[ Upstream commit 3128df6be147768fe536986fbb85db1d37806a9f ]
When using an 802.1ad bridge with vlan_tunnel, the C-VLAN tag is incorrectly stripped from frames during egress processing.
br_handle_egress_vlan_tunnel() uses skb_vlan_pop() to remove the S-VLAN from hwaccel before VXLAN encapsulation. However, skb_vlan_pop() also moves any "next" VLAN from the payload into hwaccel:
/* move next vlan tag to hw accel tag */
__skb_vlan_pop(skb, &vlan_tci);
__vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci);For QinQ frames where the C-VLAN sits in the payload, this moves it to hwaccel where it gets lost during VXLAN encapsulation.
Fix by calling __vlan_hwaccel_clear_tag() directly, which clears only the hwaccel S-VLAN and leaves the payload untouched.
This path is only taken when vlan_tunnel is enabled and tunnel_info is configured, so 802.1Q bridges are unaffected.
Tested with 802.1ad bridge + VXLAN vlan_tunnel, verified C-VLAN preserved in VXLAN payload via tcpdump.
--- net/bridge/br_vlan_tunnel.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/bridge/br_vlan_tunnel.c +7 -4
@@ -187,7 +187,6 @@ int br_handle_egress_vlan_tunnel(struct sk_buff *skb, {struct metadata_dst *tunnel_dst;__be64 tunnel_id; -int err;if (!vlan)return 0 ;
@@ -197,9 +196,13 @@ int br_handle_egress_vlan_tunnel(struct sk_buff *skb,return 0 ;skb_dst_drop (skb); - err =skb_vlan_pop (skb); -if (err) -return err; +/* For 802.1ad (QinQ), skb_vlan_pop() incorrectly moves the C-VLAN +* from payload to hwaccel after clearing S-VLAN. We only need to +* clear the hwaccel S-VLAN; the C-VLAN must stay in payload for +* correct VXLAN encapsulation. This is also correct for 802.1Q +* where no C-VLAN exists in payload. +*/ +__vlan_hwaccel_clear_tag (skb); tunnel_dst =rcu_dereference (vlan->tinfo.tunnel_dst);if (tunnel_dst &&dst_hold_safe (&tunnel_dst->dst))
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 38/72 net: mscc: ocelot: Fix crash when adding interface under a lag
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerry Wu <[email protected]>
[ Upstream commit 34f3ff52cb9fa7dbf04f5c734fcc4cb6ed5d1a95 ]
Commit 15faa1f67ab4 ("lan966x: Fix crash when adding interface under a lag") fixed a similar issue in the lan966x driver caused by a NULL pointer dereference. The ocelot_set_aggr_pgids() function in the ocelot driver has similar logic and is susceptible to the same crash.
This issue specifically affects the ocelot_vsc7514.c frontend, which leaves unused ports as NULL pointers. The felix_vsc9959.c frontend is unaffected as it uses the DSA framework which registers all ports.
Fix this by checking if the port pointer is valid before accessing it.
--- drivers/net/ethernet/mscc/ocelot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/mscc/ocelot.c +4 -2
@@ -2202,14 +2202,16 @@ static void ocelot_set_aggr_pgids(struct ocelot *ocelot)/* Now, set PGIDs for each active LAG */ for (lag =0 ; lag < ocelot->num_phys_ports; lag++) { -struct net_device *bond = ocelot->ports[lag]->bond; +struct ocelot_port *ocelot_port = ocelot->ports[lag];int num_active_ports =0 ; +struct net_device *bond;unsigned long bond_mask;u8 aggr_idx[16 ]; -if (!bond || (visited &BIT (lag))) +if (!ocelot_port || !ocelot_port->bond || (visited &BIT (lag)))continue ; + bond = ocelot_port->bond; bond_mask =ocelot_get_bond_mask (ocelot, bond);for_each_set_bit (port, &bond_mask, ocelot->num_phys_ports) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 39/72 inet: ping: Fix icmp out counting
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: yuan.gao <[email protected]>
[ Upstream commit 4c0856c225b39b1def6c9a6bc56faca79550da13 ]
When the ping program uses an IPPROTO_ICMP socket to send ICMP_ECHO messages, ICMP_MIB_OUTMSGS is counted twice.
ping_v4_sendmsg
ping_v4_push_pending_frames
ip_push_pending_frames
ip_finish_skb
__ip_make_skb
icmp_out_count(net, icmp_type); // first count
icmp_out_count(sock_net(sk), user_icmph.type); // second count
However, when the ping program uses an IPPROTO_RAW socket, ICMP_MIB_OUTMSGS is counted correctly only once.
Therefore, the first count should be removed.
--- net/ipv4/ping.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/ipv4/ping.c +1 -3
@@ -848,10 +848,8 @@ static int ping_v4_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) out_free:if (free)kfree (ipc.opt); -if (!err) { -icmp_out_count (sock_net (sk), user_icmph.type); +if (!err)return len; - }return err; do_confirm:
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 40/72 net: sock: fix hardened usercopy panic in sock_recv_errqueue
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <[email protected]>
[ Upstream commit 2a71a1a8d0ed718b1c7a9ac61f07e5755c47ae20 ]
skbuff_fclone_cache was created without defining a usercopy region,
[1] unlike skbuff_head_cache which properly whitelists the cb[] field.
[2] This causes a usercopy BUG() when CONFIG_HARDENED_USERCOPY is enabled and the kernel attempts to copy sk_buff.cb data to userspace via sock_recv_errqueue() -> put_cmsg().
The crash occurs when: 1. TCP allocates an skb using alloc_skb_fclone()
(from skbuff_fclone_cache) [1]
2. The skb is cloned via skb_clone() using the pre-allocated fclone
[3] 3. The cloned skb is queued to sk_error_queue for timestamp reporting 4. Userspace reads the error queue via recvmsg(MSG_ERRQUEUE)
5. sock_recv_errqueue() calls put_cmsg() to copy serr->ee from skb->cb
[4] 6. __check_heap_object() fails because skbuff_fclone_cache has no usercopy whitelist [5]
When cloned skbs allocated from skbuff_fclone_cache are used in the socket error queue, accessing the sock_exterr_skb structure in skb->cb via put_cmsg() triggers a usercopy hardening violation:
[ 5.379589] usercopy: Kernel memory exposure attempt detected from SLUB object 'skbuff_fclone_cache' (offset 296, size 16)! [ 5.382796] kernel BUG at mm/usercopy.c:102! [ 5.383923] Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI [ 5.384903] CPU: 1 UID: 0 PID: 138 Comm: poc_put_cmsg Not tainted 6.12.57 #7 [ 5.384903] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 [ 5.384903] RIP: 0010:usercopy_abort+0x6c/0x80 [ 5.384903] Code: 1a 86 51 48 c7 c2 40 15 1a 86 41 52 48 c7 c7 c0 15 1a 86 48 0f 45 d6 48 c7 c6 80 15 1a 86 48 89 c1 49 0f 45 f3 e8 84 27 88 ff <0f> 0b 490 [ 5.384903] RSP: 0018:ffffc900006f77a8 EFLAGS: 00010246 [ 5.384903] RAX: 000000000000006f RBX: ffff88800f0ad2a8 RCX: 1ffffffff0f72e74 [ 5.384903] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff87b973a0 [ 5.384903] RBP: 0000000000000010 R08: 0000000000000000 R09: fffffbfff0f72e74 [ 5.384903] R10: 0000000000000003 R11: 79706f6372657375 R12: 0000000000000001 [ 5.384903] R13: ffff88800f0ad2b8 R14: ffffea00003c2b40 R15: ffffea00003c2b00 [ 5.384903] FS: 0000000011bc4380(0000) GS:ffff8880bf100000(0000) knlGS:0000000000000000 [ 5.384903] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5.384903] CR2: 000056aa3b8e5fe4 CR3: 000000000ea26004 CR4: 0000000000770ef0 [ 5.384903] PKRU: 55555554 [ 5.384903] Call Trace: [ 5.384903] <TASK> [ 5.384903] __check_heap_object+0x9a/0xd0 [ 5.384903] __check_object_size+0x46c/0x690 [ 5.384903] put_cmsg+0x129/0x5e0 [ 5.384903] sock_recv_errqueue+0x22f/0x380 [ 5.384903] tls_sw_recvmsg+0x7ed/0x1960 [ 5.384903] ? srso_alias_return_thunk+0x5/0xfbef5 [ 5.384903] ? schedule+0x6d/0x270 [ 5.384903] ? srso_alias_return_thunk+0x5/0xfbef5 [ 5.384903] ? mutex_unlock+0x81/0xd0 [ 5.384903] ? __pfx_mutex_unlock+0x10/0x10 [ 5.384903] ? __pfx_tls_sw_recvmsg+0x10/0x10 [ 5.384903] ? _raw_spin_lock_irqsave+0x8f/0xf0 [ 5.384903] ? _raw_read_unlock_irqrestore+0x20/0x40 [ 5.384903] ? srso_alias_return_thunk+0x5/0xfbef5
The crash offset 296 corresponds to skb2->cb within skbuff_fclones:
- sizeof(struct sk_buff) = 232 - offsetof(struct sk_buff, cb) = 40 - offset of skb2.cb in fclones = 232 + 40 = 272 - crash offset 296 = 272 + 24 (inside sock_exterr_skb.ee)
This patch uses a local stack variable as a bounce buffer to avoid the hardened usercopy check failure.
[1] https://elixir.bootlin.com/linux/v6.12.62/source/net/ipv4/tcp.c#L885
[2] https://elixir.bootlin.com/linux/v6.12.62/source/net/core/skbuff.c#L5104
[3] https://elixir.bootlin.com/linux/v6.12.62/source/net/core/skbuff.c#L5566
[4] https://elixir.bootlin.com/linux/v6.12.62/source/net/core/skbuff.c#L5491
[5] https://elixir.bootlin.com/linux/v6.12.62/source/mm/slub.c#L5719
--- net/core/sock.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/core/sock.c +4 -3
@@ -3614,7 +3614,7 @@ void sock_enable_timestamp(struct sock *sk, enum sock_flags flag)int sock_recv_errqueue (struct sock *sk,struct msghdr *msg,int len,int level,int type) { -struct sock_exterr_skb *serr; +struct sock_extended_err ee;struct sk_buff *skb;int copied, err;
@@ -3634,8 +3634,9 @@ int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,sock_recv_timestamp (msg, sk, skb); - serr =SKB_EXT_ERR (skb); -put_cmsg (msg, level, type,sizeof (serr->ee), &serr->ee); +/* We must use a bounce buffer for CONFIG_HARDENED_USERCOPY=y */ + ee =SKB_EXT_ERR (skb)->ee; +put_cmsg (msg, level, type,sizeof (ee), &ee); msg->msg_flags |=MSG_ERRQUEUE ; err = copied;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 41/72 netdev: preserve NETIF_F_ALL_FOR_ALL across TSO updates
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Di Zhu <[email protected]>
[ Upstream commit 02d1e1a3f9239cdb3ecf2c6d365fb959d1bf39df ]
Directly increment the TSO features incurs a side effect: it will also directly clear the flags in NETIF_F_ALL_FOR_ALL on the master device, which can cause issues such as the inability to enable the nocache copy feature on the bonding driver.
The fix is to include NETIF_F_ALL_FOR_ALL in the update mask, thereby preventing it from being cleared.
--- include/linux/netdevice.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/netdevice.h +2 -1
@@ -4951,7 +4951,8 @@ netdev_features_t netdev_increment_features(netdev_features_t all,static inline netdev_features_t netdev_add_tso_features (netdev_features_t features,netdev_features_t mask) { -return netdev_increment_features (features,NETIF_F_ALL_TSO , mask); +return netdev_increment_features (features,NETIF_F_ALL_TSO | +NETIF_F_ALL_FOR_ALL , mask); }int __netdev_update_features (struct net_device *dev);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 42/72 net/mlx5e: Dont print error message due to invalid module
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gal Pressman <[email protected]>
[ Upstream commit 144297e2a24e3e54aee1180ec21120ea38822b97 ]
Dumping module EEPROM on newer modules is supported through the netlink interface only.
Querying with old userspace ethtool (or other tools, such as 'lshw') which still uses the ioctl interface results in an error message that could flood dmesg (in addition to the expected error return value). The original message was added under the assumption that the driver should be able to handle all module types, but now that such flows are easily triggered from userspace, it doesn't serve its purpose.
Change the log level of the print in mlx5_query_module_eeprom() to debug.
--- drivers/net/ethernet/mellanox/mlx5/core/port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/port.c +2 -1
@@ -432,7 +432,8 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev,mlx5_qsfp_eeprom_params_set (&query.i2c_address, &query.page, &offset);break ;default : -mlx5_core_err (dev,"Module ID not recognized: 0x%x\n" , module_id); +mlx5_core_dbg (dev,"Module ID not recognized: 0x%x\n" , + module_id);return -EINVAL ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 43/72 net: wwan: iosm: Fix memory leak in ipc_mux_deinit()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zilin Guan <[email protected]>
[ Upstream commit 92e6e0a87f6860a4710f9494f8c704d498ae60f8 ]
Commit 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") allocated memory for pp_qlt in ipc_mux_init() but did not free it in ipc_mux_deinit(). This results in a memory leak when the driver is unloaded.
Free the allocated memory in ipc_mux_deinit() to fix the leak.
--- drivers/net/wwan/iosm/iosm_ipc_mux.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wwan/iosm/iosm_ipc_mux.c +6 -0
@@ -456,6 +456,7 @@ void ipc_mux_deinit(struct iosm_mux *ipc_mux)struct sk_buff_head *free_list;union mux_msg mux_msg;struct sk_buff *skb; +int i;if (!ipc_mux->initialized)return ;
@@ -479,5 +480,10 @@ void ipc_mux_deinit(struct iosm_mux *ipc_mux) ipc_mux->channel->dl_pipe.is_open = false; } +if (ipc_mux->protocol !=MUX_LITE ) { +for (i =0 ; i <IPC_MEM_MUX_IP_SESSION_ENTRIES ; i++) +kfree (ipc_mux->ul_adb.pp_qlt[i]); + } +kfree (ipc_mux); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 44/72 eth: bnxt: move and rename reset helpers
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <[email protected]>
[ Upstream commit fea2993aecd74d5d11ede1ebbd60e478ebfed996 ]
Move the reset helpers, subsequent patches will need some of them on the Tx path.
While at it rename bnxt_sched_reset(), on more recent chips it schedules a queue reset, instead of a fuller reset.
Stable-dep-of: ffeafa65b2b2 ("bnxt_en: Fix potential data corruption with HW GRO/LRO")
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 72 +++++++++++------------ 1 file changed, 36 insertions(+), 36 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +36 -36
@@ -293,6 +293,38 @@ static void bnxt_db_cq(struct bnxt *bp, struct bnxt_db_info *db, u32 idx)BNXT_DB_CQ (db, idx); } +static void bnxt_queue_fw_reset_work (struct bnxt *bp,unsigned long delay) +{ +if (!(test_bit (BNXT_STATE_IN_FW_RESET , &bp->state))) +return ; + +if (BNXT_PF (bp)) +queue_delayed_work (bnxt_pf_wq, &bp->fw_reset_task, delay); +else +schedule_delayed_work (&bp->fw_reset_task, delay); +} + +static void bnxt_queue_sp_work (struct bnxt *bp) +{ +if (BNXT_PF (bp)) +queue_work (bnxt_pf_wq, &bp->sp_task); +else +schedule_work (&bp->sp_task); +} + +static void bnxt_sched_reset_rxr (struct bnxt *bp,struct bnxt_rx_ring_info *rxr) +{ +if (!rxr->bnapi->in_reset) { + rxr->bnapi->in_reset = true; +if (bp->flags &BNXT_FLAG_CHIP_P5 ) +set_bit (BNXT_RESET_TASK_SP_EVENT , &bp->sp_event); +else +set_bit (BNXT_RST_RING_SP_EVENT , &bp->sp_event); +bnxt_queue_sp_work (bp); + } + rxr->rx_next_cons =0xffff ; +} +const u16 bnxt_lhint_arr[] = {TX_BD_FLAGS_LHINT_512_AND_SMALLER ,TX_BD_FLAGS_LHINT_512_TO_1023 ,
@@ -1269,38 +1301,6 @@ static int bnxt_discard_rx(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,return 0 ; } -static void bnxt_queue_fw_reset_work (struct bnxt *bp,unsigned long delay) -{ -if (!(test_bit (BNXT_STATE_IN_FW_RESET , &bp->state))) -return ; - -if (BNXT_PF (bp)) -queue_delayed_work (bnxt_pf_wq, &bp->fw_reset_task, delay); -else -schedule_delayed_work (&bp->fw_reset_task, delay); -} - -static void bnxt_queue_sp_work (struct bnxt *bp) -{ -if (BNXT_PF (bp)) -queue_work (bnxt_pf_wq, &bp->sp_task); -else -schedule_work (&bp->sp_task); -} - -static void bnxt_sched_reset (struct bnxt *bp,struct bnxt_rx_ring_info *rxr) -{ -if (!rxr->bnapi->in_reset) { - rxr->bnapi->in_reset = true; -if (bp->flags &BNXT_FLAG_CHIP_P5 ) -set_bit (BNXT_RESET_TASK_SP_EVENT , &bp->sp_event); -else -set_bit (BNXT_RST_RING_SP_EVENT , &bp->sp_event); -bnxt_queue_sp_work (bp); - } - rxr->rx_next_cons =0xffff ; -} -static u16 bnxt_alloc_agg_idx (struct bnxt_rx_ring_info *rxr,u16 agg_id) {struct bnxt_tpa_idx_map *map = rxr->rx_tpa_idx_map;
@@ -1355,7 +1355,7 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,netdev_warn (bp->dev,"TPA cons %x, expected cons %x, error code %x\n" , cons, rxr->rx_next_cons,TPA_START_ERROR_CODE (tpa_start1)); -bnxt_sched_reset (bp, rxr); +bnxt_sched_reset_rxr (bp, rxr);return ; }/* Store cfa_code in tpa_info to use in tpa_end
@@ -1895,7 +1895,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,if (rxr->rx_next_cons !=0xffff )netdev_warn (bp->dev,"RX cons %x != expected cons %x\n" , cons, rxr->rx_next_cons); -bnxt_sched_reset (bp, rxr); +bnxt_sched_reset_rxr (bp, rxr);if (rc1)return rc1; goto next_rx_no_prod_no_len;
@@ -1933,7 +1933,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, !(bp->fw_cap & BNXT_FW_CAP_RING_MONITOR)) {netdev_warn_once (bp->dev,"RX buffer error %x\n" , rx_err); -bnxt_sched_reset (bp, rxr); +bnxt_sched_reset_rxr (bp, rxr); } } goto next_rx_no_len;
@@ -2371,7 +2371,7 @@ static int bnxt_async_event_process(struct bnxt *bp, goto async_event_process_exit; } rxr = bp->bnapi[grp_idx]->rx_ring; -bnxt_sched_reset (bp, rxr); +bnxt_sched_reset_rxr (bp, rxr); goto async_event_process_exit; }case ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST : {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 45/72 bnxt_en: Fix potential data corruption with HW GRO/LRO
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srijit Bose <[email protected]>
[ Upstream commit ffeafa65b2b26df2f5b5a6118d3174f17bd12ec5 ]
Fix the max number of bits passed to find_first_zero_bit() in bnxt_alloc_agg_idx(). We were incorrectly passing the number of long words. find_first_zero_bit() may fail to find a zero bit and cause a wrong ID to be used. If the wrong ID is already in use, this can cause data corruption. Sometimes an error like this can also be seen:
bnxt_en 0000:83:00.0 enp131s0np0: TPA end agg_buf 2 != expected agg_bufs 1
Fix it by passing the correct number of bits MAX_TPA_P5. Use DECLARE_BITMAP() to more cleanly define the bitmap. Add a sanity check to warn if a bit cannot be found and reset the ring [MChan].
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 ++++++++++++--- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 4 +--- 2 files changed, 13 insertions(+), 6 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +12 -3
@@ -1306,9 +1306,11 @@ static u16 bnxt_alloc_agg_idx(struct bnxt_rx_ring_info *rxr, u16 agg_id)struct bnxt_tpa_idx_map *map = rxr->rx_tpa_idx_map;u16 idx = agg_id &MAX_TPA_P5_MASK ; -if (test_bit (idx, map->agg_idx_bmap)) - idx =find_first_zero_bit (map->agg_idx_bmap, -BNXT_AGG_IDX_BMAP_SIZE ); +if (test_bit (idx, map->agg_idx_bmap)) { + idx =find_first_zero_bit (map->agg_idx_bmap,MAX_TPA_P5 ); +if (idx >=MAX_TPA_P5 ) +return INVALID_HW_RING_ID ; + }__set_bit (idx, map->agg_idx_bmap); map->agg_id_tbl[agg_id] = idx;return idx;
@@ -1341,6 +1343,13 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,if (bp->flags &BNXT_FLAG_CHIP_P5 ) { agg_id =TPA_START_AGG_ID_P5 (tpa_start); agg_id =bnxt_alloc_agg_idx (rxr, agg_id); +if (unlikely (agg_id ==INVALID_HW_RING_ID )) { +netdev_warn (bp->dev,"Unable to allocate agg ID for ring %d, agg 0x%x\n" , + rxr->bnapi->index, +TPA_START_AGG_ID_P5 (tpa_start)); +bnxt_sched_reset_rxr (bp, rxr); +return ; + } }else { agg_id =TPA_START_AGG_ID (tpa_start); }
drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 -3
@@ -897,11 +897,9 @@ struct bnxt_tpa_info {struct rx_agg_cmp *agg_arr; }; -#define BNXT_AGG_IDX_BMAP_SIZE (MAX_TPA_P5 / BITS_PER_LONG) -struct bnxt_tpa_idx_map {u16 agg_id_tbl[1024 ]; -unsigned long agg_idx_bmap[BNXT_AGG_IDX_BMAP_SIZE ]; + DECLARE_BITMAP(agg_idx_bmap, MAX_TPA_P5); };struct bnxt_rx_ring_info {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 46/72 net: fix memory leak in skb_segment_list for GRO packets
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohammad Heib <[email protected]>
[ Upstream commit 238e03d0466239410b72294b79494e43d4fabe77 ]
When skb_segment_list() is called during packet forwarding, it handles packets that were aggregated by the GRO engine.
Historically, the segmentation logic in skb_segment_list assumes that individual segments are split from a parent SKB and may need to carry their own socket memory accounting. Accordingly, the code transfers truesize from the parent to the newly created segments.
Prior to commit ed4cccef64c1 ("gro: fix ownership transfer"), this truesize subtraction in skb_segment_list() was valid because fragments still carry a reference to the original socket.
However, commit ed4cccef64c1 ("gro: fix ownership transfer") changed this behavior by ensuring that fraglist entries are explicitly orphaned (skb->sk = NULL) to prevent illegal orphaning later in the stack. This change meant that the entire socket memory charge remained with the head SKB, but the corresponding accounting logic in skb_segment_list() was never updated.
As a result, the current code unconditionally adds each fragment's truesize to delta_truesize and subtracts it from the parent SKB. Since the fragments are no longer charged to the socket, this subtraction results in an effective under-count of memory when the head is freed. This causes sk_wmem_alloc to remain non-zero, preventing socket destruction and leading to a persistent memory leak.
The leak can be observed via KMEMLEAK when tearing down the networking environment:
unreferenced object 0xffff8881e6eb9100 (size 2048):
comm "ping", pid 6720, jiffies 4295492526 backtrace:
kmem_cache_alloc_noprof+0x5c6/0x800
sk_prot_alloc+0x5b/0x220
sk_alloc+0x35/0xa00
inet6_create.part.0+0x303/0x10d0
__sock_create+0x248/0x640
__sys_socket+0x11b/0x1d0Since skb_segment_list() is exclusively used for SKB_GSO_FRAGLIST packets constructed by GRO, the truesize adjustment is removed.
The call to skb_release_head_state() must be preserved. As documented in commit cf673ed0e057 ("net: fix fraglist segmentation reference count leak"), it is still required to correctly drop references to SKB extensions that may be overwritten during __copy_skb_header().
--- net/core/skbuff.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/core/skbuff.c +5 -3
@@ -4045,12 +4045,14 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb, {struct sk_buff *list_skb =skb_shinfo (skb)->frag_list;unsigned int tnl_hlen =skb_tnl_header_len (skb); -unsigned int delta_truesize =0 ;unsigned int delta_len =0 ;struct sk_buff *tail =NULL ;struct sk_buff *nskb, *tmp;int len_diff, err; +/* Only skb_gro_receive_list generated skbs arrive here */ +DEBUG_NET_WARN_ON_ONCE (!(skb_shinfo (skb)->gso_type &SKB_GSO_FRAGLIST )); +skb_push (skb, -skb_network_offset (skb) + offset);/* Ensure the head is writeable before touching the shared info */
@@ -4064,8 +4066,9 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb, nskb = list_skb; list_skb = list_skb->next; +DEBUG_NET_WARN_ON_ONCE (nskb->sk); + err =0 ; - delta_truesize += nskb->truesize;if (skb_shared (nskb)) { tmp =skb_clone (nskb,GFP_ATOMIC );if (tmp) {
@@ -4108,7 +4111,6 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb, goto err_linearize; } - skb->truesize = skb->truesize - delta_truesize; skb->data_len = skb->data_len - delta_len; skb->len = skb->len - delta_len;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 47/72 HID: quirks: work around VID/PID conflict for appledisplay
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: René Rebe <[email protected]>
[ Upstream commit c7fabe4ad9219866c203164a214c474c95b36bf2 ]
For years I wondered why the Apple Cinema Display driver would not just work for me. Turns out the hidraw driver instantly takes it over. Fix by adding appledisplay VID/PIDs to hid_have_special_driver.
--- drivers/hid/hid-quirks.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/hid/hid-quirks.c +9 -0
@@ -220,6 +220,15 @@ static const struct hid_device_id hid_quirks[] = {* used as a driver. See hid_scan_report(). */ static const struct hid_device_id hid_have_special_driver[] = { +#if IS_ENABLED(CONFIG_APPLEDISPLAY) + {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,0x9218 ) }, + {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,0x9219 ) }, + {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,0x921c ) }, + {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,0x921d ) }, + {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,0x9222 ) }, + {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,0x9226 ) }, + {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,0x9236 ) }, +#endif #if IS_ENABLED(CONFIG_HID_A4TECH) {HID_USB_DEVICE (USB_VENDOR_ID_A4TECH ,USB_DEVICE_ID_A4TECH_WCP32PU ) }, { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 48/72 net/sched: sch_qfq: Fix NULL deref when deactivating inactive aggregate in qfq_reset
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei <[email protected]>
[ Upstream commit c1d73b1480235731e35c81df70b08f4714a7d095 ]
qfq_class->leaf_qdisc->q.qlen > 0 does not imply that the class itself is active.
Two qfq_class objects may point to the same leaf_qdisc. This happens when:
1. one QFQ qdisc is attached to the dev as the root qdisc, and
2. another QFQ qdisc is temporarily referenced (e.g., via qdisc_get() / qdisc_put()) and is pending to be destroyed, as in function tc_new_tfilter.
When packets are enqueued through the root QFQ qdisc, the shared leaf_qdisc->q.qlen increases. At the same time, the second QFQ qdisc triggers qdisc_put and qdisc_destroy: the qdisc enters qfq_reset() with its own q->q.qlen == 0, but its class's leaf qdisc->q.qlen > 0. Therefore, the qfq_reset would wrongly deactivate an inactive aggregate and trigger a null-deref in qfq_deactivate_agg:
[ 0.903172] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 0.903571] #PF: supervisor write access in kernel mode [ 0.903860] #PF: error_code(0x0002) - not-present page [ 0.904177] PGD 10299b067 P4D 10299b067 PUD 10299c067 PMD 0 [ 0.904502] Oops: Oops: 0002 [#1] SMP NOPTI [ 0.904737] CPU: 0 UID: 0 PID: 135 Comm: exploit Not tainted 6.19.0-rc3+ #2 NONE [ 0.905157] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014 [ 0.905754] RIP: 0010:qfq_deactivate_agg (include/linux/list.h:992 (discriminator 2) include/linux/list.h:1006 (discriminator 2) net/sched/sch_qfq.c:1367 (discriminator 2) net/sched/sch_qfq.c:1393 (discriminator 2)) [ 0.906046] Code: 0f 84 4d 01 00 00 48 89 70 18 8b 4b 10 48 c7 c2 ff ff ff ff 48 8b 78 08 48 d3 e2 48 21 f2 48 2b 13 48 8b 30 48 d3 ea 8b 4b 18 0
Code starting with the faulting instruction
===========================================
0: 0f 84 4d 01 00 00 je 0x153 6: 48 89 70 18 mov %rsi,0x18(%rax) a: 8b 4b 10 mov 0x10(%rbx),%ecx d: 48 c7 c2 ff ff ff ff mov $0xffffffffffffffff,%rdx 14: 48 8b 78 08 mov 0x8(%rax),%rdi 18: 48 d3 e2 shl %cl,%rdx 1b: 48 21 f2 and %rsi,%rdx 1e: 48 2b 13 sub (%rbx),%rdx 21: 48 8b 30 mov (%rax),%rsi 24: 48 d3 ea shr %cl,%rdx 27: 8b 4b 18 mov 0x18(%rbx),%ecx ... [ 0.907095] RSP: 0018:ffffc900004a39a0 EFLAGS: 00010246 [ 0.907368] RAX: ffff8881043a0880 RBX: ffff888102953340 RCX: 0000000000000000 [ 0.907723] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 0.908100] RBP: ffff888102952180 R08: 0000000000000000 R09: 0000000000000000 [ 0.908451] R10: ffff8881043a0000 R11: 0000000000000000 R12: ffff888102952000 [ 0.908804] R13: ffff888102952180 R14: ffff8881043a0ad8 R15: ffff8881043a0880 [ 0.909179] FS: 000000002a1a0380(0000) GS:ffff888196d8d000(0000) knlGS:0000000000000000 [ 0.909572] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.909857] CR2: 0000000000000000 CR3: 0000000102993002 CR4: 0000000000772ef0 [ 0.910247] PKRU: 55555554 [ 0.910391] Call Trace: [ 0.910527] <TASK> [ 0.910638] qfq_reset_qdisc (net/sched/sch_qfq.c:357 net/sched/sch_qfq.c:1485) [ 0.910826] qdisc_reset (include/linux/skbuff.h:2195 include/linux/skbuff.h:2501 include/linux/skbuff.h:3424 include/linux/skbuff.h:3430 net/sched/sch_generic.c:1036) [ 0.911040] __qdisc_destroy (net/sched/sch_generic.c:1076) [ 0.911236] tc_new_tfilter (net/sched/cls_api.c:2447) [ 0.911447] rtnetlink_rcv_msg (net/core/rtnetlink.c:6958) [ 0.911663] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6861) [ 0.911894] netlink_rcv_skb (net/netlink/af_netlink.c:2550) [ 0.912100] netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1344) [ 0.912296] ? __alloc_skb (net/core/skbuff.c:706) [ 0.912484] netlink_sendmsg (net/netlink/af_netlink.c:1894) [ 0.912682] sock_write_iter (net/socket.c:727 (discriminator 1) net/socket.c:742 (discriminator 1) net/socket.c:1195 (discriminator 1)) [ 0.912880] vfs_write (fs/read_write.c:593 fs/read_write.c:686) [ 0.913077] ksys_write (fs/read_write.c:738) [ 0.913252] do_syscall_64 (arch/x86/entry/syscall_64.c:63 (discriminator 1) arch/x86/entry/syscall_64.c:94 (discriminator 1)) [ 0.913438] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:131) [ 0.913687] RIP: 0033:0x424c34 [ 0.913844] Code: 89 02 48 c7 c0 ff ff ff ff eb bd 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 80 3d 2d 44 09 00 00 74 13 b8 01 00 00 00 0f 05 9
Code starting with the faulting instruction
===========================================
0: 89 02 mov %eax,(%rdx) 2: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax 9: eb bd jmp 0xffffffffffffffc8 b: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 12: 00 00 00 15: 90 nop 16: f3 0f 1e fa endbr64 1a: 80 3d 2d 44 09 00 00 cmpb $0x0,0x9442d(%rip) # 0x9444e 21: 74 13 je 0x36 23: b8 01 00 00 00 mov $0x1,%eax 28: 0f 05 syscall 2a: 09 .byte 0x9 [ 0.914807] RSP: 002b:00007ffea1938b78 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 [ 0.915197] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000424c34 [ 0.915556] RDX: 000000000000003c RSI: 000000002af378c0 RDI: 0000000000000003 [ 0.915912] RBP: 00007ffea1938bc0 R08: 00000000004b8820 R09: 0000000000000000 [ 0.916297] R10: 0000000000000001 R11: 0000000000000202 R12: 00007ffea1938d28 [ 0.916652] R13: 00007ffea1938d38 R14: 00000000004b3828 R15: 0000000000000001 [ 0.917039] </TASK> [ 0.917158] Modules linked in: [ 0.917316] CR2: 0000000000000000 [ 0.917484] ---[ end trace 0000000000000000 ]--- [ 0.917717] RIP: 0010:qfq_deactivate_agg (include/linux/list.h:992 (discriminator 2) include/linux/list.h:1006 (discriminator 2) net/sched/sch_qfq.c:1367 (discriminator 2) net/sched/sch_qfq.c:1393 (discriminator 2)) [ 0.917978] Code: 0f 84 4d 01 00 00 48 89 70 18 8b 4b 10 48 c7 c2 ff ff ff ff 48 8b 78 08 48 d3 e2 48 21 f2 48 2b 13 48 8b 30 48 d3 ea 8b 4b 18 0
Code starting with the faulting instruction
===========================================
0: 0f 84 4d 01 00 00 je 0x153 6: 48 89 70 18 mov %rsi,0x18(%rax) a: 8b 4b 10 mov 0x10(%rbx),%ecx d: 48 c7 c2 ff ff ff ff mov $0xffffffffffffffff,%rdx 14: 48 8b 78 08 mov 0x8(%rax),%rdi 18: 48 d3 e2 shl %cl,%rdx 1b: 48 21 f2 and %rsi,%rdx 1e: 48 2b 13 sub (%rbx),%rdx 21: 48 8b 30 mov (%rax),%rsi 24: 48 d3 ea shr %cl,%rdx 27: 8b 4b 18 mov 0x18(%rbx),%ecx ... [ 0.918902] RSP: 0018:ffffc900004a39a0 EFLAGS: 00010246 [ 0.919198] RAX: ffff8881043a0880 RBX: ffff888102953340 RCX: 0000000000000000 [ 0.919559] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 0.919908] RBP: ffff888102952180 R08: 0000000000000000 R09: 0000000000000000 [ 0.920289] R10: ffff8881043a0000 R11: 0000000000000000 R12: ffff888102952000 [ 0.920648] R13: ffff888102952180 R14: ffff8881043a0ad8 R15: ffff8881043a0880 [ 0.921014] FS: 000000002a1a0380(0000) GS:ffff888196d8d000(0000) knlGS:0000000000000000 [ 0.921424] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.921710] CR2: 0000000000000000 CR3: 0000000102993002 CR4: 0000000000772ef0 [ 0.922097] PKRU: 55555554 [ 0.922240] Kernel panic - not syncing: Fatal exception [ 0.922590] Kernel Offset: disabled
--- net/sched/sch_qfq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_qfq.c +1 -1
@@ -1483,7 +1483,7 @@ static void qfq_reset_qdisc(struct Qdisc *sch)for (i =0 ; i < q->clhash.hashsize; i++) {hlist_for_each_entry (cl, &q->clhash.hash[i], common.hnode) { -if (cl->qdisc->q.qlen >0 ) +if (cl_is_active (cl))qfq_deactivate_class (q, cl);qdisc_reset (cl->qdisc);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 49/72 net: usb: pegasus: fix memory leak in update_eth_regs_async()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petko Manolov <[email protected]>
[ Upstream commit afa27621a28af317523e0836dad430bec551eb54 ]
When asynchronously writing to the device registers and if usb_submit_urb() fail, the code fail to release allocated to this point resources.
--- drivers/net/usb/pegasus.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/usb/pegasus.c +2 -0
@@ -168,6 +168,8 @@ static int update_eth_regs_async(pegasus_t *pegasus)netif_device_detach (pegasus->net);netif_err (pegasus, drv, pegasus->net,"%s returned %d\n" , __func__, ret); +usb_free_urb (async_urb); +kfree (req); }return ret; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 50/72 net: enetc: fix build warning when PAGE_SIZE is greater than 128K
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
[ Upstream commit 4b5bdabb5449b652122e43f507f73789041d4abe ]
The max buffer size of ENETC RX BD is 0xFFFF bytes, so if the PAGE_SIZE is greater than 128K, ENETC_RXB_DMA_SIZE and ENETC_RXB_DMA_SIZE_XDP will be greater than 0xFFFF, thus causing a build warning.
This will not cause any practical issues because ENETC is currently only used on the ARM64 platform, and the max PAGE_SIZE is 64K. So this patch is only for fixing the build warning that occurs when compiling ENETC drivers for other platforms.
--- drivers/net/ethernet/freescale/enetc/enetc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.h +2 -2
@@ -43,9 +43,9 @@ struct enetc_tx_swbd {#define ENETC_RXB_TRUESIZE (PAGE_SIZE >> 1)#define ENETC_RXB_PAD NET_SKB_PAD/* add extra space if needed */ #define ENETC_RXB_DMA_SIZE \ - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD) + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD, 0xffff)#define ENETC_RXB_DMA_SIZE_XDP \ - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM) + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM, 0xffff)struct enetc_rx_swbd {dma_addr_t dma;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 51/72 arp: do not assume dev_hard_header() does not change skb->head
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit c92510f5e3f82ba11c95991824a41e59a9c5ed81 ]
arp_create() is the only dev_hard_header() caller making assumption about skb->head being unchanged.
A recent commit broke this assumption.
Initialize @arp pointer after dev_hard_header() call.
--- net/ipv4/arp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/ipv4/arp.c +4 -3
@@ -563,7 +563,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,skb_reserve (skb, hlen);skb_reset_network_header (skb); - arp =skb_put (skb,arp_hdr_len (dev)); +skb_put (skb,arp_hdr_len (dev)); skb->dev = dev; skb->protocol =htons (ETH_P_ARP );if (!src_hw)
@@ -571,12 +571,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,if (!dest_hw) dest_hw = dev->broadcast; -/* -* Fill the device header for the ARP frame +/* Fill the device header for the ARP frame. +* Note: skb->head can be changed. */ if (dev_hard_header (skb, dev, ptype, dest_hw, src_hw, skb->len) <0 ) goto out; + arp =arp_hdr (skb);/* * Fill out the arp protocol part. *
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 52/72 pinctrl: qcom: lpass-lpi: mark the GPIO controller as sleeping
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
commit ebc18e9854e5a2b62a041fb57b216a903af45b85 upstream.
The gpio_chip settings in this driver say the controller can't sleep but it actually uses a mutex for synchronization. This triggers the following BUG():
[ 9.233659] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281 [ 9.233665] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 554, name: (udev-worker) [ 9.233669] preempt_count: 1, expected: 0 [ 9.233673] RCU nest depth: 0, expected: 0 [ 9.233688] Tainted: [W]=WARN [ 9.233690] Hardware name: Dell Inc. Latitude 7455/0FK7MX, BIOS 2.10.1 05/20/2025 [ 9.233694] Call trace: [ 9.233696] show_stack+0x24/0x38 (C) [ 9.233709] dump_stack_lvl+0x40/0x88 [ 9.233716] dump_stack+0x18/0x24 [ 9.233722] __might_resched+0x148/0x160 [ 9.233731] __might_sleep+0x38/0x98 [ 9.233736] mutex_lock+0x30/0xd8 [ 9.233749] lpi_config_set+0x2e8/0x3c8 [pinctrl_lpass_lpi] [ 9.233757] lpi_gpio_direction_output+0x58/0x90 [pinctrl_lpass_lpi] [ 9.233761] gpiod_direction_output_raw_commit+0x110/0x428 [ 9.233772] gpiod_direction_output_nonotify+0x234/0x358 [ 9.233779] gpiod_direction_output+0x38/0xd0 [ 9.233786] gpio_shared_proxy_direction_output+0xb8/0x2a8 [gpio_shared_proxy] [ 9.233792] gpiod_direction_output_raw_commit+0x110/0x428 [ 9.233799] gpiod_direction_output_nonotify+0x234/0x358 [ 9.233806] gpiod_configure_flags+0x2c0/0x580 [ 9.233812] gpiod_find_and_request+0x358/0x4f8 [ 9.233819] gpiod_get_index+0x7c/0x98 [ 9.233826] devm_gpiod_get+0x34/0xb0 [ 9.233829] reset_gpio_probe+0x58/0x128 [reset_gpio] [ 9.233836] auxiliary_bus_probe+0xb0/0xf0 [ 9.233845] really_probe+0x14c/0x450 [ 9.233853] __driver_probe_device+0xb0/0x188 [ 9.233858] driver_probe_device+0x4c/0x250 [ 9.233863] __driver_attach+0xf8/0x2a0 [ 9.233868] bus_for_each_dev+0xf8/0x158 [ 9.233872] driver_attach+0x30/0x48 [ 9.233876] bus_add_driver+0x158/0x2b8 [ 9.233880] driver_register+0x74/0x118 [ 9.233886] __auxiliary_driver_register+0x94/0xe8 [ 9.233893] init_module+0x34/0xfd0 [reset_gpio] [ 9.233898] do_one_initcall+0xec/0x300 [ 9.233903] do_init_module+0x64/0x260 [ 9.233910] load_module+0x16c4/0x1900 [ 9.233915] __arm64_sys_finit_module+0x24c/0x378 [ 9.233919] invoke_syscall+0x4c/0xe8 [ 9.233925] el0_svc_common+0x8c/0xf0 [ 9.233929] do_el0_svc+0x28/0x40 [ 9.233934] el0_svc+0x38/0x100 [ 9.233938] el0t_64_sync_handler+0x84/0x130 [ 9.233943] el0t_64_sync+0x17c/0x180
Mark the controller as sleeping.
--- drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +1 -1
@@ -435,7 +435,7 @@ int lpi_pinctrl_probe(struct platform_de pctrl->chip.ngpio = data->npins; pctrl->chip.label =dev_name (dev); pctrl->chip.of_gpio_n_cells =2 ; - pctrl->chip.can_sleep = false; + pctrl->chip.can_sleep = true;mutex_init (&pctrl->lock);
Greg Kroah-Hartman
maintainerPATCH 53/72 mm/pagewalk: add walk_page_range_vma()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <[email protected]>
[ Upstream commit e07cda5f232fac4de0925d8a4c92e51e41fa2f6e ]
Let's add walk_page_range_vma(), which is similar to walk_page_vma(), however, is only interested in a subset of the VMA range.
To be used in KSM code to stop using follow_page() next.
Stable-dep-of: f5548c318d6 ("ksm: use range-walk function to jump over holes in scan_get_next_rmap_item")
--- include/linux/pagewalk.h | 3 +++ mm/pagewalk.c | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+)
include/linux/pagewalk.h +3 -0
@@ -99,6 +99,9 @@ int walk_page_range_novma(struct mm_stru unsigned long end, const struct mm_walk_ops *ops, pgd_t *pgd, void *private); +int walk_page_range_vma (struct vm_area_struct *vma,unsigned long start, +unsigned long end,const struct mm_walk_ops *ops, +void *private);int walk_page_vma (struct vm_area_struct *vma,const struct mm_walk_ops *ops,void *private); int walk_page_mapping(struct address_space *mapping, pgoff_t first_index,
mm/pagewalk.c +20 -0
@@ -517,6 +517,26 @@ int walk_page_range_novma(struct mm_strureturn walk_pgd_range (start, end, &walk); } +int walk_page_range_vma (struct vm_area_struct *vma,unsigned long start, +unsigned long end,const struct mm_walk_ops *ops, +void *private) +{ +struct mm_walk walk = { + .ops = ops, + .mm = vma->vm_mm, + .vma = vma, + .private = private, + }; + +if (start >= end || !walk.mm) +return -EINVAL ; +if (start < vma->vm_start || end > vma->vm_end) +return -EINVAL ; + +mmap_assert_locked (walk.mm); +return __walk_page_range (start, end, &walk); +} +int walk_page_vma (struct vm_area_struct *vma,const struct mm_walk_ops *ops,void *private) {
Greg Kroah-Hartman
maintainerPATCH 54/72 ksm: use range-walk function to jump over holes in scan_get_next_rmap_item
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pedro Demarchi Gomes <[email protected]>
[ Upstream commit f5548c318d6520d4fa3c5ed6003eeb710763cbc5 ]
Currently, scan_get_next_rmap_item() walks every page address in a VMA to locate mergeable pages. This becomes highly inefficient when scanning large virtual memory areas that contain mostly unmapped regions, causing ksmd to use large amount of cpu without deduplicating much pages.
This patch replaces the per-address lookup with a range walk using walk_page_range(). The range walker allows KSM to skip over entire unmapped holes in a VMA, avoiding unnecessary lookups. This problem was previously discussed in [1].
Consider the following test program which creates a 32 TiB mapping in the virtual address space but only populates a single page:
/* 32 TiB */
const size_t size = 32ul * 1024 * 1024 * 1024 * 1024;
int main() {
char *area = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1, 0);
if (area == MAP_FAILED) {
perror("mmap() failed\n");
return -1;
}
/* Populate a single page such that we get an anon_vma. */
*area = 0;
/* Enable KSM. */
madvise(area, size, MADV_MERGEABLE);
pause();
return 0;
}$ ./ksm-sparse & $ echo 1 > /sys/kernel/mm/ksm/run
Without this patch ksmd uses 100% of the cpu for a long time (more then 1 hour in my test machine) scanning all the 32 TiB virtual address space that contain only one mapped page. This makes ksmd essentially deadlocked not able to deduplicate anything of value. With this patch ksmd walks only the one mapped page and skips the rest of the 32 TiB virtual address space, making the scan fast using little cpu.
[ replace pmdp_get_lockless with pmd_read_atomic and pmdp_get with
READ_ONCE(*pmdp) ]
--- mm/ksm.c | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 113 insertions(+), 13 deletions(-)
mm/ksm.c +113 -13
@@ -39,6 +39,7 @@#include <linux/freezer.h> #include <linux/oom.h> #include <linux/numa.h> +#include <linux/pagewalk.h> #include <asm/tlbflush.h> #include "internal.h"
@@ -2223,6 +2224,94 @@ static struct ksm_rmap_item *get_next_rmreturn rmap_item; } +struct ksm_next_page_arg { +struct folio *folio; +struct page *page; +unsigned long addr; +}; + +static int ksm_next_page_pmd_entry (pmd_t *pmdp,unsigned long addr,unsigned long end, +struct mm_walk *walk) +{ +struct ksm_next_page_arg *private = walk->private; +struct vm_area_struct *vma = walk->vma; +pte_t *start_ptep =NULL , *ptep, pte; +struct mm_struct *mm = walk->mm; +struct folio *folio; +struct page *page; +spinlock_t *ptl; +pmd_t pmd; + +if (ksm_test_exit (mm)) +return 0 ; + +cond_resched (); + + pmd =pmd_read_atomic (pmdp); +if (!pmd_present (pmd)) +return 0 ; + +if (IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ) &&pmd_leaf (pmd)) { + ptl =pmd_lock (mm, pmdp); + pmd =READ_ONCE (*pmdp); + +if (!pmd_present (pmd)) { + goto not_found_unlock; + }else if (pmd_leaf (pmd)) { + page =vm_normal_page_pmd (vma, addr, pmd); +if (!page) + goto not_found_unlock; + folio =page_folio (page); + +if (folio_is_zone_device (folio) || !folio_test_anon (folio)) + goto not_found_unlock; + + page += ((addr & (PMD_SIZE -1 )) >>PAGE_SHIFT ); + goto found_unlock; + } +spin_unlock (ptl); + } + + start_ptep =pte_offset_map_lock (mm, pmdp, addr, &ptl); +if (!start_ptep) +return 0 ; + +for (ptep = start_ptep; addr < end; ptep++, addr +=PAGE_SIZE ) { + pte =ptep_get (ptep); + +if (!pte_present (pte)) +continue ; + + page =vm_normal_page (vma, addr, pte); +if (!page) +continue ; + folio =page_folio (page); + +if (folio_is_zone_device (folio) || !folio_test_anon (folio)) +continue ; + goto found_unlock; + } + +not_found_unlock: +spin_unlock (ptl); +if (start_ptep) +pte_unmap (start_ptep); +return 0 ; +found_unlock: +folio_get (folio); +spin_unlock (ptl); +if (start_ptep) +pte_unmap (start_ptep); + private->page = page; + private->folio = folio; + private->addr = addr; +return 1 ; +} + +static struct mm_walk_ops ksm_next_page_ops = { + .pmd_entry = ksm_next_page_pmd_entry, +}; +static struct ksm_rmap_item *scan_get_next_rmap_item (struct page **page) {struct mm_struct *mm;
@@ -2307,32 +2396,43 @@ next_mm: ksm_scan.address = vma->vm_end;while (ksm_scan.address < vma->vm_end) { +struct ksm_next_page_arg ksm_next_page_arg; +struct page *tmp_page =NULL ; +struct folio *folio; +if (ksm_test_exit (mm))break ; - *page =follow_page (vma, ksm_scan.address,FOLL_GET ); -if (IS_ERR_OR_NULL (*page)) { - ksm_scan.address +=PAGE_SIZE ; -cond_resched (); -continue ; + +int found; + + found =walk_page_range_vma (vma, ksm_scan.address, + vma->vm_end, + &ksm_next_page_ops, + &ksm_next_page_arg); + +if (found >0 ) { + folio = ksm_next_page_arg.folio; + tmp_page = ksm_next_page_arg.page; + ksm_scan.address = ksm_next_page_arg.addr; + }else { +VM_WARN_ON_ONCE (found <0 ); + ksm_scan.address = vma->vm_end -PAGE_SIZE ; } -if (is_zone_device_page (*page)) - goto next_page; -if (PageAnon (*page)) { -flush_anon_page (vma, *page, ksm_scan.address); -flush_dcache_page (*page); +if (tmp_page) { +flush_anon_page (vma, tmp_page, ksm_scan.address); +flush_dcache_page (tmp_page); rmap_item =get_next_rmap_item (mm_slot, ksm_scan.rmap_list, ksm_scan.address);if (rmap_item) { ksm_scan.rmap_list = &rmap_item->rmap_list; ksm_scan.address +=PAGE_SIZE ; + *page = tmp_page; }else -put_page (*page); +folio_put (folio);mmap_read_unlock (mm);return rmap_item; } -next_page: -put_page (*page); ksm_scan.address +=PAGE_SIZE ;cond_resched (); }
Greg Kroah-Hartman
maintainerPATCH 55/72 ALSA: ac97bus: Use guard() for mutex locks
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit c07824a14d99c10edd4ec4c389d219af336ecf20 ]
Replace the manual mutex lock/unlock pairs with guard() for code simplification.
Only code refactoring, and no behavior change.
Stable-dep-of: 830988b6cf19 ("ALSA: ac97: fix a double free in snd_ac97_controller_register()")
--- sound/ac97/bus.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)
sound/ac97/bus.c +9 -13
@@ -242,10 +242,9 @@ static ssize_t cold_reset_store(struct d {struct ac97_controller *ac97_ctrl; -mutex_lock (&ac97_controllers_mutex); +guard (mutex)(&ac97_controllers_mutex); ac97_ctrl =to_ac97_controller (dev); ac97_ctrl->ops->reset (ac97_ctrl); -mutex_unlock (&ac97_controllers_mutex);return len; }static DEVICE_ATTR_WO (cold_reset);
@@ -259,10 +258,9 @@ static ssize_t warm_reset_store(struct dif (!dev)return -ENODEV ; -mutex_lock (&ac97_controllers_mutex); +guard (mutex)(&ac97_controllers_mutex); ac97_ctrl =to_ac97_controller (dev); ac97_ctrl->ops->warm_reset (ac97_ctrl); -mutex_unlock (&ac97_controllers_mutex);return len; }static DEVICE_ATTR_WO (warm_reset);
@@ -285,10 +283,10 @@ static const struct attribute_group *ac9static void ac97_del_adapter (struct ac97_controller *ac97_ctrl) { -mutex_lock (&ac97_controllers_mutex); -ac97_ctrl_codecs_unregister (ac97_ctrl); -list_del (&ac97_ctrl->controllers); -mutex_unlock (&ac97_controllers_mutex); + scoped_guard(mutex, &ac97_controllers_mutex) { +ac97_ctrl_codecs_unregister (ac97_ctrl); +list_del (&ac97_ctrl->controllers); + }device_unregister (&ac97_ctrl->adap); }
@@ -312,7 +310,7 @@ static int ac97_add_adapter(struct ac97_ {int ret; -mutex_lock (&ac97_controllers_mutex); +guard (mutex)(&ac97_controllers_mutex); ret =idr_alloc (&ac97_adapter_idr, ac97_ctrl,0 ,0 ,GFP_KERNEL ); ac97_ctrl->nr = ret;if (ret >=0 ) {
@@ -323,13 +321,11 @@ static int ac97_add_adapter(struct ac97_if (ret)put_device (&ac97_ctrl->adap); } -if (!ret) +if (!ret) {list_add (&ac97_ctrl->controllers, &ac97_controllers); -mutex_unlock (&ac97_controllers_mutex); - -if (!ret)dev_dbg (&ac97_ctrl->adap,"adapter registered by %s\n" ,dev_name (ac97_ctrl->parent)); + }return ret; }
Greg Kroah-Hartman
maintainerPATCH 56/72 ALSA: ac97: fix a double free in snd_ac97_controller_register()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haoxiang Li <[email protected]>
[ Upstream commit 830988b6cf197e6dcffdfe2008c5738e6c6c3c0f ]
If ac97_add_adapter() fails, put_device() is the correct way to drop the device reference. kfree() is not required.
Add kfree() if idr_alloc() fails and in ac97_adapter_release() to do the cleanup.
Found by code review.
--- sound/ac97/bus.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/ac97/bus.c +5 -5
@@ -299,6 +299,7 @@ static void ac97_adapter_release(structidr_remove (&ac97_adapter_idr, ac97_ctrl->nr);dev_dbg (&ac97_ctrl->adap,"adapter unregistered by %s\n" ,dev_name (ac97_ctrl->parent)); +kfree (ac97_ctrl); }static const struct device_type ac97_adapter_type = {
@@ -320,7 +321,9 @@ static int ac97_add_adapter(struct ac97_ ret =device_register (&ac97_ctrl->adap);if (ret)put_device (&ac97_ctrl->adap); - } + }else +kfree (ac97_ctrl); +if (!ret) {list_add (&ac97_ctrl->controllers, &ac97_controllers); dev_dbg(&ac97_ctrl->adap, "adapter registered by %s\n",
@@ -361,14 +364,11 @@ struct ac97_controller *snd_ac97_control ret =ac97_add_adapter (ac97_ctrl);if (ret) - goto err; +return ERR_PTR (ret);ac97_bus_reset (ac97_ctrl);ac97_bus_scan (ac97_ctrl);return ac97_ctrl; -err: -kfree (ac97_ctrl); -return ERR_PTR (ret); }EXPORT_SYMBOL_GPL (snd_ac97_controller_register);
Greg Kroah-Hartman
maintainerPATCH 57/72 nfsd: provide locking for v4_end_grace
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
[ Upstream commit 2857bd59feb63fcf40fe4baf55401baea6b4feb4 ]
Writing to v4_end_grace can race with server shutdown and result in memory being accessed after it was freed - reclaim_str_hashtbl in particularly.
We cannot hold nfsd_mutex across the nfsd4_end_grace() call as that is held while client_tracking_op->init() is called and that can wait for an upcall to nfsdcltrack which can write to v4_end_grace, resulting in a deadlock.
nfsd4_end_grace() is also called by the landromat work queue and this doesn't require locking as server shutdown will stop the work and wait for it before freeing anything that nfsd4_end_grace() might access.
However, we must be sure that writing to v4_end_grace doesn't restart the work item after shutdown has already waited for it. For this we add a new flag protected with nn->client_lock. It is set only while it is safe to make client tracking calls, and v4_end_grace only schedules work while the flag is set with the spinlock held.
So this patch adds a nfsd_net field "client_tracking_active" which is set as described. Another field "grace_end_forced", is set when v4_end_grace is written. After this is set, and providing client_tracking_active is set, the laundromat is scheduled. This "grace_end_forced" field bypasses other checks for whether the grace period has finished.
This resolves a race which can result in use-after-free.
--- fs/nfsd/netns.h | 2 ++ fs/nfsd/nfs4state.c | 42 ++++++++++++++++++++++++++++++++++++++++-- fs/nfsd/nfsctl.c | 3 +-- fs/nfsd/state.h | 2 +- 4 files changed, 44 insertions(+), 5 deletions(-)
fs/nfsd/netns.h +2 -0
@@ -64,6 +64,8 @@ struct nfsd_net {struct lock_manager nfsd4_manager;bool grace_ended; +bool grace_end_forced; +bool client_tracking_active;time64_t boot_time;struct dentry *nfsd_client_dir;
fs/nfsd/nfs4state.c +40 -2
84 lines not on this page · raw message
fs/nfsd/nfsctl.c +1 -2
@@ -1117,9 +1117,8 @@ static ssize_t write_v4_end_grace(structcase 'Y' :case 'y' :case '1' : -if (!nn->nfsd_serv) +if (!nfsd4_force_end_grace (nn))return -EBUSY ; -nfsd4_end_grace (nn);break ;default :return -EINVAL ;
fs/nfsd/state.h +1 -1
@@ -719,7 +719,7 @@ static inline void get_nfs4_file(structstruct nfsd_file *find_any_file (struct nfs4_file *f);/* grace period management */ -void nfsd4_end_grace (struct nfsd_net *nn); +bool nfsd4_force_end_grace (struct nfsd_net *nn);/* nfs4recover operations */ extern int nfsd4_client_tracking_init (struct net *net);
Greg Kroah-Hartman
maintainerPATCH 58/72 NFS: trace: show TIMEDOUT instead of 0x6e
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Hanxiao <[email protected]>
[ Upstream commit cef48236dfe55fa266d505e8a497963a7bc5ef2a ]
__nfs_revalidate_inode may return ETIMEDOUT.
print symbol of ETIMEDOUT in nfs trace:
before:
cat-5191 [005] 119.331127: nfs_revalidate_inode_exit: error=-110 (0x6e)
after:
cat-1738 [004] 44.365509: nfs_revalidate_inode_exit: error=-110 (TIMEDOUT)
Stable-dep-of: c6c209ceb87f ("NFSD: Remove NFSERR_EAGAIN")
--- include/trace/misc/nfs.h | 1 + 1 file changed, 1 insertion(+)
include/trace/misc/nfs.h +1 -0
@@ -52,6 +52,7 @@ TRACE_DEFINE_ENUM(NFSERR_JUKEBOX); { NFSERR_IO, "IO" }, \ { NFSERR_NXIO, "NXIO" }, \ { ECHILD, "CHILD" }, \ + { ETIMEDOUT, "TIMEDOUT" }, \ { NFSERR_EAGAIN, "AGAIN" }, \ { NFSERR_ACCES, "ACCES" }, \ { NFSERR_EXIST, "EXIST" }, \
Greg Kroah-Hartman
maintainerPATCH 59/72 nfs_common: factor out nfs_errtbl and nfs_stat_to_errno
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <[email protected]>
[ Upstream commit 4806ded4c14c5e8fdc6ce885d83221a78c06a428 ]
Common nfs_stat_to_errno() is used by both fs/nfs/nfs2xdr.c and fs/nfs/nfs3xdr.c
Will also be used by fs/nfsd/localio.c
Stable-dep-of: c6c209ceb87f ("NFSD: Remove NFSERR_EAGAIN")
--- fs/nfs/Kconfig | 1 fs/nfs/nfs2xdr.c | 70 ----------------------------- fs/nfs/nfs3xdr.c | 108 ++++++++------------------------------------- fs/nfs/nfs4xdr.c | 4 - fs/nfs_common/Makefile | 2 fs/nfs_common/common.c | 67 +++++++++++++++++++++++++++ fs/nfsd/Kconfig | 1 include/linux/nfs_common.h | 16 ++++++ 8 files changed, 109 insertions(+), 160 deletions(-) create mode 100644 fs/nfs_common/common.c create mode 100644 include/linux/nfs_common.h
fs/nfs/Kconfig +1 -0
@@ -5,6 +5,7 @@ config NFS_FS select CRC32 select LOCKD select SUNRPC + select NFS_COMMON select NFS_ACL_SUPPORT if NFS_V3_ACL help Choose Y here if you want to access files residing on other
fs/nfs/nfs2xdr.c +1 -69
93 lines not on this page · raw message
fs/nfs/nfs3xdr.c +20 -88
237 lines not on this page · raw message
fs/nfs/nfs4xdr.c +1 -3
@@ -52,6 +52,7 @@#include <linux/nfs.h> #include <linux/nfs4.h> #include <linux/nfs_fs.h> +#include <linux/nfs_common.h> #include "nfs4_fs.h" #include "nfs4trace.h"
@@ -63,9 +64,6 @@#define NFSDBG_FACILITY NFSDBG_XDR -/* Mapping from NFS error code to "errno" error code. */ -#define errno_NFSERR_IO EIO -struct compound_hdr ;static int nfs4_stat_to_errno (int ); static void encode_layoutget(struct xdr_stream *xdr,
fs/nfs_common/Makefile +2 -0
@@ -8,3 +8,5 @@ nfs_acl-objs := nfsacl.o obj-$(CONFIG_GRACE_PERIOD) += grace.o obj-$(CONFIG_NFS_V4_2_SSC_HELPER) += nfs_ssc.o + +obj-$(CONFIG_NFS_COMMON) += common.o
fs/nfs_common/common.c new file +67 -0
67 lines not on this page · raw message
fs/nfsd/Kconfig +1 -0
@@ -8,6 +8,7 @@ config NFSD select LOCKD select SUNRPC select EXPORTFS + select NFS_COMMON select NFS_ACL_SUPPORT if NFSD_V2_ACL select NFS_ACL_SUPPORT if NFSD_V3_ACL depends on MULTIUSER
include/linux/nfs_common.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* This file contains constants and methods used by both NFS client and server. +*/ +#ifndef _LINUX_NFS_COMMON_H +#define _LINUX_NFS_COMMON_H + +#include <linux/errno.h> +#include <uapi/linux/nfs.h> + +/* Mapping from NFS error code to "errno" error code. */ +#define errno_NFSERR_IO EIO + +int nfs_stat_to_errno (enum nfs_stat status); + +#endif /* _LINUX_NFS_COMMON_H */
Greg Kroah-Hartman
maintainerPATCH 60/72 NFSD: Remove NFSERR_EAGAIN
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
[ Upstream commit c6c209ceb87f64a6ceebe61761951dcbbf4a0baa ]
I haven't found an NFSERR_EAGAIN in RFCs 1094, 1813, 7530, or 8881. None of these RFCs have an NFS status code that match the numeric value "11".
Based on the meaning of the EAGAIN errno, I presume the use of this status in NFSD means NFS4ERR_DELAY. So replace the one usage of nfserr_eagain, and remove it from NFSD's NFS status conversion tables.
As far as I can tell, NFSERR_EAGAIN has existed since the pre-git era, but was not actually used by any code until commit f4e44b393389 ("NFSD: delay unmount source's export after inter-server copy completed."), at which time it become possible for NFSD to return a status code of 11 (which is not valid NFS protocol).
--- fs/nfs_common/common.c | 1 - fs/nfsd/nfs4proc.c | 2 +- fs/nfsd/nfsd.h | 1 - include/trace/misc/nfs.h | 2 -- include/uapi/linux/nfs.h | 1 - 5 files changed, 1 insertion(+), 6 deletions(-)
fs/nfs_common/common.c +0 -1
@@ -16,7 +16,6 @@ static const struct { { NFSERR_NOENT, -ENOENT }, { NFSERR_IO, -errno_NFSERR_IO}, { NFSERR_NXIO, -ENXIO }, -/* { NFSERR_EAGAIN, -EAGAIN }, */ { NFSERR_ACCES, -EACCES }, { NFSERR_EXIST, -EEXIST }, { NFSERR_XDEV, -EXDEV },
fs/nfsd/nfs4proc.c +1 -1
@@ -1321,7 +1321,7 @@ try_again: (schedule_timeout(20*HZ) == 0)) {finish_wait (&nn->nfsd_ssc_waitq, &wait);kfree (work); -return nfserr_eagain; +return nfserr_jukebox; }finish_wait (&nn->nfsd_ssc_waitq, &wait); goto try_again;
fs/nfsd/nfsd.h +0 -1
@@ -201,7 +201,6 @@ void nfsd_lockd_shutdown(void);#define nfserr_noent cpu_to_be32(NFSERR_NOENT)#define nfserr_io cpu_to_be32(NFSERR_IO)#define nfserr_nxio cpu_to_be32(NFSERR_NXIO) -#define nfserr_eagain cpu_to_be32(NFSERR_EAGAIN)#define nfserr_acces cpu_to_be32(NFSERR_ACCES)#define nfserr_exist cpu_to_be32(NFSERR_EXIST)#define nfserr_xdev cpu_to_be32(NFSERR_XDEV)
include/trace/misc/nfs.h +0 -2
@@ -16,7 +16,6 @@ TRACE_DEFINE_ENUM(NFSERR_PERM);TRACE_DEFINE_ENUM (NFSERR_NOENT );TRACE_DEFINE_ENUM (NFSERR_IO );TRACE_DEFINE_ENUM (NFSERR_NXIO ); -TRACE_DEFINE_ENUM (NFSERR_EAGAIN );TRACE_DEFINE_ENUM (NFSERR_ACCES );TRACE_DEFINE_ENUM (NFSERR_EXIST );TRACE_DEFINE_ENUM (NFSERR_XDEV );
@@ -53,7 +52,6 @@ TRACE_DEFINE_ENUM(NFSERR_JUKEBOX); { NFSERR_NXIO, "NXIO" }, \ { ECHILD, "CHILD" }, \ { ETIMEDOUT, "TIMEDOUT" }, \ - { NFSERR_EAGAIN, "AGAIN" }, \ { NFSERR_ACCES, "ACCES" }, \ { NFSERR_EXIST, "EXIST" }, \ { NFSERR_XDEV, "XDEV" }, \
include/uapi/linux/nfs.h +0 -1
@@ -49,7 +49,6 @@NFSERR_NOENT =2 ,/* v2 v3 v4 */ NFSERR_IO =5 ,/* v2 v3 v4 */ NFSERR_NXIO =6 ,/* v2 v3 v4 */ -NFSERR_EAGAIN =11 ,/* v2 v3 */ NFSERR_ACCES =13 ,/* v2 v3 v4 */ NFSERR_EXIST =17 ,/* v2 v3 v4 */ NFSERR_XDEV = 18, /* v3 v4 */
Greg Kroah-Hartman
maintainerPATCH 61/72 bpf: Fix an issue in bpf_prog_test_run_xdp when page size greater than 4K
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yonghong Song <[email protected]>
[ Upstream commit 4fc012daf9c074772421c904357abf586336b1ca ]
The bpf selftest xdp_adjust_tail/xdp_adjust_frags_tail_grow failed on arm64 with 64KB page:
xdp_adjust_tail/xdp_adjust_frags_tail_grow:FAIL
In bpf_prog_test_run_xdp(), the xdp->frame_sz is set to 4K, but later on when constructing frags, with 64K page size, the frag data_len could be more than 4K. This will cause problems in bpf_xdp_frags_increase_tail().
To fix the failure, the xdp->frame_sz is set to be PAGE_SIZE so kernel can test different page size properly. With the kernel change, the user space and bpf prog needs adjustment. Currently, the MAX_SKB_FRAGS default value is 17, so for 4K page, the maximum packet size will be less than 68K. To test 64K page, a bigger maximum packet size than 68K is desired. So two different functions are implemented for subtest xdp_adjust_frags_tail_grow. Depending on different page size, different data input/output sizes are used to adapt with different page size.
Stable-dep-of: e558cca21779 ("bpf, test_run: Subtract size of xdp_frame from allowed metadata size")
--- net/bpf/test_run.c | 2 +- .../bpf/prog_tests/xdp_adjust_tail.c | 96 +++++++++++++++++-- .../bpf/progs/test_xdp_adjust_tail_grow.c | 8 +- 3 files changed, 97 insertions(+), 9 deletions(-)
net/bpf/test_run.c +1 -1
@@ -1322,7 +1322,7 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, headroom -= ctx->data; } - max_data_sz =4096 - headroom - tailroom; + max_data_sz =PAGE_SIZE - headroom - tailroom;if (size > max_data_sz) {/* disallow live data mode for jumbo frames */ if (do_live)
tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c +89 -7
133 lines not on this page · raw message
tools/testing/selftests/bpf/progs/test_xdp_adjust_tail_grow.c +7 -1
@@ -13,7 +13,9 @@ int _xdp_adjust_tail_grow(struct xdp_md *xdp)/* Data length determine test case */ if (data_len ==54 ) {/* sizeof(pkt_v4) */ - offset =4096 ;/* test too large offset */ + offset =4096 ;/* test too large offset, 4k page size */ + }else if (data_len ==53 ) {/* sizeof(pkt_v4) - 1 */ + offset =65536 ;/* test too large offset, 64k page size */ }else if (data_len ==74 ) {/* sizeof(pkt_v6) */ offset =40 ; }else if (data_len ==64 ) {
@@ -25,6 +27,10 @@ int _xdp_adjust_tail_grow(struct xdp_md *xdp) offset =10 ; }else if (data_len ==9001 ) { offset =4096 ; + }else if (data_len ==90000 ) { + offset =10 ;/* test a small offset, 64k page size */ + }else if (data_len ==90001 ) { + offset =65536 ;/* test too large offset, 64k page size */ }else {return XDP_ABORTED ;/* No matching test */ }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 62/72 bpf: Make variables in bpf_prog_test_run_xdp less confusing
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amery Hung <[email protected]>
[ Upstream commit 7eb83bff02ad5e82e8c456c58717ef181c220870 ]
Change the variable naming in bpf_prog_test_run_xdp() to make the overall logic less confusing. As different modes were added to the function over the time, some variables got overloaded, making it hard to understand and changing the code becomes error-prone.
Replace "size" with "linear_sz" where it refers to the size of metadata and data. If "size" refers to input data size, use test.data_size_in directly.
Replace "max_data_sz" with "max_linear_sz" to better reflect the fact that it is the maximum size of metadata and data (i.e., linear_sz). Also, xdp_rxq.frags_size is always PAGE_SIZE, so just set it directly instead of subtracting headroom and tailroom and adding them back.
Stable-dep-of: e558cca21779 ("bpf, test_run: Subtract size of xdp_frame from allowed metadata size")
--- net/bpf/test_run.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
net/bpf/test_run.c +13 -13
@@ -1277,9 +1277,9 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, {bool do_live = (kattr->test.flags &BPF_F_TEST_XDP_LIVE_FRAMES );u32 tailroom =SKB_DATA_ALIGN (sizeof (struct skb_shared_info )); +u32 retval =0 , duration, max_linear_sz, size; +u32 linear_sz = kattr->test.data_size_in;u32 batch_size = kattr->test.batch_size; -u32 retval =0 , duration, max_data_sz; -u32 size = kattr->test.data_size_in;u32 headroom =XDP_PACKET_HEADROOM ;u32 repeat = kattr->test.repeat;struct netdev_rx_queue *rxqueue;
@@ -1313,7 +1313,7 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,if (ctx) {/* There can't be user provided data before the meta data */ -if (ctx->data_meta || ctx->data_end != size || +if (ctx->data_meta || ctx->data_end != kattr->test.data_size_in || ctx->data > ctx->data_end ||unlikely (xdp_metalen_invalid (ctx->data)) || (do_live && (kattr->test.data_out || kattr->test.ctx_out)))
@@ -1322,30 +1322,30 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, headroom -= ctx->data; } - max_data_sz =PAGE_SIZE - headroom - tailroom; -if (size > max_data_sz) { -/* disallow live data mode for jumbo frames */ -if (do_live) - goto free_ctx; - size = max_data_sz; - } + max_linear_sz =PAGE_SIZE - headroom - tailroom; + linear_sz =min_t (u32, linear_sz, max_linear_sz); + +/* disallow live data mode for jumbo frames */ +if (do_live && kattr->test.data_size_in > linear_sz) + goto free_ctx; - data =bpf_test_init (kattr, size, max_data_sz, headroom, tailroom); + data =bpf_test_init (kattr, linear_sz, max_linear_sz, headroom, tailroom);if (IS_ERR (data)) { ret =PTR_ERR (data); goto free_ctx; } rxqueue =__netif_get_rx_queue (current->nsproxy->net_ns->loopback_dev,0 ); - rxqueue->xdp_rxq.frag_size = headroom + max_data_sz + tailroom; + rxqueue->xdp_rxq.frag_size =PAGE_SIZE ;xdp_init_buff (&xdp, rxqueue->xdp_rxq.frag_size, &rxqueue->xdp_rxq); -xdp_prepare_buff (&xdp, data, headroom, size, true); +xdp_prepare_buff (&xdp, data, headroom, linear_sz, true); sinfo =xdp_get_shared_info_from_buff (&xdp); ret =xdp_convert_md_to_buff (ctx, &xdp);if (ret) goto free_data; + size = linear_sz;if (unlikely (kattr->test.data_size_in > size)) {void __user *data_in =u64_to_user_ptr (kattr->test.data_in);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 63/72 bpf: Support specifying linear xdp packet data size for BPF_PROG_TEST_RUN
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amery Hung <[email protected]>
[ Upstream commit fe9544ed1a2e9217b2c5285c3a4ac0dc5a38bd7b ]
To test bpf_xdp_pull_data(), an xdp packet containing fragments as well as free linear data area after xdp->data_end needs to be created. However, bpf_prog_test_run_xdp() always fills the linear area with data_in before creating fragments, leaving no space to pull data. This patch will allow users to specify the linear data size through ctx->data_end.
Currently, ctx_in->data_end must match data_size_in and will not be the final ctx->data_end seen by xdp programs. This is because ctx->data_end is populated according to the xdp_buff passed to test_run. The linear data area available in an xdp_buff, max_linear_sz, is alawys filled up before copying data_in into fragments.
This patch will allow users to specify the size of data that goes into the linear area. When ctx_in->data_end is different from data_size_in, only ctx_in->data_end bytes of data will be put into the linear area when creating the xdp_buff.
While ctx_in->data_end will be allowed to be different from data_size_in, it cannot be larger than the data_size_in as there will be no data to copy from user space. If it is larger than the maximum linear data area size, the layout suggested by the user will not be honored. Data beyond max_linear_sz bytes will still be copied into fragments.
Finally, since it is possible for a NIC to produce a xdp_buff with empty linear data area, allow it when calling bpf_test_init() from bpf_prog_test_run_xdp() so that we can test XDP kfuncs with such xdp_buff. This is done by moving lower-bound check to callers as most of them already do except bpf_prog_test_run_skb(). The change also fixes a bug that allows passing an xdp_buff with data < ETH_HLEN. This can happen when ctx is used and metadata is at least ETH_HLEN.
Stable-dep-of: e558cca21779 ("bpf, test_run: Subtract size of xdp_frame from allowed metadata size")
--- net/bpf/test_run.c | 15 ++++++++++++--- .../bpf/prog_tests/xdp_context_test_run.c | 4 +--- 2 files changed, 13 insertions(+), 6 deletions(-)
net/bpf/test_run.c +12 -3
@@ -768,7 +768,7 @@ static void *bpf_test_init(const union bpf_attr *kattr, u32 user_size,void __user *data_in =u64_to_user_ptr (kattr->test.data_in);void *data; -if (user_size <ETH_HLEN || user_size >PAGE_SIZE - headroom - tailroom) +if (user_size >PAGE_SIZE - headroom - tailroom)return ERR_PTR (-EINVAL ); size =SKB_DATA_ALIGN (size);
@@ -1097,6 +1097,9 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,if (kattr->test.flags || kattr->test.cpu || kattr->test.batch_size)return -EINVAL ; +if (size <ETH_HLEN ) +return -EINVAL ; + data =bpf_test_init (kattr, kattr->test.data_size_in, size,NET_SKB_PAD +NET_IP_ALIGN ,SKB_DATA_ALIGN (sizeof (struct skb_shared_info )));
@@ -1277,7 +1280,7 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, {bool do_live = (kattr->test.flags &BPF_F_TEST_XDP_LIVE_FRAMES );u32 tailroom =SKB_DATA_ALIGN (sizeof (struct skb_shared_info )); -u32 retval =0 , duration, max_linear_sz, size; +u32 retval =0 , meta_sz =0 , duration, max_linear_sz, size;u32 linear_sz = kattr->test.data_size_in;u32 batch_size = kattr->test.batch_size;u32 headroom =XDP_PACKET_HEADROOM ;
@@ -1313,13 +1316,16 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,if (ctx) {/* There can't be user provided data before the meta data */ -if (ctx->data_meta || ctx->data_end != kattr->test.data_size_in || +if (ctx->data_meta || ctx->data_end > kattr->test.data_size_in || ctx->data > ctx->data_end ||unlikely (xdp_metalen_invalid (ctx->data)) || (do_live && (kattr->test.data_out || kattr->test.ctx_out))) goto free_ctx;/* Meta data is allocated from the headroom */ headroom -= ctx->data; + + meta_sz = ctx->data; + linear_sz = ctx->data_end; } max_linear_sz =PAGE_SIZE - headroom - tailroom;
@@ -1329,6 +1335,9 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,if (do_live && kattr->test.data_size_in > linear_sz) goto free_ctx; +if (kattr->test.data_size_in - meta_sz <ETH_HLEN ) +return -EINVAL ; + data =bpf_test_init (kattr, linear_sz, max_linear_sz, headroom, tailroom);if (IS_ERR (data)) { ret =PTR_ERR (data);
tools/testing/selftests/bpf/prog_tests/xdp_context_test_run.c +1 -3
@@ -80,9 +80,7 @@ void test_xdp_context_test_run(void)/* Meta data must be 32 bytes or smaller */ test_xdp_context_error (prog_fd, opts,0 ,36 ,sizeof (data),0 ,0 ,0 ); -/* Total size of data must match data_end - data_meta */ -test_xdp_context_error (prog_fd, opts,0 ,sizeof (__u32), -sizeof (data) -1 ,0 ,0 ,0 ); +/* Total size of data must be data_end - data_meta or larger */ test_xdp_context_error (prog_fd, opts,0 ,sizeof (__u32),sizeof (data) +1 ,0 ,0 ,0 );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 64/72 bpf, test_run: Subtract size of xdp_frame from allowed metadata size
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit e558cca217790286e799a8baacd1610bda31b261 ]
The xdp_frame structure takes up part of the XDP frame headroom, limiting the size of the metadata. However, in bpf_test_run, we don't take this into account, which makes it possible for userspace to supply a metadata size that is too large (taking up the entire headroom).
If userspace supplies such a large metadata size in live packet mode, the xdp_update_frame_from_buff() call in xdp_test_run_init_page() call will fail, after which packet transmission proceeds with an uninitialised frame structure, leading to the usual Bad Stuff.
The commit in the Fixes tag fixed a related bug where the second check in xdp_update_frame_from_buff() could fail, but did not add any additional constraints on the metadata size. Complete the fix by adding an additional check on the metadata size. Reorder the checks slightly to make the logic clearer and add a comment.
--- net/bpf/test_run.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
net/bpf/test_run.c +13 -5
@@ -1304,8 +1304,6 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, batch_size =NAPI_POLL_WEIGHT ; else if (batch_size > TEST_XDP_MAX_BATCH) return -E2BIG; - - headroom +=sizeof (struct xdp_page_head ); }else if (batch_size) {return -EINVAL ; }
@@ -1318,16 +1316,26 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,/* There can't be user provided data before the meta data */ if (ctx->data_meta || ctx->data_end > kattr->test.data_size_in || ctx->data > ctx->data_end || -unlikely (xdp_metalen_invalid (ctx->data)) || (do_live && (kattr->test.data_out || kattr->test.ctx_out))) goto free_ctx; -/* Meta data is allocated from the headroom */ - headroom -= ctx->data; meta_sz = ctx->data; +if (xdp_metalen_invalid (meta_sz) || meta_sz > headroom -sizeof (struct xdp_frame )) + goto free_ctx; + +/* Meta data is allocated from the headroom */ + headroom -= meta_sz; linear_sz = ctx->data_end; } +/* The xdp_page_head structure takes up space in each page, limiting the +* size of the packet data; add the extra size to headroom here to make +* sure it's accounted in the length checks below, but not in the +* metadata size check above. +*/ +if (do_live) + headroom +=sizeof (struct xdp_page_head ); + max_linear_sz =PAGE_SIZE - headroom - tailroom; linear_sz =min_t (u32, linear_sz, max_linear_sz);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 65/72 bpf: Fix reference count leak in bpf_prog_test_run_xdp()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit ec69daabe45256f98ac86c651b8ad1b2574489a7 ]
syzbot is reporting
unregister_netdevice: waiting for sit0 to become free. Usage count = 2
problem. A debug printk() patch found that a refcount is obtained at xdp_convert_md_to_buff() from bpf_prog_test_run_xdp().
According to commit ec94670fcb3b ("bpf: Support specifying ingress via xdp_md context in BPF_PROG_TEST_RUN"), the refcount obtained by xdp_convert_md_to_buff() will be released by xdp_convert_buff_to_md().
Therefore, we can consider that the error handling path introduced by commit 1c1949982524 ("bpf: introduce frags support to bpf_prog_test_run_xdp()") forgot to call xdp_convert_buff_to_md().
--- net/bpf/test_run.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/bpf/test_run.c +4 -3
@@ -1373,13 +1373,13 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,if (sinfo->nr_frags ==MAX_SKB_FRAGS ) { ret = -ENOMEM ; - goto out; + goto out_put_dev; } page =alloc_page (GFP_KERNEL );if (!page) { ret = -ENOMEM ; - goto out; + goto out_put_dev; } frag = &sinfo->frags[sinfo->nr_frags++];
@@ -1392,7 +1392,7 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,if (copy_from_user (page_address (page), data_in + size, data_len)) { ret = -EFAULT ; - goto out; + goto out_put_dev; } sinfo->xdp_frags_size += data_len; size += data_len;
@@ -1407,6 +1407,7 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, ret =bpf_test_run_xdp_live (prog, &xdp, repeat, batch_size, &duration); else ret =bpf_test_run (prog, &xdp, repeat, &retval, &duration, true); +out_put_dev:/* We convert the xdp_buff back to an xdp_md before checking the return * code so the reference count of any held netdevice will be decremented * even if the test run failed.
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 66/72 powercap: fix race condition in register_control_type()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sumeet Pawnikar <[email protected]>
[ Upstream commit 7bda1910c4bccd4b8d4726620bb3d6bbfb62286e ]
The device becomes visible to userspace via device_register() even before it fully initialized by idr_init(). If userspace or another thread tries to register a zone immediately after device_register(), the control_type_valid() will fail because the control_type is not yet in the list. The IDR is not yet initialized, so this race condition causes zone registration failure.
Move idr_init() and list addition before device_register() fix the race condition.
--- drivers/powercap/powercap_sys.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/powercap/powercap_sys.c +11 -5
@@ -624,17 +624,23 @@ struct powercap_control_type *powercap_register_control_type(INIT_LIST_HEAD (&control_type->node); control_type->dev.class = &powercap_class;dev_set_name (&control_type->dev,"%s" , name); - result =device_register (&control_type->dev); -if (result) { -put_device (&control_type->dev); -return ERR_PTR (result); - }idr_init (&control_type->idr);mutex_lock (&powercap_cntrl_list_lock);list_add_tail (&control_type->node, &powercap_cntrl_list);mutex_unlock (&powercap_cntrl_list_lock); + result =device_register (&control_type->dev); +if (result) { +mutex_lock (&powercap_cntrl_list_lock); +list_del (&control_type->node); +mutex_unlock (&powercap_cntrl_list_lock); + +idr_destroy (&control_type->idr); +put_device (&control_type->dev); +return ERR_PTR (result); + } +return control_type; }EXPORT_SYMBOL_GPL (powercap_register_control_type);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 67/72 powercap: fix sscanf() error return value handling
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sumeet Pawnikar <[email protected]>
[ Upstream commit efc4c35b741af973de90f6826bf35d3b3ac36bf1 ]
Fix inconsistent error handling for sscanf() return value check.
Implicit boolean conversion is used instead of explicit return value checks. The code checks if (!sscanf(...)) which is incorrect because:
1. sscanf returns the number of successfully parsed items
2. On success, it returns 1 (one item passed)
3. On failure, it returns 0 or EOF
4. The check 'if (!sscanf(...))' is wrong because it treats success (1) as failure
All occurrences of sscanf() now uses explicit return value check. With this behavior it returns '-EINVAL' when parsing fails (returns 0 or EOF), and continues when parsing succeeds (returns 1).
--- drivers/powercap/powercap_sys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/powercap/powercap_sys.c +3 -3
@@ -67,7 +67,7 @@ static ssize_t show_constraint_##_attr(struct device *dev, \int id; \struct powercap_zone_constraint *pconst;\ \ -if (!sscanf (dev_attr->attr.name,"constraint_%d_" , &id)) \ +if (sscanf (dev_attr->attr.name,"constraint_%d_" , &id) !=1 ) \return -EINVAL ; \if (id >= power_zone->const_id_cnt) \return -EINVAL ; \
@@ -92,7 +92,7 @@ static ssize_t store_constraint_##_attr(struct device *dev,\int id; \struct powercap_zone_constraint *pconst;\ \ -if (!sscanf (dev_attr->attr.name,"constraint_%d_" , &id)) \ +if (sscanf (dev_attr->attr.name,"constraint_%d_" , &id) !=1 ) \return -EINVAL ; \if (id >= power_zone->const_id_cnt) \return -EINVAL ; \
@@ -161,7 +161,7 @@ static ssize_t show_constraint_name(struct device *dev,ssize_t len = -ENODATA ;struct powercap_zone_constraint *pconst; -if (!sscanf (dev_attr->attr.name,"constraint_%d_" , &id)) +if (sscanf (dev_attr->attr.name,"constraint_%d_" , &id) !=1 )return -EINVAL ;if (id >= power_zone->const_id_cnt)return -EINVAL ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 68/72 can: j1939: make j1939_session_activate() fail if device is no longer registered
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 5d5602236f5db19e8b337a2cd87a90ace5ea776d ]
syzbot is still reporting
unregister_netdevice: waiting for vcan0 to become free. Usage count = 2
even after commit 93a27b5891b8 ("can: j1939: add missing calls in NETDEV_UNREGISTER notification handler") was added. A debug printk() patch found that j1939_session_activate() can succeed even after j1939_cancel_active_session() from j1939_netdev_notify(NETDEV_UNREGISTER) has completed.
Since j1939_cancel_active_session() is processed with the session list lock held, checking ndev->reg_state in j1939_session_activate() with the session list lock held can reliably close the race window.
--- net/can/j1939/transport.c | 2 ++ 1 file changed, 2 insertions(+)
net/can/j1939/transport.c +2 -0
@@ -1571,6 +1571,8 @@ int j1939_session_activate(struct j1939_session *session)if (active) {j1939_session_put (active); ret = -EAGAIN ; + }else if (priv->ndev->reg_state !=NETREG_REGISTERED ) { + ret = -ENODEV ; }else {WARN_ON_ONCE (session->state !=J1939_SESSION_NEW ); list_add_tail(&session->active_session_list_entry,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 69/72 ASoC: amd: yc: Add quirk for Honor MagicBook X16 2025
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Elantsev <[email protected]>
[ Upstream commit e2cb8ef0372665854fca6fa7b30b20dd35acffeb ]
Add a DMI quirk for the Honor MagicBook X16 2025 laptop fixing the issue where the internal microphone was not detected.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -521,6 +521,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7UCX"), } }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HONOR"), + DMI_MATCH(DMI_PRODUCT_NAME, "GOH-X"), + } + }, {} };
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 70/72 ASoC: fsl_sai: Add missing registers to cache default
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit 90ed688792a6b7012b3e8a2f858bc3fe7454d0eb ]
Drivers does cache sync during runtime resume, setting all writable registers. Not all writable registers are set in cache default, resulting in the erorr message:
fsl-sai 30c30000.sai: using zero-initialized flat cache, this may cause unexpected behavior
Fix this by adding missing writable register defaults.
--- sound/soc/fsl/fsl_sai.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/fsl/fsl_sai.c +3 -0
@@ -979,6 +979,7 @@ static struct reg_default fsl_sai_reg_defaults_ofs0[] = { {FSL_SAI_TDR6, 0}, {FSL_SAI_TDR7, 0}, {FSL_SAI_TMR, 0}, + {FSL_SAI_TTCTL, 0}, {FSL_SAI_RCR1(0), 0}, {FSL_SAI_RCR2(0), 0}, {FSL_SAI_RCR3(0), 0},
@@ -1002,12 +1003,14 @@ static struct reg_default fsl_sai_reg_defaults_ofs8[] = { {FSL_SAI_TDR6, 0}, {FSL_SAI_TDR7, 0}, {FSL_SAI_TMR, 0}, + {FSL_SAI_TTCTL, 0}, {FSL_SAI_RCR1(8), 0}, {FSL_SAI_RCR2(8), 0}, {FSL_SAI_RCR3(8), 0}, {FSL_SAI_RCR4(8), 0}, {FSL_SAI_RCR5(8), 0}, {FSL_SAI_RMR, 0}, + {FSL_SAI_RTCTL, 0}, {FSL_SAI_MCTL, 0}, {FSL_SAI_MDIV, 0}, };
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 71/72 scsi: sg: Fix occasional bogus elapsed time that exceeds timeout
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Rábek <[email protected]>
[ Upstream commit 0e1677654259a2f3ccf728de1edde922a3c4ba57 ]
A race condition was found in sg_proc_debug_helper(). It was observed on a system using an IBM LTO-9 SAS Tape Drive (ULTRIUM-TD9) and monitoring /proc/scsi/sg/debug every second. A very large elapsed time would sometimes appear. This is caused by two race conditions.
We reproduced the issue with an IBM ULTRIUM-HH9 tape drive on an x86_64 architecture. A patched kernel was built, and the race condition could not be observed anymore after the application of this patch. A reproducer C program utilising the scsi_debug module was also built by Changhui Zhong and can be viewed here:
https://github.com/MichaelRabek/linux-tests/blob/master/drivers/scsi/sg/sg_race_trigger.c
The first race happens between the reading of hp->duration in sg_proc_debug_helper() and request completion in sg_rq_end_io(). The hp->duration member variable may hold either of two types of information:
#1 - The start time of the request. This value is present while
the request is not yet finished.
#2 - The total execution time of the request (end_time - start_time).
If sg_proc_debug_helper() executes *after* the value of hp->duration was changed from #1 to #2, but *before* srp->done is set to 1 in sg_rq_end_io(), a fresh timestamp is taken in the else branch, and the elapsed time (value type #2) is subtracted from a timestamp, which cannot yield a valid elapsed time (which is a type #2 value as well).
To fix this issue, the value of hp->duration must change under the protection of the sfp->rq_list_lock in sg_rq_end_io(). Since sg_proc_debug_helper() takes this read lock, the change to srp->done and srp->header.duration will happen atomically from the perspective of sg_proc_debug_helper() and the race condition is thus eliminated.
The second race condition happens between sg_proc_debug_helper() and sg_new_write(). Even though hp->duration is set to the current time stamp in sg_add_request() under the write lock's protection, it gets overwritten by a call to get_sg_io_hdr(), which calls copy_from_user() to copy struct sg_io_hdr from userspace into kernel space. hp->duration is set to the start time again in sg_common_write(). If sg_proc_debug_helper() is called between these two calls, an arbitrary value set by userspace (usually zero) is used to compute the elapsed time.
To fix this issue, hp->duration must be set to the current timestamp again after get_sg_io_hdr() returns successfully. A small race window still exists between get_sg_io_hdr() and setting hp->duration, but this window is only a few instructions wide and does not result in observable issues in practice, as confirmed by testing.
Additionally, we fix the format specifier from %d to %u for printing unsigned int values in sg_proc_debug_helper().
--- drivers/scsi/sg.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
drivers/scsi/sg.c +13 -7
@@ -735,6 +735,8 @@ sg_new_write(Sg_fd *sfp, struct file *file, const char __user *buf,sg_remove_request (sfp, srp);return -EFAULT ; } + hp->duration =jiffies_to_msecs (jiffies); +if (hp->interface_id !='S' ) {sg_remove_request (sfp, srp);return -ENOSYS ;
@@ -819,7 +821,6 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,return -ENODEV ; } - hp->duration =jiffies_to_msecs (jiffies);if (hp->interface_id !='\0' &&/* v3 (or later) interface */ (SG_FLAG_Q_AT_TAIL & hp->flags)) at_head =0 ;
@@ -1342,9 +1343,6 @@ sg_rq_end_io(struct request *rq, blk_status_t status)"sg_cmd_done: pack_id=%d, res=0x%x\n" , srp->header.pack_id, result)); srp->header.resid = resid; - ms =jiffies_to_msecs (jiffies); - srp->header.duration = (ms > srp->header.duration) ? - (ms - srp->header.duration) :0 ;if (0 != result) {struct scsi_sense_hdr sshdr;
@@ -1393,6 +1391,9 @@ sg_rq_end_io(struct request *rq, blk_status_t status) done =0 ; } srp->done = done; + ms =jiffies_to_msecs (jiffies); + srp->header.duration = (ms > srp->header.duration) ? + (ms - srp->header.duration) :0 ;write_unlock_irqrestore (&sfp->rq_list_lock, iflags);if (likely (done)) {
@@ -2529,6 +2530,7 @@ static void sg_proc_debug_helper(struct seq_file *s, Sg_device * sdp)const sg_io_hdr_t *hp;const char * cp;unsigned int ms; +unsigned int duration; k =0 ;list_for_each_entry (fp, &sdp->sfds, sfd_siblings) {
@@ -2566,13 +2568,17 @@ static void sg_proc_debug_helper(struct seq_file *s, Sg_device * sdp)seq_printf (s," id=%d blen=%d" , srp->header.pack_id, blen);if (srp->done) -seq_printf (s," dur=%d" , hp->duration); +seq_printf (s," dur=%u" , hp->duration);else { ms =jiffies_to_msecs (jiffies); -seq_printf (s," t_o/elap=%d/%d" , + duration =READ_ONCE (hp->duration); +if (duration) + duration = (ms > duration ? + ms - duration :0 ); +seq_printf (s," t_o/elap=%u/%u" , (new_interface ? hp->timeout :jiffies_to_msecs (fp->timeout)), - (ms > hp->duration ? ms - hp->duration :0 )); + duration); }seq_printf (s,"ms sgat=%d op=0x%02x\n" , usg, (int ) srp->data.cmd_opcode);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 72/72 bpf: test_run: Fix ctx leak in bpf_prog_test_run_xdp error path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shardul Bankar <[email protected]>
commit 7f9ee5fc97e14682e36fe22ae2654c07e4998b82 upstream.
Fix a memory leak in bpf_prog_test_run_xdp() where the context buffer allocated by bpf_ctx_init() is not freed when the function returns early due to a data size check.
On the failing path:
ctx = bpf_ctx_init(...);
if (kattr->test.data_size_in - meta_sz < ETH_HLEN)
return -EINVAL;
The early return bypasses the cleanup label that kfree()s ctx, leading to a leak detectable by kmemleak under fuzzing. Change the return to jump to the existing free_ctx label.
--- net/bpf/test_run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bpf/test_run.c +1 -1
@@ -1344,7 +1344,7 @@ int bpf_prog_test_run_xdp(struct bpf_pro goto free_ctx;if (kattr->test.data_size_in - meta_sz <ETH_HLEN ) -return -EINVAL ; + goto free_ctx; data =bpf_test_init (kattr, linear_sz, max_linear_sz, headroom, tailroom);if (IS_ERR (data)) {
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.1.161-rc1-00073-g9f1df8edf447 #1 SMP PREEMPT_DYNAMIC Thu Jan 15 18:29:29 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 17 Jan 2026 16:41:26 +0000. Anything received after that time might be too late.
6.1.161-rc1 built and run on my x86_64 test system (AMD Ryzen 9 9900X, System76 thelio-mira-r4-n3). No errors or regressions.
Thanks,
Slade
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 17 Jan 2026 16:41:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Compiled and tested on
- Verdin iMX8MM
- Verdin iMX8MP
- Colibri iMX6
- Colibri iMX6ULL
- Colibri iMX7
- Apalis iMX6
Am 15.01.2026 um 17:48 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 17 Jan 2026 16:41:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 17 Jan 2026 16:41:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.1:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
119 tests: 119 pass, 0 failLinux version: 6.1.161-rc1-g9f1df8edf447
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
The kernel, bpf tool, perf tool, and kselftest builds fine for v6.1.161-rc1 on x86 and arm64 Azure VM.
Thanks,
Hardik
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 17 Jan 2026 16:41:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 8 lines · On Thu, 15 Jan 2026 17:48:10 +0100 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.1.161 release. There are 72 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 17 Jan 2026 16:41:26 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64:
Thanks!
Cheers,
Miguel
hello
Compiled and booted 6.1.161-rc1+
warnings related found in dmesg. file attached.
As per dmidecode command.
Version: AMD Ryzen 3 3250U with Radeon Graphics
Processor Information
Socket Designation: FP5
Type: Central Processor
Family: Zen
Manufacturer: Advanced Micro Devices, Inc.
ID: 81 0F 81 00 FF FB 8B 17
Signature: Family 23, Model 24, Stepping 1
--
software engineer
rajagiri school of engineering and technology
[ 0.224732] VMSCAPE: SMT on, STIBP is required for full protection. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/vmscape.html for more details. [ 0.224836] #2 #3 [ 1.137862] i8042: PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp [ 11.490631] amdgpu 0000:04:00.0: amdgpu: PSP runtime database doesn't exist [ 11.490638] amdgpu 0000:04:00.0: amdgpu: PSP runtime database doesn't exist [ 11.562569] amdgpu 0000:04:00.0: amdgpu: failed to load ucode RLC_RESTORE_LIST_CNTL(0x28) [ 11.562573] amdgpu 0000:04:00.0: amdgpu: psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF300F) [ 11.563311] amdgpu 0000:04:00.0: amdgpu: failed to load ucode RLC_RESTORE_LIST_GPM_MEM(0x29) [ 11.563314] amdgpu 0000:04:00.0: amdgpu: psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF000F) [ 11.564258] amdgpu 0000:04:00.0: amdgpu: failed to load ucode RLC_RESTORE_LIST_SRM_MEM(0x2A) [ 11.564261] amdgpu 0000:04:00.0: amdgpu: psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF000F) [ 15.434086] systemd-sysv-generator[324]: SysV service '/etc/init.d/lpd' lacks a native systemd unit file, automatically generating a unit file for compatibility. [ 15.434091] systemd-sysv-generator[324]: Please update package to include a native systemd unit file. [ 15.434095] systemd-sysv-generator[324]: ! This compatibility logic is deprecated, expect removal soon. ! [ 15.435931] systemd-sysv-generator[324]: SysV service '/etc/init.d/lightdm' lacks a native systemd unit file, automatically generating a unit file for compatibility. [ 15.435934] systemd-sysv-generator[324]: Please update package to include a native systemd unit file. [ 15.435937] systemd-sysv-generator[324]: ! This compatibility logic is deprecated, expect removal soon. ! [ 15.442186] systemd-sysv-generator[324]: SysV service '/etc/init.d/fetchmail' lacks a native systemd unit file, automatically generating a unit file for compatibility. [ 15.442191] systemd-sysv-generator[324]: Please update package to include a native systemd unit file. [ 15.442194] systemd-sysv-generator[324]: ! This compatibility logic is deprecated, expect removal soon. ! [ 24.271517] kauditd_printk_skb: 126 callbacks suppressed [ 46.535261] ------------[ cut here ]------------ [ 46.535266] amdgpu 0000:04:00.0: drm_WARN_ON(!dev->mode_config.poll_enabled) [ 46.535360] WARNING: CPU: 1 PID: 2261 at drivers/gpu/drm/drm_probe_helper.c:838 drm_kms_helper_poll_disable+0x55/0x60 [drm_kms_helper] [ 46.535390] Modules linked in: ccm xt_conntrack nft_chain_nat rtw88_8822ce rtw88_8822c xt_MASQUERADE nf_nat rtw88_pci nf_conntrack rtw88_core uhid rfcomm cmac nf_defrag_ipv6 algif_hash algif_skcipher nf_defrag_ipv4 mac80211 af_alg bridge bnep snd_sof_amd_rembrandt stp llc snd_sof_pci xfrm_user snd_sof_amd_acp xfrm_algo snd_sof btusb btrtl xt_addrtype btbcm nft_compat x_tables btintel nf_tables btmtk snd_sof_utils uvcvideo snd_soc_core bluetooth intel_rapl_msr intel_rapl_common kvm_amd videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common snd_hda_codec_generic kvm snd_hda_codec_hdmi snd_seq_dummy snd_hrtimer snd_hda_intel snd_seq videodev snd_seq_device snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pci_ps snd_rpl_pci_acp6x snd_acp_pci overlay qrtr snd_pci_acp6x libarc4 snd_pcm_oss cfg80211 irqbypass snd_mixer_oss ghash_clmulni_intel snd_pcm aesni_intel mc crypto_simd hp_wmi cryptd snd_pci_acp5x binfmt_misc rapl sparse_keymap pcspkr wmi_bmof platform_profile [ 46.535508] snd_rn_pci_acp3x snd_timer snd_acp_config snd ccp nls_ascii snd_soc_acpi nls_cp437 vfat k10temp fat snd_pci_acp3x rfkill soundcore battery ac acpi_tad button acpi_cpufreq joydev evdev msr i2c_dev parport_pc ppdev lp configfs parport efi_pstore nfnetlink autofs4 ext4 crc16 mbcache jbd2 raid10 raid456 libcrc32c crc32c_generic async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 md_mod amdgpu drm_ttm_helper ttm iommu_v2 gpu_sched i2c_algo_bit drm_buddy drm_display_helper drm_kms_helper xhci_pci xhci_hcd drm usbcore nvme hid_multitouch hid_generic nvme_core i2c_hid_acpi sp5100_tco usb_common t10_pi i2c_hid serio_raw hid watchdog video crc64_rocksoft wmi i2c_piix4 efivarfs [ 46.535616] CPU: 1 PID: 2261 Comm: kworker/u32:9 Not tainted 6.1.161-rc1+ #39 [ 46.535622] Hardware name: HP HP Laptop 15s-ey1xxx/8706, BIOS F.61 03/25/2022 [ 46.535625] Workqueue: events_unbound async_run_entry_fn [ 46.535634] RIP: 0010:drm_kms_helper_poll_disable+0x55/0x60 [drm_kms_helper] [ 46.535652] Code: 85 d2 75 03 48 8b 17 48 89 14 24 e8 f5 33 6d e7 48 8b 14 24 48 c7 c1 58 fd 70 c0 48 c7 c7 76 11 71 c0 48 89 c6 e8 fb 72 fb e6 <0f> 0b 48 83 c4 08 e9 40 5e d0 e7 f3 0f 1e fa 0f 1f 44 00 00 55 53 [ 46.535655] RSP: 0018:ffffd3e7c8313d90 EFLAGS: 00010246 [ 46.535659] RAX: 0000000000000000 RBX: ffff8c8430c20010 RCX: 0000000000000027 [ 46.535662] RDX: ffff8c8498a613e8 RSI: 0000000000000001 RDI: ffff8c8498a613e0 [ 46.535664] RBP: ffff8c8430c20000 R08: 0000000000000001 R09: ffffd3e7c8313c50 [ 46.535666] R10: ffffffffa90811e0 R11: 00000000fffff40c R12: 0000000000000001 [ 46.535668] R13: 0000000000000002 R14: 0000000000000000 R15: ffff8c843464d5c8 [ 46.535671] FS: 0000000000000000(0000) GS:ffff8c8498a40000(0000) knlGS:0000000000000000 [ 46.535674] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 46.535676] CR2: 00007f410b041010 CR3: 000000011113e000 CR4: 00000000003506e0 [ 46.535680] Call Trace: [ 46.535685] <TASK> [ 46.535692] amdgpu_device_suspend+0x51/0x130 [amdgpu] [ 46.535941] pci_pm_suspend+0x80/0x170 [ 46.535949] ? pci_pm_freeze+0xe0/0xe0 [ 46.535953] dpm_run_callback+0x4a/0x150 [ 46.535962] __device_suspend+0x106/0x490 [ 46.535968] async_suspend+0x21/0xe0 [ 46.535972] ? srso_return_thunk+0x5/0x10 [ 46.535978] ? srso_return_thunk+0x5/0x10 [ 46.535982] async_run_entry_fn+0x34/0x130 [ 46.535987] process_one_work+0x1cf/0x3a0 [ 46.535995] ? process_one_work+0x3a0/0x3a0 [ 46.535999] worker_thread+0x50/0x390 [ 46.536006] ? process_one_work+0x3a0/0x3a0 [ 46.536010] kthread+0xde/0x110 [ 46.536015] ? kthread_complete_and_exit+0x20/0x20 [ 46.536021] ret_from_fork+0x22/0x30 [ 46.536034] </TASK> [ 46.536036] ---[ end trace 0000000000000000 ]--- [ 47.649833] amdgpu 0000:04:00.0: amdgpu: failed to load ucode RLC_RESTORE_LIST_CNTL(0x28) [ 47.649838] amdgpu 0000:04:00.0: amdgpu: psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF300F) [ 47.650376] amdgpu 0000:04:00.0: amdgpu: failed to load ucode RLC_RESTORE_LIST_GPM_MEM(0x29) [ 47.650379] amdgpu 0000:04:00.0: amdgpu: psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF000F) [ 47.650919] amdgpu 0000:04:00.0: amdgpu: failed to load ucode RLC_RESTORE_LIST_SRM_MEM(0x2A) [ 47.650922] amdgpu 0000:04:00.0: amdgpu: psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF000F) [ 47.712103] ------------[ cut here ]------------ [ 47.712106] amdgpu 0000:04:00.0: drm_WARN_ON_ONCE(!dev->mode_config.poll_enabled) [ 47.712209] WARNING: CPU: 1 PID: 9 at drivers/gpu/drm/drm_probe_helper.c:252 drm_kms_helper_poll_enable+0x114/0x120 [drm_kms_helper] [ 47.712237] Modules linked in: ccm xt_conntrack nft_chain_nat rtw88_8822ce rtw88_8822c xt_MASQUERADE nf_nat rtw88_pci nf_conntrack rtw88_core uhid rfcomm cmac nf_defrag_ipv6 algif_hash algif_skcipher nf_defrag_ipv4 mac80211 af_alg bridge bnep snd_sof_amd_rembrandt stp llc snd_sof_pci xfrm_user snd_sof_amd_acp xfrm_algo snd_sof btusb btrtl xt_addrtype btbcm nft_compat x_tables btintel nf_tables btmtk snd_sof_utils uvcvideo snd_soc_core bluetooth intel_rapl_msr intel_rapl_common kvm_amd videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common snd_hda_codec_generic kvm snd_hda_codec_hdmi snd_seq_dummy snd_hrtimer snd_hda_intel snd_seq videodev snd_seq_device snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pci_ps snd_rpl_pci_acp6x snd_acp_pci overlay qrtr snd_pci_acp6x libarc4 snd_pcm_oss cfg80211 irqbypass snd_mixer_oss ghash_clmulni_intel snd_pcm aesni_intel mc crypto_simd hp_wmi cryptd snd_pci_acp5x binfmt_misc rapl sparse_keymap pcspkr wmi_bmof platform_profile [ 47.712349] snd_rn_pci_acp3x snd_timer snd_acp_config snd ccp nls_ascii snd_soc_acpi nls_cp437 vfat k10temp fat snd_pci_acp3x rfkill soundcore battery ac acpi_tad button acpi_cpufreq joydev evdev msr i2c_dev parport_pc ppdev lp configfs parport efi_pstore nfnetlink autofs4 ext4 crc16 mbcache jbd2 raid10 raid456 libcrc32c crc32c_generic async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 md_mod amdgpu drm_ttm_helper ttm iommu_v2 gpu_sched i2c_algo_bit drm_buddy drm_display_helper drm_kms_helper xhci_pci xhci_hcd drm usbcore nvme hid_multitouch hid_generic nvme_core i2c_hid_acpi sp5100_tco usb_common t10_pi i2c_hid serio_raw hid watchdog video crc64_rocksoft wmi i2c_piix4 efivarfs [ 47.712452] CPU: 1 PID: 9 Comm: kworker/u32:0 Tainted: G W 6.1.161-rc1+ #39 [ 47.712456] Hardware name: HP HP Laptop 15s-ey1xxx/8706, BIOS F.61 03/25/2022 [ 47.712460] Workqueue: events_unbound async_run_entry_fn [ 47.712468] RIP: 0010:drm_kms_helper_poll_enable+0x114/0x120 [drm_kms_helper] [ 47.712485] Code: 48 8b 5f 50 48 85 db 75 03 48 8b 1f e8 d5 32 6d e7 48 c7 c1 88 fd 70 c0 48 89 da 48 c7 c7 76 11 71 c0 48 89 c6 e8 dc 71 fb e6 <0f> 0b e9 37 ff ff ff e8 30 37 a6 e7 f3 0f 1e fa 0f 1f 44 00 00 48 [ 47.712488] RSP: 0018:ffffd3e7c011fd78 EFLAGS: 00010246 [ 47.712492] RAX: 0000000000000000 RBX: ffff8c84010ca100 RCX: 0000000000000027 [ 47.712494] RDX: ffff8c8498a613e8 RSI: 0000000000000001 RDI: ffff8c8498a613e0 [ 47.712497] RBP: ffff8c8430c20010 R08: 0000000000000001 R09: ffffd3e7c011fc38 [ 47.712499] R10: ffffffffa90811e0 R11: 00000000fffff473 R12: ffffffffa89276f7 [ 47.712501] R13: 0000000000000010 R14: 0000000000000001 R15: ffff8c8422c3b088 [ 47.712503] FS: 0000000000000000(0000) GS:ffff8c8498a40000(0000) knlGS:0000000000000000 [ 47.712506] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 47.712509] CR2: 0000000000000000 CR3: 0000000093210000 CR4: 00000000003506e0 [ 47.712511] Call Trace: [ 47.712515] <TASK> [ 47.712523] amdgpu_device_resume+0x124/0x320 [amdgpu] [ 47.712809] amdgpu_pmops_resume+0x46/0x80 [amdgpu] [ 47.713008] ? pci_legacy_resume+0x80/0x80 [ 47.713015] dpm_run_callback+0x4a/0x150 [ 47.713024] __device_resume+0xb0/0x2c0 [ 47.713027] ? srso_return_thunk+0x5/0x10 [ 47.713034] ? try_to_wake_up+0x61/0x650 [ 47.713040] async_resume+0x21/0x30 [ 47.713044] async_run_entry_fn+0x34/0x130 [ 47.713049] process_one_work+0x1cf/0x3a0 [ 47.713057] ? process_one_work+0x3a0/0x3a0 [ 47.713060] worker_thread+0x50/0x390 [ 47.713066] ? process_one_work+0x3a0/0x3a0 [ 47.713069] kthread+0xde/0x110 [ 47.713073] ? kthread_complete_and_exit+0x20/0x20 [ 47.713078] ret_from_fork+0x22/0x30 [ 47.713091] </TASK> [ 47.713092] ---[ end trace 0000000000000000 ]--- [ 49.138525] done.