“35ac9719f22c6c57eb3d520d11e303349e583e9d”上不存在“...net/www/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 a6b132d2 编写于 作者: J Jakub Kicinski 提交者: Yongqiang Liu

net: tun: avoid disabling NAPI twice

stable inclusion
from stable-4.19.251
commit a12fae7621434d0360202156e13969874e002661
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5I4FP
CVE: NA

--------------------------------

commit ff1fa208 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: a8fc8cb5 ("net: tun: stop NAPI when detaching queues")
Reported-by: Nsyzbot <syzkaller@googlegroups.com>
Reported-by: NEric Dumazet <edumazet@google.com>
Reviewed-by: NEric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220629181911.372047-1-kuba@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 e930a2ec
......@@ -702,7 +702,8 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
tun = rtnl_dereference(tfile->tun);
if (tun && clean) {
tun_napi_disable(tfile);
if (!tfile->detached)
tun_napi_disable(tfile);
tun_napi_del(tfile);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册