CVE-2025-38271: net: prevent a NULL deref in rtnl_create_link()
In the Linux kernel, the following vulnerability has been resolved:
net: prevent a NULL deref in rtnlcreatelink()
At the time rtnlcreatelink() is running, dev->netdevops is NULL, we must not use netdevlockops() or risk a NULL deref if CONFIGNETSHAPER is defined.
Use netifsetgroup() instead of devsetgroup().
RIP: 0010:netdevneedopslock include/net/netdevlock.h:33 [inline] RIP: 0010:netdevlockops include/net/netdevlock.h:41 [inline] RIP: 0010:devsetgroup+0xc0/0x230 net/core/devapi.c:82 Call Trace: <TASK> rtnlcreatelink+0x748/0xd10 net/core/rtnetlink.c:3674 rtnlnewlinkcreate+0x25c/0xb00 net/core/rtnetlink.c:3813 rtnlnewlink net/core/rtnetlink.c:3940 [inline] rtnlnewlink+0x16d6/0x1c70 net/core/rtnetlink.c:4055 rtnetlinkrcvmsg+0x7cf/0xb70 net/core/rtnetlink.c:6944 netlinkrcvskb+0x208/0x470 net/netlink/afnetlink.c:2534 netlinkunicastkernel net/netlink/afnetlink.c:1313 [inline] netlinkunicast+0x75b/0x8d0 net/netlink/afnetlink.c:1339 netlinksendmsg+0x805/0xb30 net/netlink/afnetlink.c:1883 socksendmsgnosec net/socket.c:712 [inline]
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In rtnl_create_link(), use netif_set_group() instead of dev_set_group() to avoid calling netdev_lock_ops() while dev->netdev_ops is NULL.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38271?
CVE-2025-38271 is classified as a medium severity vulnerability due to its exploitation potential leading to a NULL dereference.
How do I fix CVE-2025-38271?
To fix CVE-2025-38271, ensure that your Linux kernel is updated to the latest stable version where this vulnerability has been resolved.
Which versions of the Linux kernel are affected by CVE-2025-38271?
CVE-2025-38271 affects versions of the Linux kernel prior to the patch that addresses this specific vulnerability.
What components are involved in CVE-2025-38271?
CVE-2025-38271 involves the networking stack, specifically the rtnl_create_link() function in the Linux kernel.
What type of attack can CVE-2025-38271 lead to?
CVE-2025-38271 can potentially lead to denial of service through a NULL dereference, causing a crash in the affected system.