Eric Dumazet
905b2032fa
mac80211: mesh: fix mesh_pathtbl_init() error path
...
If tbl_mpp can not be allocated, we call mesh_table_free(tbl_path)
while tbl_path rhashtable has not yet been initialized, which causes
panics.
Simply factorize the rhashtable_init() call into mesh_table_alloc()
WARNING: CPU: 1 PID: 8474 at kernel/workqueue.c:3040 __flush_work kernel/workqueue.c:3040 [inline]
WARNING: CPU: 1 PID: 8474 at kernel/workqueue.c:3040 __cancel_work_timer+0x514/0x540 kernel/workqueue.c:3136
Modules linked in:
CPU: 1 PID: 8474 Comm: syz-executor663 Not tainted 5.10.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__flush_work kernel/workqueue.c:3040 [inline]
RIP: 0010:__cancel_work_timer+0x514/0x540 kernel/workqueue.c:3136
Code: 5d c3 e8 bf ae 29 00 0f 0b e9 f0 fd ff ff e8 b3 ae 29 00 0f 0b 43 80 3c 3e 00 0f 85 31 ff ff ff e9 34 ff ff ff e8 9c ae 29 00 <0f> 0b e9 dc fe ff ff 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c 7d fd ff
RSP: 0018:ffffc9000165f5a0 EFLAGS: 00010293
RAX: ffffffff814b7064 RBX: 0000000000000001 RCX: ffff888021c80000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff888024039ca0 R08: dffffc0000000000 R09: fffffbfff1dd3e64
R10: fffffbfff1dd3e64 R11: 0000000000000000 R12: 1ffff920002cbebd
R13: ffff888024039c88 R14: 1ffff11004807391 R15: dffffc0000000000
FS: 0000000001347880(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000140 CR3: 000000002cc0a000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
rhashtable_free_and_destroy+0x25/0x9c0 lib/rhashtable.c:1137
mesh_table_free net/mac80211/mesh_pathtbl.c:69 [inline]
mesh_pathtbl_init+0x287/0x2e0 net/mac80211/mesh_pathtbl.c:785
ieee80211_mesh_init_sdata+0x2ee/0x530 net/mac80211/mesh.c:1591
ieee80211_setup_sdata+0x733/0xc40 net/mac80211/iface.c:1569
ieee80211_if_add+0xd5c/0x1cd0 net/mac80211/iface.c:1987
ieee80211_add_iface+0x59/0x130 net/mac80211/cfg.c:125
rdev_add_virtual_intf net/wireless/rdev-ops.h:45 [inline]
nl80211_new_interface+0x563/0xb40 net/wireless/nl80211.c:3855
genl_family_rcv_msg_doit net/netlink/genetlink.c:739 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:783 [inline]
genl_rcv_msg+0xe4e/0x1280 net/netlink/genetlink.c:800
netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2494
genl_rcv+0x24/0x40 net/netlink/genetlink.c:811
netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
netlink_unicast+0x780/0x930 net/netlink/af_netlink.c:1330
netlink_sendmsg+0x9a8/0xd40 net/netlink/af_netlink.c:1919
sock_sendmsg_nosec net/socket.c:651 [inline]
sock_sendmsg net/socket.c:671 [inline]
____sys_sendmsg+0x519/0x800 net/socket.c:2353
___sys_sendmsg net/socket.c:2407 [inline]
__sys_sendmsg+0x2b1/0x360 net/socket.c:2440
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: 60854fd94573 ("mac80211: mesh: convert path table to rhashtable")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Link: https://lore.kernel.org/r/20201204162428.2583119-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-12-04 17:34:25 -08:00
..
2020-10-12 10:05:47 +02:00
2020-09-28 00:51:39 -07:00
2020-08-03 15:48:32 -07:00
2020-10-31 12:26:30 -07:00
2020-07-25 17:49:04 -07:00
2020-11-27 08:02:55 +01:00
2020-10-29 17:22:59 -05:00
2020-09-30 08:34:08 -07:00
2020-10-15 12:33:24 -07:00
2020-12-04 15:41:06 -08:00
2020-09-05 15:57:05 -07:00
2020-11-27 10:49:28 +01:00
2020-10-12 15:29:27 +02:00
2020-12-03 11:13:21 -08:00
2020-09-10 15:09:08 -07:00
2020-11-23 16:32:33 -08:00
2020-08-23 17:36:59 -05:00
2020-10-19 17:32:50 -07:00
2020-11-09 17:15:34 -08:00
2020-10-02 19:11:11 -07:00
2020-10-02 19:11:11 -07:00
2020-12-04 15:38:16 -08:00
2020-12-02 11:16:12 -08:00
2020-11-21 14:43:45 -08:00
2020-07-24 15:41:54 -07:00
2020-08-02 01:02:12 -07:00
2020-10-02 19:11:11 -07:00
2020-08-27 07:55:59 -07:00
2020-07-24 15:41:54 -07:00
2020-12-04 17:34:25 -08:00
2020-09-08 20:12:58 -07:00
2020-10-20 21:16:45 -07:00
2020-11-27 11:05:31 -08:00
2020-11-12 17:00:13 -08:00
2020-11-27 12:10:47 +01:00
2020-11-14 12:07:57 -08:00
2020-10-09 20:22:32 -07:00
2020-08-23 17:36:59 -05:00
2020-10-20 17:06:22 -07:00
2020-12-04 15:43:14 -08:00
2020-11-23 17:29:36 -08:00
2020-08-23 17:36:59 -05:00
2020-10-02 19:11:11 -07:00
2020-10-06 06:01:35 -07:00
2020-10-28 09:14:49 -03:00
2020-11-12 09:18:06 +01:00
2020-11-20 10:04:58 -08:00
2020-10-15 13:28:00 +01:00
2020-12-04 14:15:01 -08:00
2020-11-14 11:57:12 -08:00
2020-11-19 10:59:19 -08:00
2020-11-08 16:28:25 -05:00
2020-09-23 17:46:31 -07:00
2020-12-01 15:26:57 -08:00
2020-11-25 17:31:06 -08:00
2020-10-15 18:42:13 -07:00
2020-11-23 16:36:29 -08:00
2020-10-02 19:11:11 -07:00
2020-12-04 12:35:58 +01:00
2020-12-02 17:26:36 -08:00
2020-11-24 22:39:56 +01:00
2020-11-04 08:12:52 -08:00
2020-10-03 00:02:13 -04:00
2020-06-30 15:57:34 -07:00
2020-09-30 18:01:26 -07:00
2020-10-05 18:40:01 -07:00