Eric Dumazet
71e5cd1018
Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()"
commit 80f8a66dede0a4b4e9e846765a97809c6fe49ce5 upstream.
This reverts commit 13e5afd3d773c6fc6ca2b89027befaaaa1ea7293.
ieee80211_if_free() is already called from free_netdev(ndev)
because ndev->priv_destructor == ieee80211_if_free
syzbot reported:
general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
CPU: 0 PID: 10041 Comm: syz-executor.0 Not tainted 6.2.0-rc2-syzkaller-00388-g55b98837e37d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:pcpu_get_page_chunk mm/percpu.c:262 [inline]
RIP: 0010:pcpu_chunk_addr_search mm/percpu.c:1619 [inline]
RIP: 0010:free_percpu mm/percpu.c:2271 [inline]
RIP: 0010:free_percpu+0x186/0x10f0 mm/percpu.c:2254
Code: 80 3c 02 00 0f 85 f5 0e 00 00 48 8b 3b 48 01 ef e8 cf b3 0b 00 48 ba 00 00 00 00 00 fc ff df 48 8d 78 20 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 3b 0e 00 00 48 8b 58 20 48 b8 00 00 00 00 00 fc
RSP: 0018:ffffc90004ba7068 EFLAGS: 00010002
RAX: 0000000000000000 RBX: ffff88823ffe2b80 RCX: 0000000000000004
RDX: dffffc0000000000 RSI: ffffffff81c1f4e7 RDI: 0000000000000020
RBP: ffffe8fffe8fc220 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 1ffffffff2179ab2 R12: ffff8880b983d000
R13: 0000000000000003 R14: 0000607f450fc220 R15: ffff88823ffe2988
FS: 00007fcb349de700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b32220000 CR3: 000000004914f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
netdev_run_todo+0x6bf/0x1100 net/core/dev.c:10352
ieee80211_register_hw+0x2663/0x4040 net/mac80211/main.c:1411
mac80211_hwsim_new_radio+0x2537/0x4d80 drivers/net/wireless/mac80211_hwsim.c:4583
hwsim_new_radio_nl+0xa09/0x10f0 drivers/net/wireless/mac80211_hwsim.c:5176
genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968
genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline]
genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1065
netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0xd3/0x120 net/socket.c:734
____sys_sendmsg+0x712/0x8c0 net/socket.c:2476
___sys_sendmsg+0x110/0x1b0 net/socket.c:2530
__sys_sendmsg+0xf7/0x1c0 net/socket.c:2559
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Reported-by: syzbot <syzkaller@googlegroups.com>
Fixes: 13e5afd3d773 ("wifi: mac80211: fix memory leak in ieee80211_if_add()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Zhengchao Shao <shaozhengchao@huawei.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230113124326.3533978-1-edumazet@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-24 07:20:01 +01:00
..
2021-04-10 13:36:08 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-02-24 10:36:03 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2021-04-10 13:36:08 +02:00
2019-06-19 17:09:55 +02:00
2021-12-22 09:30:54 +01:00
2023-01-24 07:19:56 +01:00
2022-12-08 11:23:56 +01:00
2022-10-26 13:25:19 +02:00
2022-06-09 10:21:22 +02:00
2017-11-02 11:10:55 +01:00
2020-02-24 10:35:57 +01:00
2020-02-24 10:35:57 +01:00
2020-07-31 09:24:24 +02:00
2017-11-02 11:10:55 +01:00
2020-03-29 21:25:29 -07:00
2017-11-02 11:10:55 +01:00
2021-02-07 15:37:15 +01:00
2017-11-02 11:10:55 +01:00
2023-01-24 07:19:56 +01:00
2021-12-22 09:30:50 +01:00
2019-06-05 17:37:16 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-05-31 11:27:03 +02:00
2020-07-31 09:24:23 +02:00
2022-09-08 11:11:40 +02:00
2022-10-17 17:26:07 +02:00
2023-01-24 07:20:01 +01:00
2021-02-17 11:02:25 +01:00
2021-06-03 09:00:29 +02:00
2021-06-03 09:00:29 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2022-12-02 17:39:57 +01:00
2020-10-08 10:40:57 +02:00
2021-03-04 11:37:32 +01:00
2022-12-02 17:39:57 +01:00
2020-09-28 14:36:53 +02:00
2021-10-06 15:55:52 +02:00
2019-06-19 17:09:55 +02:00
2020-08-27 14:12:15 +02:00
2020-05-31 11:26:39 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2022-10-17 17:26:07 +02:00
2019-06-19 17:09:55 +02:00
2020-09-28 13:18:53 +02:00
2017-11-02 11:10:55 +01:00
2021-02-10 09:29:16 +01:00
2020-04-24 11:30:13 +02:00
2019-10-11 10:31:45 +02:00
2019-10-11 10:31:45 +02:00
2020-05-26 20:17:35 -07:00
2019-10-11 10:31:45 +02:00
2020-11-12 11:25:09 +01:00
2020-11-12 11:24:43 +01:00
2022-10-15 07:55:56 +02:00
2020-10-08 10:40:57 +02:00
2022-10-17 17:26:07 +02:00
2021-02-13 13:55:04 +01:00
2022-09-08 11:11:40 +02:00
2021-12-22 09:30:50 +01:00
2020-11-12 11:23:58 +01:00
2020-07-31 09:24:23 +02:00
2020-01-15 09:52:12 +01:00
2019-07-08 20:57:08 -07:00
2019-03-29 11:20:36 +01:00
2017-11-02 11:10:55 +01:00
2020-09-18 12:16:16 +02:00
2021-10-06 15:55:51 +02:00
2022-10-17 17:26:07 +02:00
2020-12-30 11:53:50 +01:00
2020-02-07 12:40:34 +01:00
2020-02-07 12:40:34 +01:00
2022-07-21 21:20:00 +02:00
2019-06-19 17:09:55 +02:00
2021-10-06 15:55:48 +02:00
2019-06-19 17:09:55 +02:00