TencentOS-kernel/net
Markus Theil 536fd2b3cf mac80211: fix double free in ibss_leave
commit 3bd801b14e0c5d29eeddc7336558beb3344efaa3 upstream.

Clear beacon ie pointer and ie length after free
in order to prevent double free.

==================================================================
BUG: KASAN: double-free or invalid-free \
in ieee80211_ibss_leave+0x83/0xe0 net/mac80211/ibss.c:1876

CPU: 0 PID: 8472 Comm: syz-executor100 Not tainted 5.11.0-rc6-syzkaller #0
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:230
 kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:355
 ____kasan_slab_free+0xcc/0xe0 mm/kasan/common.c:341
 kasan_slab_free include/linux/kasan.h:192 [inline]
 __cache_free mm/slab.c:3424 [inline]
 kfree+0xed/0x270 mm/slab.c:3760
 ieee80211_ibss_leave+0x83/0xe0 net/mac80211/ibss.c:1876
 rdev_leave_ibss net/wireless/rdev-ops.h:545 [inline]
 __cfg80211_leave_ibss+0x19a/0x4c0 net/wireless/ibss.c:212
 __cfg80211_leave+0x327/0x430 net/wireless/core.c:1172
 cfg80211_leave net/wireless/core.c:1221 [inline]
 cfg80211_netdev_notifier_call+0x9e8/0x12c0 net/wireless/core.c:1335
 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83
 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2040
 call_netdevice_notifiers_extack net/core/dev.c:2052 [inline]
 call_netdevice_notifiers net/core/dev.c:2066 [inline]
 __dev_close_many+0xee/0x2e0 net/core/dev.c:1586
 __dev_close net/core/dev.c:1624 [inline]
 __dev_change_flags+0x2cb/0x730 net/core/dev.c:8476
 dev_change_flags+0x8a/0x160 net/core/dev.c:8549
 dev_ifsioc+0x210/0xa70 net/core/dev_ioctl.c:265
 dev_ioctl+0x1b1/0xc40 net/core/dev_ioctl.c:511
 sock_do_ioctl+0x148/0x2d0 net/socket.c:1060
 sock_ioctl+0x477/0x6a0 net/socket.c:1177
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported-by: syzbot+93976391bf299d425f44@syzkaller.appspotmail.com
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Link: https://lore.kernel.org/r/20210213133653.367130-1-markus.theil@tu-ilmenau.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-12 12:53:32 +08:00
..
6lowpan Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
9p net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid 2021-03-16 16:39:51 +08:00
802 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
8021q net: vlan: avoid leaks on register_vlan_dev() failures 2021-04-12 12:51:15 +08:00
appletalk appletalk: Fix atalk_proc_init() return path 2021-03-16 16:33:09 +08:00
atm atm: fix a memory leak of vcc->user_back 2021-03-16 16:37:15 +08:00
ax25 AX.25: Prevent integer overflows in connect and sendmsg 2021-03-16 16:32:42 +08:00
batman-adv batman-adv: set .owner to THIS_MODULE 2021-03-16 16:41:41 +08:00
bluetooth Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data 2021-04-12 12:52:46 +08:00
bpf Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bpfilter net/bpfilter: remove superfluous testing message 2021-03-16 16:26:23 +08:00
bridge net: bridge: use switchdev for port flags set through sysfs too 2021-04-12 12:52:45 +08:00
caif Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
can can: af_can: can_rx_unregister(): remove WARN() statement from list operation sanity check 2021-03-16 16:42:06 +08:00
ceph libceph: clear con->out_msg on Policy::stateful_server faults 2021-03-16 16:40:11 +08:00
core can: dev: Move device back to init netns on owning netns delete 2021-04-12 12:53:32 +08:00
dcb net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands 2021-04-12 12:51:30 +08:00
dccp dccp: Fix possible memleak in dccp_init and dccp_fini 2021-03-16 16:29:07 +08:00
decnet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dns_resolver KEYS: Don't write out to userspace while holding key semaphore 2021-03-16 16:26:42 +08:00
dsa net: dsa: tag_mtk: fix 802.1ad VLAN egress 2021-04-12 12:53:14 +08:00
ethernet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hsr hsr: check protocol version in hsr_newlink() 2021-03-16 16:26:20 +08:00
ieee802154 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ife Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ipv4 Revert "netfilter: x_tables: Update remaining dereference to RCU" 2021-04-12 12:53:31 +08:00
ipv6 Revert "netfilter: x_tables: Update remaining dereference to RCU" 2021-04-12 12:53:31 +08:00
iucv net/af_iucv: remove WARN_ONCE on malformed RX packets 2021-04-12 12:52:44 +08:00
kcm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
key af_key: relax availability checks for skb size calculation 2021-04-12 12:51:58 +08:00
l2tp l2tp: remove skb_dst_set() from l2tp_xmit_skb() 2021-03-16 16:31:43 +08:00
l3mdev Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lapb net: lapb: Copy the skb before sending a packet 2021-04-12 12:51:53 +08:00
llc net: silence data-races on sk_backlog.tail 2021-03-16 16:36:36 +08:00
mac80211 mac80211: fix double free in ibss_leave 2021-04-12 12:53:32 +08:00
mac802154 mac802154: tx: fix use-after-free 2021-03-16 16:37:33 +08:00
mpls net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 2021-04-12 12:52:56 +08:00
ncsi net/ncsi: Use real net-device for response handler 2021-04-12 12:51:08 +08:00
netfilter netfilter: x_tables: Use correct memory barriers. 2021-04-12 12:53:31 +08:00
netlabel cipso,calipso: resolve a number of problems with the DOI refcounts 2021-04-12 12:52:59 +08:00
netlink genetlink: remove genl_bind 2021-03-16 16:31:42 +08:00
netrom net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node 2021-03-16 16:26:51 +08:00
nfc NFC: fix possible resource leak 2021-04-12 12:51:48 +08:00
nsh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openvswitch net: openvswitch: ensure LSE is pullable before reading it 2021-03-16 16:41:57 +08:00
packet af_packet: TPACKET_V3: fix fill status rwlock imbalance 2021-03-16 16:33:48 +08:00
phonet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
psample Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
qrtr net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() 2021-04-12 12:53:32 +08:00
rds net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS 2021-04-12 12:52:06 +08:00
rfkill rfkill: Fix use-after-free in rfkill_resume() 2021-03-16 16:41:16 +08:00
rose rose: Fix Null pointer dereference in rose_send_frame() 2021-03-16 16:41:52 +08:00
rxrpc rxrpc: Fix clearance of Tx/Rx ring when releasing a call 2021-04-12 12:52:05 +08:00
sched net: sched: validate stab values 2021-04-12 12:53:27 +08:00
sctp net: fix iteration for sctp transport seq_files 2021-04-12 12:52:06 +08:00
smc net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() 2021-03-16 16:41:07 +08:00
strparser Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sunrpc sunrpc: fix refcount leak for rpc auth modules 2021-04-12 12:53:17 +08:00
switchdev net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP 2021-04-12 12:51:48 +08:00
tipc tipc: fix NULL deref in tipc_link_xmit() 2021-04-12 12:51:31 +08:00
tls net/tls: Protect from calling tls_dev_del for TLS RX twice 2021-03-16 16:41:52 +08:00
toa Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
unix skbuff: fix a data race in skb_queue_len() 2021-03-16 16:36:50 +08:00
vmw_vsock vsock: fix locking in vsock_shutdown() 2021-04-12 12:52:06 +08:00
wimax Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
wireless wext: fix NULL-ptr-dereference with cfg80211's lack of commit() 2021-04-12 12:51:43 +08:00
x25 net/x25: prevent a couple of overflows 2021-03-16 16:41:56 +08:00
xdp xsk: Replace datagram_poll by sock_poll_wait 2021-03-16 16:42:25 +08:00
xfrm xfrm: interface: use icmp_ndo_send helper 2021-04-12 12:52:42 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
compat.c net/compat: Add missing sock updates for SCM_RIGHTS 2021-03-16 16:34:05 +08:00
socket.c net: Set fput_needed iff FDPUT_FPUT is set 2021-03-16 16:33:49 +08:00
sysctl_net.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00