CVE-2025-38150
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
03/07/2025
Last modified:
03/07/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
af_packet: move notifier&#39;s packet_dev_mc out of rcu critical section<br />
<br />
Syzkaller reports the following issue:<br />
<br />
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:578<br />
__mutex_lock+0x106/0xe80 kernel/locking/mutex.c:746<br />
team_change_rx_flags+0x38/0x220 drivers/net/team/team_core.c:1781<br />
dev_change_rx_flags net/core/dev.c:9145 [inline]<br />
__dev_set_promiscuity+0x3f8/0x590 net/core/dev.c:9189<br />
netif_set_promiscuity+0x50/0xe0 net/core/dev.c:9201<br />
dev_set_promiscuity+0x126/0x260 net/core/dev_api.c:286 packet_dev_mc net/packet/af_packet.c:3698 [inline]<br />
packet_dev_mclist_delete net/packet/af_packet.c:3722 [inline]<br />
packet_notifier+0x292/0xa60 net/packet/af_packet.c:4247<br />
notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85<br />
call_netdevice_notifiers_extack net/core/dev.c:2214 [inline]<br />
call_netdevice_notifiers net/core/dev.c:2228 [inline]<br />
unregister_netdevice_many_notify+0x15d8/0x2330 net/core/dev.c:11972<br />
rtnl_delete_link net/core/rtnetlink.c:3522 [inline]<br />
rtnl_dellink+0x488/0x710 net/core/rtnetlink.c:3564<br />
rtnetlink_rcv_msg+0x7cf/0xb70 net/core/rtnetlink.c:6955<br />
netlink_rcv_skb+0x219/0x490 net/netlink/af_netlink.c:2534<br />
<br />
Calling `PACKET_ADD_MEMBERSHIP` on an ops-locked device can trigger<br />
the `NETDEV_UNREGISTER` notifier, which may require disabling promiscuous<br />
and/or allmulti mode. Both of these operations require acquiring<br />
the netdev instance lock.<br />
<br />
Move the call to `packet_dev_mc` outside of the RCU critical section.<br />
The `mclist` modifications (add, del, flush, unregister) are protected by<br />
the RTNL, not the RCU. The RCU only protects the `sklist` and its<br />
associated `sks`. The delayed operation on the `mclist` entry remains<br />
within the RTNL.