CVE-2026-23209
Unknown Unknown - Not Provided
Use-After-Free Vulnerability in Linux Kernel macvlan Network Driver

Publication date: 2026-02-14

Last updated on: 2026-04-03

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: macvlan: fix error recovery in macvlan_common_newlink() valis provided a nice repro to crash the kernel: ip link add p1 type veth peer p2 ip link set address 00:00:00:00:00:20 dev p1 ip link set up dev p1 ip link set up dev p2 ip link add mv0 link p2 type macvlan mode source ip link add invalid% link p2 type macvlan mode source macaddr add 00:00:00:00:00:20 ping -c1 -I p1 1.2.3.4 He also gave a very detailed analysis: <quote valis> The issue is triggered when a new macvlan link is created with MACVLAN_MODE_SOURCE mode and MACVLAN_MACADDR_ADD (or MACVLAN_MACADDR_SET) parameter, lower device already has a macvlan port and register_netdevice() called from macvlan_common_newlink() fails (e.g. because of the invalid link name). In this case macvlan_hash_add_source is called from macvlan_change_sources() / macvlan_common_newlink(): This adds a reference to vlan to the port's vlan_source_hash using macvlan_source_entry. vlan is a pointer to the priv data of the link that is being created. When register_netdevice() fails, the error is returned from macvlan_newlink() to rtnl_newlink_create(): if (ops->newlink) err = ops->newlink(dev, &params, extack); else err = register_netdevice(dev); if (err < 0) { free_netdev(dev); goto out; } and free_netdev() is called, causing a kvfree() on the struct net_device that is still referenced in the source entry attached to the lower device's macvlan port. Now all packets sent on the macvlan port with a matching source mac address will trigger a use-after-free in macvlan_forward_source(). </quote valis> With all that, my fix is to make sure we call macvlan_flush_sources() regardless of @create value whenever "goto destroy_macvlan_port;" path is taken. Many thanks to valis for following up on this issue.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-02-14
Last Modified
2026-04-03
Generated
2026-05-07
AI Q&A
2026-02-14
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 18 associated CPEs
Vendor Product Version / Range
linux linux_kernel 4.9
linux linux_kernel 4.9
linux linux_kernel 4.9
linux linux_kernel 4.9
linux linux_kernel 6.19
linux linux_kernel 6.19
linux linux_kernel 6.19
linux linux_kernel 6.19
linux linux_kernel 6.19
linux linux_kernel From 5.16 (inc) to 6.1.163 (exc)
linux linux_kernel From 6.7 (inc) to 6.12.70 (exc)
linux linux_kernel From 6.2 (inc) to 6.6.124 (exc)
linux linux_kernel 6.19
linux linux_kernel From 6.13 (inc) to 6.18.10 (exc)
linux linux_kernel 6.19
linux linux_kernel 6.19
linux linux_kernel From 5.11 (inc) to 5.15.200 (exc)
linux linux_kernel From 4.9.1 (inc) to 5.10.250 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-416 The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability exists in the Linux kernel's macvlan network driver, specifically in the macvlan_common_newlink() function. It occurs when creating a new macvlan link in MACVLAN_MODE_SOURCE mode with the MACVLAN_MACADDR_ADD or MACVLAN_MACADDR_SET parameter, and the lower device already has a macvlan port. If the register_netdevice() call fails (for example, due to an invalid link name), an error path is taken where the net_device structure is freed while still being referenced by a source entry in the vlan_source_hash. This leads to a use-after-free condition when packets are sent on the macvlan port with a matching source MAC address, potentially causing the kernel to crash.


How can this vulnerability impact me? :

The vulnerability can cause the Linux kernel to crash due to a use-after-free error in the macvlan network driver. This can lead to denial of service (DoS) conditions on affected systems, disrupting network connectivity and potentially impacting system stability.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by attempting to reproduce the conditions that trigger the kernel crash. The following commands demonstrate the steps to reproduce the issue:

  • ip link add p1 type veth peer p2
  • ip link set address 00:00:00:00:00:20 dev p1
  • ip link set up dev p1
  • ip link set up dev p2
  • ip link add mv0 link p2 type macvlan mode source
  • ip link add invalid% link p2 type macvlan mode source macaddr add 00:00:00:00:00:20
  • ping -c1 -I p1 1.2.3.4

If these commands cause a kernel crash or errors related to macvlan, the vulnerability is present.


What immediate steps should I take to mitigate this vulnerability?

The vulnerability has been fixed by ensuring that macvlan_flush_sources() is called whenever the error path 'goto destroy_macvlan_port;' is taken during macvlan link creation.

Immediate mitigation steps include updating the Linux kernel to a version that contains this fix.

Until the update is applied, avoid creating macvlan links with MACVLAN_MODE_SOURCE mode combined with MACVLAN_MACADDR_ADD or MACVLAN_MACADDR_SET parameters on devices that already have a macvlan port, as this triggers the vulnerability.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart