This is a note to let you know that I've just added the patch titled net: tun: unlink NAPI from device on destruction to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-tun-unlink-napi-from-device-on-destruction.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 3b9bc84d311104906d2b4995a9a02d7b7ddab2db Mon Sep 17 00:00:00 2001 From: Jakub Kicinski <kuba@xxxxxxxxxx> Date: Wed, 22 Jun 2022 21:20:39 -0700 Subject: net: tun: unlink NAPI from device on destruction From: Jakub Kicinski <kuba@xxxxxxxxxx> commit 3b9bc84d311104906d2b4995a9a02d7b7ddab2db upstream. Syzbot found a race between tun file and device destruction. NAPIs live in struct tun_file which can get destroyed before the netdev so we have to del them explicitly. The current code is missing deleting the NAPI if the queue was detached first. Fixes: 943170998b20 ("tun: enable NAPI for TUN/TAP driver") Reported-by: syzbot+b75c138e9286ac742647@xxxxxxxxxxxxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/20220623042039.2274708-1-kuba@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/tun.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -728,6 +728,7 @@ static void tun_detach_all(struct net_de sock_put(&tfile->sk); } list_for_each_entry_safe(tfile, tmp, &tun->disabled, next) { + tun_napi_del(tfile); tun_enable_queue(tfile); tun_queue_purge(tfile); xdp_rxq_info_unreg(&tfile->xdp_rxq); Patches currently in stable-queue which might be from kuba@xxxxxxxxxx are queue-5.18/selftests-net-pass-ipv6_args-to-udpgso_bench-s-ipv6-tcp-test.patch queue-5.18/net-fix-iff_tx_skb_no_linear-definition.patch queue-5.18/net-dp83822-disable-false-carrier-interrupt.patch queue-5.18/net-phy-don-t-trigger-state-machine-while-in-suspend.patch queue-5.18/selftests-mptcp-initialize-variables-to-quiet-gcc-12-warnings.patch queue-5.18/net-usb-asix-do-not-force-pause-frames-support.patch queue-5.18/mptcp-fix-conflict-with-netinet-in.h.patch queue-5.18/ipv6-take-care-of-disable_policy-when-restoring-routes.patch queue-5.18/net-tun-unlink-napi-from-device-on-destruction.patch queue-5.18/usbnet-fix-memory-allocation-in-helpers.patch queue-5.18/net-tun-stop-napi-when-detaching-queues.patch queue-5.18/selftests-mptcp-more-stable-diag-tests.patch queue-5.18/mptcp-fix-race-on-unaccepted-mptcp-sockets.patch queue-5.18/net-dp83822-disable-rx-error-interrupt.patch queue-5.18/net-dsa-bcm_sf2-force-pause-link-settings.patch