]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: tun: unlink NAPI from device on destruction
authorJakub Kicinski <kuba@kernel.org>
Thu, 23 Jun 2022 04:20:39 +0000 (21:20 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:54:12 +0000 (10:54 +0200)
commitc34bde9a354534901f5276769b4019d321632b1c
treecbf98137d43d67f7bdfafa0264d13692d1ce819c
parent20536e4c210925b71fd925d51441e25c67178c75
net: tun: unlink NAPI from device on destruction

BugLink: https://bugs.launchpad.net/bugs/1986728
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@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20220623042039.2274708-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/tun.c