KASAN: slab-out-of-bounds Read in ieee80211_key_free

13 views
Skip to first unread message

syzbot

unread,
Nov 18, 2020, 7:51:17 AM11/18/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 31acccdc Linux 4.19.157
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=145b0c7a500000
kernel config: https://syzkaller.appspot.com/x/.config?x=1f604e014c43fe09
dashboard link: https://syzkaller.appspot.com/bug?extid=fd7dd3e81f26543282c3
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=179466e2500000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16d2581c500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+fd7dd3...@syzkaller.appspotmail.com

IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50
wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50
IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
==================================================================
BUG: KASAN: slab-out-of-bounds in ieee80211_key_free+0xf0/0x110 net/mac80211/key.c:722
Read of size 2 at addr ffff8880a8fd0928 by task syz-executor582/8182

CPU: 1 PID: 8182 Comm: syz-executor582 Not tainted 4.19.157-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load2_noabort+0x88/0x90 mm/kasan/report.c:431
ieee80211_key_free+0xf0/0x110 net/mac80211/key.c:722
ieee80211_del_key+0x162/0x3d0 net/mac80211/cfg.c:498
rdev_del_key net/wireless/rdev-ops.h:106 [inline]
nl80211_del_key+0x43e/0xc20 net/wireless/nl80211.c:3656
genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602
genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627
netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
genl_rcv+0x24/0x40 net/netlink/genetlink.c:638
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
sock_sendmsg_nosec net/socket.c:622 [inline]
sock_sendmsg+0xc3/0x120 net/socket.c:632
___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115
__sys_sendmsg net/socket.c:2153 [inline]
__do_sys_sendmsg net/socket.c:2162 [inline]
__se_sys_sendmsg net/socket.c:2160 [inline]
__x64_sys_sendmsg+0x132/0x220 net/socket.c:2160
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441ff9
Code: e8 ac 00 03 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd9ede8438 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441ff9
RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000001d00000000 R09: 0000001d00000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000009422
R13: 0000000000000000 R14: 000000000000000c R15: 0000000000000004

Allocated by task 8133:
__do_kmalloc mm/slab.c:3727 [inline]
__kmalloc_track_caller+0x155/0x3c0 mm/slab.c:3742
kstrdup+0x36/0x70 mm/util.c:56
kstrdup_const+0x53/0x80 mm/util.c:77
__kernfs_new_node+0x9b/0x680 fs/kernfs/dir.c:629
kernfs_new_node+0x92/0x120 fs/kernfs/dir.c:693
kernfs_create_link+0xd1/0x228 fs/kernfs/symlink.c:40
sysfs_do_create_link_sd+0x90/0x130 fs/sysfs/symlink.c:43
sysfs_do_create_link fs/sysfs/symlink.c:79 [inline]
sysfs_create_link+0x5f/0xc0 fs/sysfs/symlink.c:91
driver_sysfs_add+0x102/0x350 drivers/base/dd.c:370
device_bind_driver+0x15/0xd0 drivers/base/dd.c:424
mac80211_hwsim_new_radio+0x3c7/0x3c60 drivers/net/wireless/mac80211_hwsim.c:2687
hwsim_new_radio_nl+0x5c3/0x850 drivers/net/wireless/mac80211_hwsim.c:3374
genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602
genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627
netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
genl_rcv+0x24/0x40 net/netlink/genetlink.c:638
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
sock_sendmsg_nosec net/socket.c:622 [inline]
sock_sendmsg+0xc3/0x120 net/socket.c:632
__sys_sendto+0x21a/0x320 net/socket.c:1787
__do_sys_sendto net/socket.c:1799 [inline]
__se_sys_sendto net/socket.c:1795 [inline]
__x64_sys_sendto+0xdd/0x1b0 net/socket.c:1795
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 3539:
__cache_free mm/slab.c:3503 [inline]
kfree+0xcc/0x210 mm/slab.c:3822
rh_call_control drivers/usb/core/hcd.c:728 [inline]
rh_urb_enqueue drivers/usb/core/hcd.c:838 [inline]
usb_hcd_submit_urb+0xb93/0x23c0 drivers/usb/core/hcd.c:1651
usb_submit_urb+0xb2f/0x13b0 drivers/usb/core/urb.c:571
usb_start_wait_urb+0x108/0x4c0 drivers/usb/core/message.c:57
usb_internal_control_msg drivers/usb/core/message.c:101 [inline]
usb_control_msg+0x31c/0x4a0 drivers/usb/core/message.c:152
set_port_feature drivers/usb/core/hub.c:430 [inline]
hub_suspend+0x979/0xb80 drivers/usb/core/hub.c:3700
usb_suspend_interface drivers/usb/core/driver.c:1204 [inline]
usb_suspend_both+0x260/0x830 drivers/usb/core/driver.c:1309
usb_runtime_suspend+0x42/0x140 drivers/usb/core/driver.c:1847
__rpm_callback+0x1ee/0x830 drivers/base/power/runtime.c:333
rpm_callback+0x18f/0x230 drivers/base/power/runtime.c:463
rpm_suspend+0x3b4/0x1500 drivers/base/power/runtime.c:595
__pm_runtime_suspend+0xbb/0x150 drivers/base/power/runtime.c:1008
pm_runtime_autosuspend include/linux/pm_runtime.h:195 [inline]
usb_runtime_idle+0x44/0x60 drivers/usb/core/driver.c:1884
__rpm_callback+0x1ee/0x830 drivers/base/power/runtime.c:333
rpm_idle+0x200/0x970 drivers/base/power/runtime.c:425
pm_runtime_work+0x13e/0x180 drivers/base/power/runtime.c:873
process_one_work+0x864/0x1570 kernel/workqueue.c:2155
worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
kthread+0x33f/0x460 kernel/kthread.c:259
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff8880a8fd0900
which belongs to the cache kmalloc-32 of size 32
The buggy address is located 8 bytes to the right of
32-byte region [ffff8880a8fd0900, ffff8880a8fd0920)
The buggy address belongs to the page:
page:ffffea0002a3f400 count:1 mapcount:0 mapping:ffff88813bff01c0 index:0xffff8880a8fd0fc1
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002a46508 ffffea0002a3f5c8 ffff88813bff01c0
raw: ffff8880a8fd0fc1 ffff8880a8fd0000 000000010000003f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a8fd0800: 00 fc fc fc fc fc fc fc 00 fc fc fc fc fc fc fc
ffff8880a8fd0880: 05 fc fc fc fc fc fc fc 00 fc fc fc fc fc fc fc
>ffff8880a8fd0900: 07 fc fc fc fc fc fc fc 05 fc fc fc fc fc fc fc
^
ffff8880a8fd0980: 07 fc fc fc fc fc fc fc 07 fc fc fc fc fc fc fc
ffff8880a8fd0a00: 00 02 fc fc fc fc fc fc 07 fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages