syzbot


KASAN: use-after-free Read in rtl8712_dl_fw
Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+c55162be492189fb4f51@syzkaller.appspotmail.com
Fix commit: c052cc1a069c staging: rtl8712: fix use-after-free in rtl8712_dl_fw
First crash: 221d, last: 193d
Patch testing requests:
Created Duration User Patch Repo Result
2021/10/19 20:49 16m paskripkin@gmail.com patch https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing OK

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in rtl871x_open_fw drivers/staging/rtl8712/hal_init.c:83 [inline]
BUG: KASAN: use-after-free in rtl8712_dl_fw+0xd95/0xe10 drivers/staging/rtl8712/hal_init.c:170
Read of size 8 at addr ffff88810a2a6d00 by task dhcpcd/1203

CPU: 1 PID: 1203 Comm: dhcpcd Not tainted 5.15.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:256
 __kasan_report mm/kasan/report.c:442 [inline]
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
 rtl871x_open_fw drivers/staging/rtl8712/hal_init.c:83 [inline]
 rtl8712_dl_fw+0xd95/0xe10 drivers/staging/rtl8712/hal_init.c:170
 rtl8712_hal_init drivers/staging/rtl8712/hal_init.c:330 [inline]
 rtl871x_hal_init+0xae/0x180 drivers/staging/rtl8712/hal_init.c:394
 netdev_open+0xe6/0x6c0 drivers/staging/rtl8712/os_intfs.c:380
 __dev_open+0x2bc/0x4d0 net/core/dev.c:1484
 __dev_change_flags+0x583/0x750 net/core/dev.c:8761
 dev_change_flags+0x93/0x170 net/core/dev.c:8832
 devinet_ioctl+0x15d1/0x1ca0 net/ipv4/devinet.c:1142
 inet_ioctl+0x1e6/0x320 net/ipv4/af_inet.c:971
 sock_do_ioctl+0xcc/0x230 net/socket.c:1118
 sock_ioctl+0x2f1/0x640 net/socket.c:1235
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f06c6d7c0e7
Code: 3c 1c e8 1c ff ff ff 85 c0 79 87 49 c7 c4 ff ff ff ff 5b 5d 4c 89 e0 41 5c c3 66 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 61 9d 0c 00 f7 d8 64 89 01 48
RSP: 002b:00007fff6b4c61c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f06c6c8e6c8 RCX: 00007f06c6d7c0e7
RDX: 00007fff6b4d63b8 RSI: 0000000000008914 RDI: 0000000000000005
RBP: 00007fff6b4e6568 R08: 00007fff6b4d6378 R09: 00007fff6b4d6328
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff6b4d63b8 R14: 0000000000000028 R15: 0000000000008914

Allocated by task 55:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0x7c/0x90 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 _request_firmware_prepare drivers/base/firmware_loader/main.c:732 [inline]
 _request_firmware+0x192/0x1440 drivers/base/firmware_loader/main.c:808
 request_firmware_work_func+0xdd/0x230 drivers/base/firmware_loader/main.c:1079
 process_one_work+0x9bf/0x1620 kernel/workqueue.c:2297
 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444
 kthread+0x3c2/0x4a0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Freed by task 7:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360
 ____kasan_slab_free mm/kasan/common.c:366 [inline]
 ____kasan_slab_free mm/kasan/common.c:328 [inline]
 __kasan_slab_free+0xe0/0x110 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1700 [inline]
 slab_free_freelist_hook mm/slub.c:1725 [inline]
 slab_free mm/slub.c:3483 [inline]
 kfree+0xd9/0x460 mm/slub.c:4543
 release_firmware+0x1b/0x30 drivers/base/firmware_loader/main.c:1053
 r871xu_dev_remove+0xcc/0x2c0 drivers/staging/rtl8712/usb_intf.c:599
 usb_unbind_interface+0x1d8/0x8d0 drivers/usb/core/driver.c:458
 __device_release_driver+0x5d7/0x700 drivers/base/dd.c:1205
 device_release_driver_internal drivers/base/dd.c:1236 [inline]
 device_release_driver+0x26/0x40 drivers/base/dd.c:1259
 bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:529
 device_del+0x502/0xd60 drivers/base/core.c:3583
 usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1419
 usb_disconnect.cold+0x27a/0x78e drivers/usb/core/hub.c:2225
 hub_port_connect drivers/usb/core/hub.c:5199 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5488 [inline]
 port_event drivers/usb/core/hub.c:5634 [inline]
 hub_event+0x1c9c/0x4330 drivers/usb/core/hub.c:5716
 process_one_work+0x9bf/0x1620 kernel/workqueue.c:2297
 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444
 kthread+0x3c2/0x4a0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff88810a2a6d00
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
 32-byte region [ffff88810a2a6d00, ffff88810a2a6d20)
