linux-next/drivers/net
Eric Dumazet a126061c80 ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple()
Jakub added a lockdep_assert_no_hardirq() check in __page_pool_put_page()
to increase test coverage.

syzbot found a splat caused by hard irq blocking in
ptr_ring_resize_multiple() [1]

As current users of ptr_ring_resize_multiple() do not require
hard irqs being masked, replace it to only block BH.

Rename helpers to better reflect they are safe against BH only.

- ptr_ring_resize_multiple() to ptr_ring_resize_multiple_bh()
- skb_array_resize_multiple() to skb_array_resize_multiple_bh()

[1]

WARNING: CPU: 1 PID: 9150 at net/core/page_pool.c:709 __page_pool_put_page net/core/page_pool.c:709 [inline]
WARNING: CPU: 1 PID: 9150 at net/core/page_pool.c:709 page_pool_put_unrefed_netmem+0x157/0xa40 net/core/page_pool.c:780
Modules linked in:
CPU: 1 UID: 0 PID: 9150 Comm: syz.1.1052 Not tainted 6.11.0-rc3-syzkaller-00202-gf8669d7b5f5d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:__page_pool_put_page net/core/page_pool.c:709 [inline]
RIP: 0010:page_pool_put_unrefed_netmem+0x157/0xa40 net/core/page_pool.c:780
Code: 74 0e e8 7c aa fb f7 eb 43 e8 75 aa fb f7 eb 3c 65 8b 1d 38 a8 6a 76 31 ff 89 de e8 a3 ae fb f7 85 db 74 0b e8 5a aa fb f7 90 <0f> 0b 90 eb 1d 65 8b 1d 15 a8 6a 76 31 ff 89 de e8 84 ae fb f7 85
RSP: 0018:ffffc9000bda6b58 EFLAGS: 00010083
RAX: ffffffff8997e523 RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffffc9000fbd0000 RSI: 0000000000001842 RDI: 0000000000001843
RBP: 0000000000000000 R08: ffffffff8997df2c R09: 1ffffd40003a000d
R10: dffffc0000000000 R11: fffff940003a000e R12: ffffea0001d00040
R13: ffff88802e8a4000 R14: dffffc0000000000 R15: 00000000ffffffff
FS:  00007fb7aaf716c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa15a0d4b72 CR3: 00000000561b0000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 tun_ptr_free drivers/net/tun.c:617 [inline]
 __ptr_ring_swap_queue include/linux/ptr_ring.h:571 [inline]
 ptr_ring_resize_multiple_noprof include/linux/ptr_ring.h:643 [inline]
 tun_queue_resize drivers/net/tun.c:3694 [inline]
 tun_device_event+0xaaf/0x1080 drivers/net/tun.c:3714
 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93
 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline]
 call_netdevice_notifiers net/core/dev.c:2046 [inline]
 dev_change_tx_queue_len+0x158/0x2a0 net/core/dev.c:9024
 do_setlink+0xff6/0x41f0 net/core/rtnetlink.c:2923
 rtnl_setlink+0x40d/0x5a0 net/core/rtnetlink.c:3201
 rtnetlink_rcv_msg+0x73f/0xcf0 net/core/rtnetlink.c:6647
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550

