Message ID | 20220617014551.3235-1-hoang.h.le@dektech.com.au (mailing list archive) |
---|---|
State | Accepted |
Commit | 911600bf5a5e84bfda4d33ee32acc75ecf6159f0 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] tipc: fix use-after-free Read in tipc_named_reinit | expand |
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: On Fri, 17 Jun 2022 08:45:51 +0700 you wrote: > syzbot found the following issue on: > ================================================================== > BUG: KASAN: use-after-free in tipc_named_reinit+0x94f/0x9b0 > net/tipc/name_distr.c:413 > Read of size 8 at addr ffff88805299a000 by task kworker/1:9/23764 > > CPU: 1 PID: 23764 Comm: kworker/1:9 Not tainted > 5.18.0-rc4-syzkaller-00878-g17d49e6e8012 #0 > Hardware name: Google Compute Engine/Google Compute Engine, > BIOS Google 01/01/2011 > Workqueue: events tipc_net_finalize_work > Call Trace: > <TASK> > __dump_stack lib/dump_stack.c:88 [inline] > dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 > print_address_description.constprop.0.cold+0xeb/0x495 > mm/kasan/report.c:313 > print_report mm/kasan/report.c:429 [inline] > kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 > tipc_named_reinit+0x94f/0x9b0 net/tipc/name_distr.c:413 > tipc_net_finalize+0x234/0x3d0 net/tipc/net.c:138 > process_one_work+0x996/0x1610 kernel/workqueue.c:2289 > worker_thread+0x665/0x1080 kernel/workqueue.c:2436 > kthread+0x2e9/0x3a0 kernel/kthread.c:376 > ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 > </TASK> > [...] > ================================================================== > > [...] Here is the summary with links: - [net] tipc: fix use-after-free Read in tipc_named_reinit https://git.kernel.org/netdev/net/c/911600bf5a5e You are awesome, thank you!
diff --git a/net/tipc/core.c b/net/tipc/core.c index 3f4542e0f065..434e70eabe08 100644 --- a/net/tipc/core.c +++ b/net/tipc/core.c @@ -109,10 +109,9 @@ static void __net_exit tipc_exit_net(struct net *net) struct tipc_net *tn = tipc_net(net); tipc_detach_loopback(net); + tipc_net_stop(net); /* Make sure the tipc_net_finalize_work() finished */ cancel_work_sync(&tn->work); - tipc_net_stop(net); - tipc_bcast_stop(net); tipc_nametbl_stop(net); tipc_sk_rht_destroy(net);