================================================================== 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 ffff88810a7e6f80 by task dhcpcd/1207 CPU: 0 PID: 1207 Comm: dhcpcd Not tainted 5.15.0-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:1490 __dev_change_flags+0x583/0x750 net/core/dev.c:8790 dev_change_flags+0x93/0x170 net/core/dev.c:8861 devinet_ioctl+0x15d1/0x1ca0 net/ipv4/devinet.c:1144 inet_ioctl+0x1e6/0x320 net/ipv4/af_inet.c:969 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:0x7f86bf5500e7 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:00007ffcb35d0ea8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f86bf4626c8 RCX: 00007f86bf5500e7 RDX: 00007ffcb35e1098 RSI: 0000000000008914 RDI: 0000000000000005 RBP: 00007ffcb35f1248 R08: 00007ffcb35e1058 R09: 00007ffcb35e1008 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcb35e1098 R14: 0000000000000028 R15: 0000000000008914 Allocated by task 7: 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+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x40b/0x500 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 23: 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:235 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook mm/slub.c:1726 [inline] slab_free mm/slub.c:3492 [inline] kfree+0xd9/0x470 mm/slub.c:4552 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+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x40b/0x500 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88810a7e6f80 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff88810a7e6f80, ffff88810a7e6fa0) The buggy address belongs to the page: page:ffffea000429f980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a7e6 flags: 0x200000000000200(slab|node=0|zone=2) raw: 0200000000000200 ffffea0004e0e840 0000000900000009 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 5033902928, free_ts 4682915501 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1254/0x2980 mm/page_alloc.c:4155 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5381 alloc_page_interleave+0x1e/0x1e0 mm/mempolicy.c:2036 alloc_pages+0x29f/0x300 mm/mempolicy.c:2186 alloc_slab_page mm/slub.c:1770 [inline] allocate_slab mm/slub.c:1907 [inline] new_slab+0x319/0x490 mm/slub.c:1970 ___slab_alloc+0x8b9/0xfa0 mm/slub.c:3001 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3088 slab_alloc_node mm/slub.c:3179 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x2ee/0x310 mm/slub.c:4396 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] kobject_get_path+0xbe/0x230 lib/kobject.c:179 kobject_uevent_env+0x265/0x1650 lib/kobject_uevent.c:529 driver_register+0x2db/0x3a0 drivers/base/driver.c:179 init+0x552/0xba7 drivers/char/agp/amd64-agp.c:766 do_one_initcall+0x103/0x650 init/main.c:1295 do_initcall_level init/main.c:1368 [inline] do_initcalls init/main.c:1384 [inline] do_basic_setup init/main.c:1403 [inline] kernel_init_freeable+0x6ac/0x735 init/main.c:1606 kernel_init+0x1a/0x1d0 init/main.c:1497 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare+0x315/0x710 mm/page_alloc.c:1391 free_unref_page_prepare mm/page_alloc.c:3317 [inline] free_unref_page+0x19/0x580 mm/page_alloc.c:3396 __vunmap+0x781/0xb70 mm/vmalloc.c:2621 free_work+0x58/0x70 mm/vmalloc.c:95 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x40b/0x500 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88810a7e6e80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88810a7e6f00: 00 00 00 02 fc fc fc fc 00 00 00 02 fc fc fc fc >ffff88810a7e6f80: fa fb fb fb fc fc fc fc 00 00 00 02 fc fc fc fc ^ ffff88810a7e7000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810a7e7080: 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 ==================================================================