]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jul 2022 14:37:29 +0000 (16:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jul 2022 14:37:29 +0000 (16:37 +0200)
added patches:
net-tun-avoid-disabling-napi-twice.patch

queue-5.10/net-tun-avoid-disabling-napi-twice.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/net-tun-avoid-disabling-napi-twice.patch b/queue-5.10/net-tun-avoid-disabling-napi-twice.patch
new file mode 100644 (file)
index 0000000..4b85b3c
--- /dev/null
@@ -0,0 +1,41 @@
+From ff1fa2081d173b01cebe2fbf0a2d0f1cee9ce4b5 Mon Sep 17 00:00:00 2001
+From: Jakub Kicinski <kuba@kernel.org>
+Date: Wed, 29 Jun 2022 11:19:10 -0700
+Subject: net: tun: avoid disabling NAPI twice
+
+From: Jakub Kicinski <kuba@kernel.org>
+
+commit ff1fa2081d173b01cebe2fbf0a2d0f1cee9ce4b5 upstream.
+
+Eric reports that syzbot made short work out of my speculative
+fix. Indeed when queue gets detached its tfile->tun remains,
+so we would try to stop NAPI twice with a detach(), close()
+sequence.
+
+Alternative fix would be to move tun_napi_disable() to
+tun_detach_all() and let the NAPI run after the queue
+has been detached.
+
+Fixes: a8fc8cb5692a ("net: tun: stop NAPI when detaching queues")
+Reported-by: syzbot <syzkaller@googlegroups.com>
+Reported-by: Eric Dumazet <edumazet@google.com>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Link: https://lore.kernel.org/r/20220629181911.372047-1-kuba@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/tun.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/tun.c
++++ b/drivers/net/tun.c
+@@ -646,7 +646,8 @@ static void __tun_detach(struct tun_file
+       tun = rtnl_dereference(tfile->tun);
+       if (tun && clean) {
+-              tun_napi_disable(tfile);
++              if (!tfile->detached)
++                      tun_napi_disable(tfile);
+               tun_napi_del(tfile);
+       }
index 8c801d4adc1ec4960185f2d48fb2e161c2e35770..13cf63f5851a494c4ffd19ea921305f94fb2139d 100644 (file)
@@ -37,3 +37,4 @@ tipc-move-bc-link-creation-back-to-tipc_node_create.patch
 epic100-fix-use-after-free-on-rmmod.patch
 io_uring-ensure-that-send-sendmsg-and-recv-recvmsg-check-sqe-ioprio.patch
 tunnels-do-not-assume-mac-header-is-set-in-skb_tunnel_check_pmtu.patch
+net-tun-avoid-disabling-napi-twice.patch