The buggy address belongs to the page:
page:ffffea000428a980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a2a6
flags: 0x200000000000200(slab|node=0|zone=2)
raw: 0200000000000200 0000000000000000 0000000100000001 ffff888100041500
raw: 0000000000000000 0000000000400040 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 4281956844, free_ts 0
 prep_new_page mm/page_alloc.c:2424 [inline]
 get_page_from_freelist+0x11d2/0x28b0 mm/page_alloc.c:4153
 __alloc_pages+0x1b2/0x4e0 mm/page_alloc.c:5375
 alloc_page_interleave+0x1e/0x1b0 mm/mempolicy.c:2042
 alloc_pages+0x29f/0x300 mm/mempolicy.c:2192
 alloc_slab_page mm/slub.c:1763 [inline]
 allocate_slab mm/slub.c:1900 [inline]
 new_slab+0x319/0x490 mm/slub.c:1963
 ___slab_alloc+0xa4b/0x1170 mm/slub.c:2994
 __slab_alloc mm/slub.c:3081 [inline]
 slab_alloc_node mm/slub.c:3172 [inline]
 __kmalloc_node+0x13a/0x370 mm/slub.c:4435
 kmalloc_node include/linux/slab.h:614 [inline]
 kzalloc_node include/linux/slab.h:732 [inline]
 crypto_create_tfm_node+0x7f/0x320 crypto/api.c:449
 crypto_alloc_tfm_node+0x107/0x260 crypto/api.c:533
 digsig_init+0x1b/0x61 lib/digsig.c:261
 do_one_initcall+0x103/0x5d0 init/main.c:1304
 do_initcall_level init/main.c:1377 [inline]
 do_initcalls init/main.c:1393 [inline]
 do_basic_setup init/main.c:1412 [inline]
 kernel_init_freeable+0x6a7/0x730 init/main.c:1615
 kernel_init+0x1a/0x1d0 init/main.c:1506
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88810a2a6c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
 ffff88810a2a6c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
>ffff88810a2a6d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
                   ^
 ffff88810a2a6d80: 00 00 00 00 fc fc fc fc fa fb fb fb fc fc fc fc
 ffff88810a2a6e00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
==================================================================

Crashes (6961):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-usb 2021/10/30 12:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing c47055e943b0 098b5d53 .config log report syz C KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/10/18 23:52 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 8ef1e58783b9 24dc29db .config log report syz C KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/10/17 20:45 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 660a92a59b9e 0c5d9412 .config log report syz C KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/10/15 16:31 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 660a92a59b9e 0c5d9412 .config log report syz C KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 09:34 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 08:44 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 07:41 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 07:01 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 05:55 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 05:41 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 04:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 03:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 03:23 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 02:23 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 01:23 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/12 00:40 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 23:39 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 22:34 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 21:27 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 21:06 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 20:04 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 18:59 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 18:05 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 16:59 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 15:19 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 14:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 13:10 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 11:43 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 11:32 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 10:02 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 08:54 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 08:40 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 07:39 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 06:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 06:10 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 06:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 05:05 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 04:11 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 03:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 02:24 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 01:39 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 01:38 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 00:36 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/10 23:39 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/10/15 15:26 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 660a92a59b9e 0c5d9412 .config log report info KASAN: use-after-free Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 16:29 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: vmalloc-out-of-bounds Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/11 12:45 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: vmalloc-out-of-bounds Read in rtl8712_dl_fw
ci2-upstream-usb 2021/11/10 22:56 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 048ff8629e11 75b04091 .config log report info KASAN: vmalloc-out-of-bounds Read in rtl8712_dl_fw