Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13E8731F995 for ; Wed, 6 May 2026 11:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778067045; cv=none; b=AJXd3dzgNrg1C42vWfKjBob2tmTOusfhj7L5G9wCEZ7yLnmKAXeFgwkYl0V8ZleDxf1Y9pziaw6uuIZwj45IayjfvGgV6z8e8MVSFRNEc06Yg4qRoc/zOkPhgorUFk5rJJEa9GLEsERkVuN1EmqVuKoR4Eq8/n0a73HJo2Y0HY4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778067045; c=relaxed/simple; bh=5/aX60qIEbUs4agqJcs2M+mWnZHM/2TNr16nCbJPA0w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J4JaNxr/aMXFoSedhd6TQ5/Eigc3rCHxmwTU9+PnUa1hDK1VdCIwB5iYVUHgmowyrYHN5Ufer5e0C0irHAs4a0Qn0AsIeyAkJAdJwBWvIDYOFtB/RK6nyR42+Vi0S73YrNqVw5pE/NIslXdVS7e7PFKTfvuq1WuuaYJGj1l76yE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1NyoHwSm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1NyoHwSm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F735C2BCC4; Wed, 6 May 2026 11:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778067045; bh=5/aX60qIEbUs4agqJcs2M+mWnZHM/2TNr16nCbJPA0w=; h=From:To:Cc:Subject:Date:Reply-To:From; b=1NyoHwSmKJaLwq+c8SQvQJx/YSiyzQLSy3jtnD/P3uvy8EYNXccnmucYQR8BT1A3p rNx6TMLmybSVMyMJ/eUqZ/z4ApJpQ1plEBZFO7cwiAR+gbzfdJvVMqqvv3mpZlPIPC Ck69CVSHv3LimAZ7BWdZW5BFr1xo8VqWpo1xjpLg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-43167: xfrm: always flush state and policy upon NETDEV_UNREGISTER event Date: Wed, 6 May 2026 13:28:03 +0200 Message-ID: <2026050634-CVE-2026-43167-6243@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5463; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Zf2jbyITEH74WtwQtfGTBv2iPjZ3K6WRglwVO8hg1YU=; b=owGbwMvMwCRo6H6F97bub03G02pJDJm/VZeJ7XoSmJ3V7x8/S1wiQchnOlezW7+H7evZU3zXy JTmLi/siGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIm8MWNYsLZGW+XiXqtlv6/P Or5io/+0N0IdmxkW7Ay1jWKf8OXou2U1UXJHuK3X/Te5CwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: xfrm: always flush state and policy upon NETDEV_UNREGISTER event syzbot is reporting that "struct xfrm_state" refcount is leaking. unregister_netdevice: waiting for netdevsim0 to become free. Usage count = 2 ref_tracker: netdev@ffff888052f24618 has 1/1 users at __netdev_tracker_alloc include/linux/netdevice.h:4400 [inline] netdev_tracker_alloc include/linux/netdevice.h:4412 [inline] xfrm_dev_state_add+0x3a5/0x1080 net/xfrm/xfrm_device.c:316 xfrm_state_construct net/xfrm/xfrm_user.c:986 [inline] xfrm_add_sa+0x34ff/0x5fa0 net/xfrm/xfrm_user.c:1022 xfrm_user_rcv_msg+0x58e/0xc00 net/xfrm/xfrm_user.c:3507 netlink_rcv_skb+0x158/0x420 net/netlink/af_netlink.c:2550 xfrm_netlink_rcv+0x71/0x90 net/xfrm/xfrm_user.c:3529 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] ____sys_sendmsg+0xa5d/0xc30 net/socket.c:2592 ___sys_sendmsg+0x134/0x1d0 net/socket.c:2646 __sys_sendmsg+0x16d/0x220 net/socket.c:2678 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f This is because commit d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API") implemented xfrm_dev_unregister() as no-op despite xfrm_dev_state_add() from xfrm_state_construct() acquires a reference to "struct net_device". I guess that that commit expected that NETDEV_DOWN event is fired before NETDEV_UNREGISTER event fires, and also assumed that xfrm_dev_state_add() is called only if (dev->features & NETIF_F_HW_ESP) != 0. Sabrina Dubroca identified steps to reproduce the same symptoms as below. echo 0 > /sys/bus/netdevsim/new_device dev=$(ls -1 /sys/bus/netdevsim/devices/netdevsim0/net/) ip xfrm state add src 192.168.13.1 dst 192.168.13.2 proto esp \ spi 0x1000 mode tunnel aead 'rfc4106(gcm(aes))' $key 128 \ offload crypto dev $dev dir out ethtool -K $dev esp-hw-offload off echo 0 > /sys/bus/netdevsim/del_device Like these steps indicate, the NETIF_F_HW_ESP bit can be cleared after xfrm_dev_state_add() acquired a reference to "struct net_device". Also, xfrm_dev_state_add() does not check for the NETIF_F_HW_ESP bit when acquiring a reference to "struct net_device". Commit 03891f820c21 ("xfrm: handle NETDEV_UNREGISTER for xfrm device") re-introduced the NETDEV_UNREGISTER event to xfrm_dev_event(), but that commit for unknown reason chose to share xfrm_dev_down() between the NETDEV_DOWN event and the NETDEV_UNREGISTER event. I guess that that commit missed the behavior in the previous paragraph. Therefore, we need to re-introduce xfrm_dev_unregister() in order to release the reference to "struct net_device" by unconditionally flushing state and policy. The Linux kernel CVE team has assigned CVE-2026-43167 to this issue. Affected and fixed versions =========================== Issue introduced in 4.12 with commit d77e38e612a017480157fe6d2c1422f42cb5b7e3 and fixed in 6.6.128 with commit 166801e49a5b5fc127b8c9e2f110f303cfddfbc3 Issue introduced in 4.12 with commit d77e38e612a017480157fe6d2c1422f42cb5b7e3 and fixed in 6.12.75 with commit a3c8fede034fa27892f87c863cbd5493167d17ed Issue introduced in 4.12 with commit d77e38e612a017480157fe6d2c1422f42cb5b7e3 and fixed in 6.18.16 with commit 59581778792cbaf8ad788f4a21dc663ce986050e Issue introduced in 4.12 with commit d77e38e612a017480157fe6d2c1422f42cb5b7e3 and fixed in 6.19.6 with commit 8c75c455ecd3bfd2f36abf66edb7021c4fa19ec4 Issue introduced in 4.12 with commit d77e38e612a017480157fe6d2c1422f42cb5b7e3 and fixed in 7.0 with commit 4efa91a28576054aae0e6dad9cba8fed8293aef8 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-43167 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/xfrm/xfrm_device.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/166801e49a5b5fc127b8c9e2f110f303cfddfbc3 https://git.kernel.org/stable/c/a3c8fede034fa27892f87c863cbd5493167d17ed https://git.kernel.org/stable/c/59581778792cbaf8ad788f4a21dc663ce986050e https://git.kernel.org/stable/c/8c75c455ecd3bfd2f36abf66edb7021c4fa19ec4 https://git.kernel.org/stable/c/4efa91a28576054aae0e6dad9cba8fed8293aef8