{"id":"CVE-2026-23209","summary":"macvlan: fix error recovery in macvlan_common_newlink()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmacvlan: fix error recovery in macvlan_common_newlink()\n\nvalis provided a nice repro to crash the kernel:\n\nip link add p1 type veth peer p2\nip link set address 00:00:00:00:00:20 dev p1\nip link set up dev p1\nip link set up dev p2\n\nip link add mv0 link p2 type macvlan mode source\nip link add invalid% link p2 type macvlan mode source macaddr add 00:00:00:00:00:20\n\nping -c1 -I p1 1.2.3.4\n\nHe also gave a very detailed analysis:\n\n\u003cquote valis\u003e\n\nThe issue is triggered when a new macvlan link is created  with\nMACVLAN_MODE_SOURCE mode and MACVLAN_MACADDR_ADD (or\nMACVLAN_MACADDR_SET) parameter, lower device already has a macvlan\nport and register_netdevice() called from macvlan_common_newlink()\nfails (e.g. because of the invalid link name).\n\nIn this case macvlan_hash_add_source is called from\nmacvlan_change_sources() / macvlan_common_newlink():\n\nThis adds a reference to vlan to the port's vlan_source_hash using\nmacvlan_source_entry.\n\nvlan is a pointer to the priv data of the link that is being created.\n\nWhen register_netdevice() fails, the error is returned from\nmacvlan_newlink() to rtnl_newlink_create():\n\n        if (ops-\u003enewlink)\n                err = ops-\u003enewlink(dev, &params, extack);\n        else\n                err = register_netdevice(dev);\n        if (err \u003c 0) {\n                free_netdev(dev);\n                goto out;\n        }\n\nand free_netdev() is called, causing a kvfree() on the struct\nnet_device that is still referenced in the source entry attached to\nthe lower device's macvlan port.\n\nNow all packets sent on the macvlan port with a matching source mac\naddress will trigger a use-after-free in macvlan_forward_source().\n\n\u003c/quote valis\u003e\n\nWith all that, my fix is to make sure we call macvlan_flush_sources()\nregardless of @create value whenever \"goto destroy_macvlan_port;\"\npath is taken.\n\nMany thanks to valis for following up on this issue.","modified":"2026-04-28T18:29:22.125471218Z","published":"2026-02-14T16:27:31.175Z","related":["ALSA-2026:6036","ALSA-2026:6037","ALSA-2026:6153","ALSA-2026:6632","SUSE-SU-2026:0962-1","SUSE-SU-2026:0984-1","SUSE-SU-2026:1003-1","SUSE-SU-2026:1041-1","SUSE-SU-2026:1077-1","SUSE-SU-2026:1078-1","SUSE-SU-2026:1081-1","SUSE-SU-2026:1131-1","SUSE-SU-2026:1180-1","SUSE-SU-2026:1185-1","SUSE-SU-2026:1187-1","SUSE-SU-2026:1188-1","SUSE-SU-2026:1189-1","SUSE-SU-2026:1212-1","SUSE-SU-2026:1221-1","SUSE-SU-2026:1222-1","SUSE-SU-2026:1225-1","SUSE-SU-2026:1231-1","SUSE-SU-2026:1236-1","SUSE-SU-2026:1237-1","SUSE-SU-2026:1239-1","SUSE-SU-2026:1242-1","SUSE-SU-2026:1244-1","SUSE-SU-2026:1248-1","SUSE-SU-2026:1254-1","SUSE-SU-2026:1258-1","SUSE-SU-2026:1259-1","SUSE-SU-2026:1261-1","SUSE-SU-2026:1262-1","SUSE-SU-2026:1263-1","SUSE-SU-2026:1265-1","SUSE-SU-2026:1266-1","SUSE-SU-2026:1268-1","SUSE-SU-2026:1269-1","SUSE-SU-2026:1270-1","SUSE-SU-2026:1271-1","SUSE-SU-2026:1272-1","SUSE-SU-2026:1274-1","SUSE-SU-2026:1278-1","SUSE-SU-2026:1279-1","SUSE-SU-2026:1280-1","SUSE-SU-2026:1281-1","SUSE-SU-2026:1283-1","SUSE-SU-2026:1284-1","SUSE-SU-2026:1285-1","SUSE-SU-2026:1287-1","SUSE-SU-2026:1288-1","SUSE-SU-2026:1293-1","SUSE-SU-2026:1294-1","SUSE-SU-2026:1297-1","SUSE-SU-2026:1298-1","SUSE-SU-2026:1304-1","SUSE-SU-2026:1305-1","SUSE-SU-2026:20667-1","SUSE-SU-2026:20720-1","SUSE-SU-2026:20838-1","SUSE-SU-2026:20845-1","SUSE-SU-2026:20876-1","SUSE-SU-2026:20931-1","SUSE-SU-2026:21004-1","SUSE-SU-2026:21005-1","SUSE-SU-2026:21006-1","SUSE-SU-2026:21007-1","SUSE-SU-2026:21008-1","SUSE-SU-2026:21009-1","SUSE-SU-2026:21020-1","SUSE-SU-2026:21040-1","SUSE-SU-2026:21041-1","SUSE-SU-2026:21042-1","SUSE-SU-2026:21043-1","SUSE-SU-2026:21044-1","SUSE-SU-2026:21045-1","SUSE-SU-2026:21046-1","SUSE-SU-2026:21047-1","SUSE-SU-2026:21048-1","SUSE-SU-2026:21049-1","SUSE-SU-2026:21050-1","SUSE-SU-2026:21051-1","SUSE-SU-2026:21052-1","SUSE-SU-2026:21053-1","SUSE-SU-2026:21054-1","SUSE-SU-2026:21055-1","SUSE-SU-2026:21056-1","SUSE-SU-2026:21057-1","SUSE-SU-2026:21058-1","SUSE-SU-2026:21059-1","SUSE-SU-2026:21060-1","SUSE-SU-2026:21061-1","SUSE-SU-2026:21070-1","SUSE-SU-2026:21071-1","SUSE-SU-2026:21072-1","SUSE-SU-2026:21073-1","SUSE-SU-2026:21074-1","SUSE-SU-2026:21075-1","SUSE-SU-2026:21076-1","SUSE-SU-2026:21077-1","SUSE-SU-2026:21078-1","SUSE-SU-2026:21079-1","SUSE-SU-2026:21080-1","SUSE-SU-2026:21081-1","SUSE-SU-2026:21082-1","SUSE-SU-2026:21083-1","SUSE-SU-2026:21084-1","SUSE-SU-2026:21085-1","SUSE-SU-2026:21086-1","SUSE-SU-2026:21087-1","SUSE-SU-2026:21088-1","SUSE-SU-2026:21089-1","SUSE-SU-2026:21090-1","SUSE-SU-2026:21091-1","SUSE-SU-2026:21096-1","SUSE-SU-2026:21098-1","SUSE-SU-2026:21099-1","SUSE-SU-2026:21100-1","SUSE-SU-2026:21102-1","SUSE-SU-2026:21216-1","SUSE-SU-2026:21217-1","SUSE-SU-2026:21218-1","SUSE-SU-2026:21219-1","SUSE-SU-2026:21220-1","SUSE-SU-2026:21221-1","SUSE-SU-2026:21284-1","openSUSE-SU-2026:20416-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23209.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/11ba9f0dc865136174cb98834280fb21bbc950c7"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5dae6b36a7cb7a4fcf4121b95e9ca7f96f816c8a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/986967a162142710076782d5b93daab93a892980"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c43d0e787cbba569ec9d11579ed370b50fab6c9c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cdedcd5aa3f3cb8b7ae0f87ab3a936d0bd583d66"},{"type":"WEB","url":"https://git.kernel.org/stable/c/da5c6b8ae47e414be47e5e04def15b25d5c962dc"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f8db6475a83649689c087a8f52486fcc53e627e9"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23209.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23209"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"aa5fd0fb77486b8a6764ead8627baa14790e4280"},{"fixed":"da5c6b8ae47e414be47e5e04def15b25d5c962dc"},{"fixed":"5dae6b36a7cb7a4fcf4121b95e9ca7f96f816c8a"},{"fixed":"c43d0e787cbba569ec9d11579ed370b50fab6c9c"},{"fixed":"11ba9f0dc865136174cb98834280fb21bbc950c7"},{"fixed":"986967a162142710076782d5b93daab93a892980"},{"fixed":"cdedcd5aa3f3cb8b7ae0f87ab3a936d0bd583d66"},{"fixed":"f8db6475a83649689c087a8f52486fcc53e627e9"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23209.json"}}],"schema_version":"1.7.5"}