Fixes: ff4e538c8c ("page_pool: add a lockdep check for recycling in hardirq")
Reported-by: syzbot+f56a5c5eac2b28439810@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/671e10df.050a0220.2b8c0f.01cf.GAE@google.com/T/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://patch.msgid.link/20241217135121.326370-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-12-18 17:55:30 -08:00
..
arcnet
bonding bonding: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL 2024-12-12 11:59:18 +01:00
caif
can net: simplify resource acquisition + ioremap 2024-12-06 17:28:34 -08:00
dsa net: dsa: qca8k: Fix inconsistent use of jiffies vs milliseconds 2024-12-18 12:46:45 +00:00
ethernet net/mlx5e: Report rx_discards_phy via rx_dropped 2024-12-18 15:18:25 -08:00
fddi
fjes net: fjes: use ethtool string helpers 2024-10-31 19:36:59 -07:00
hamradio net: hamradio: scc: Switch to irq_get_nr_irqs() 2024-10-16 21:56:57 +02:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-25 09:08:22 +02:00
ieee802154 net: Switch back to struct platform_driver::remove() 2024-10-04 16:39:57 -07:00
ipa net: Switch back to struct platform_driver::remove() 2024-10-04 16:39:57 -07:00
ipvlan ipvlan: Prepare ipvlan_process_v4_outbound() to future .flowi4_tos conversion. 2024-11-03 14:28:37 -08:00
mctp mctp i2c: drop check because i2c_unregister_device() is NULL safe 2024-12-03 11:53:33 +01:00
mdio net: simplify resource acquisition + ioremap 2024-12-06 17:28:34 -08:00
netdevsim netdevsim: add more hw_features 2024-11-11 14:12:20 -08:00
pcs net: pcs: xpcs: implement pcs_inband_caps() method 2024-12-07 17:49:43 -08:00
phy net: phy: ks8995: constify 'struct bin_attribute' 2024-12-17 19:00:44 -08:00
plip net: plip: fix break; causing plip to never transmit 2024-10-19 16:06:55 -05:00
ppp ppp: fix ppp_async_encode() illegal access 2024-10-10 08:47:13 -07:00
pse-pd net: pse-pd: Fix out of bound for loop 2024-10-19 15:55:56 -05:00
slip slip: make slhc_remember() more robust against malicious packets 2024-10-10 09:06:32 -07:00
team team: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL 2024-12-12 11:59:18 +01:00
thunderbolt
usb net: usb: lan78xx: Improve error handling in WoL operations 2024-12-17 19:51:55 -08:00
vmxnet3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-21 09:14:18 +02:00
vxlan rtnetlink: add ndo_fdb_dump_context 2024-12-10 18:32:32 -08:00
wan net: wan: framer: Simplify API framer_provider_simple_of_xlate() implementation 2024-12-15 14:13:56 -08:00
wireguard wireguard: device: support big tcp GSO 2024-11-18 19:32:27 -08:00
wireless A small set of fixes: 2024-12-10 18:44:25 -08:00
wwan net: wwan: t7xx: Replace deprecated PCI functions 2024-12-10 18:42:50 -08:00
xen-netback
amt.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
bareudp.c bareudp: Handle stats using NETDEV_PCPU_STAT_DSTATS. 2024-12-06 17:56:53 -08:00
dummy.c rtnetlink: Remove __rtnl_link_register() 2024-11-11 17:26:51 -08:00
eql.c
geneve.c geneve: Handle stats using NETDEV_PCPU_STAT_DSTATS. 2024-12-06 17:56:52 -08:00
gtp.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
ifb.c rtnetlink: Remove __rtnl_link_register() 2024-11-11 17:26:51 -08:00
Kconfig testing: net-drv: add basic shaper test 2024-10-10 08:30:23 -07:00
LICENSE.SRC
loopback.c
macsec.c macsec: inherit lower device's TSO limits when offloading 2024-11-11 14:12:21 -08:00
macvlan.c ndo_fdb_del: Add a parameter to report whether notification was sent 2024-11-15 16:39:18 -08:00
macvtap.c
Makefile
mdio.c mdio: Remove mdio45_ethtool_gset_npage() 2024-11-14 19:08:55 -08:00
mhi_net.c
mii.c
net_failover.c
netconsole.c netcons: Add udp send fail statistics to netconsole 2024-12-04 19:16:59 -08:00
netkit.c rtnetlink: fix double call of rtnl_link_get_net_ifla() 2024-12-03 11:29:29 +01:00
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple() 2024-12-18 17:55:30 -08:00
tun.c ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple() 2024-12-18 17:55:30 -08:00
veth.c xdp: get rid of xdp_frame::mem.id 2024-12-12 18:22:52 -08:00
virtio_net.c virtio_net: ensure netdev_tx_reset_queue is called on bind xsk for tx 2024-12-10 11:22:21 +01:00
vrf.c vrf: Make pcpu_dstats update functions available to other modules. 2024-12-06 17:56:52 -08:00
vsockmon.c
xen-netfront.c