]> git.baikalelectronics.ru Git - kernel.git/commit
net: tun: avoid disabling NAPI twice
authorJakub Kicinski <kuba@kernel.org>
Wed, 29 Jun 2022 18:19:10 +0000 (11:19 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Jun 2022 18:34:10 +0000 (11:34 -0700)
commit203fbdb339df51795a56049ecba8f3043116d074
tree257bdc6083b6cb0de9b9fb20c4cea6dc724fb60a
parent01f703f32b07dc538c3a08e2f6d9624ed9d909ca
net: tun: avoid disabling NAPI twice

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