]> git.baikalelectronics.ru Git - 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)
committerJakub Kicinski <kuba@kernel.org>
Fri, 24 Jun 2022 23:28:08 +0000 (16:28 -0700)
commit3ebab48c1af21146b9aa03f0585fdf01b5406d03
tree9f8fad5159f00663d624c89a19f827cdc26bc0f4
parente41572d85fef8f3db3526e4a318e5456f9a1bda1
net: tun: unlink NAPI from device on destruction

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: 84ce86528b97 ("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>
drivers/net/tun.c