================================================================== BUG: KASAN: use-after-free in rtw_load_firmware_cb+0x917/0x9f0 drivers/net/wireless/realtek/rtw88/main.c:1764 Read of size 8 at addr ffff888105778bc0 by task kworker/0:5/4931 CPU: 0 UID: 0 PID: 4931 Comm: kworker/0:5 Not tainted 6.11.0-rc7-syzkaller-00152-g68d4209158f4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: events request_firmware_work_func Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 rtw_load_firmware_cb+0x917/0x9f0 drivers/net/wireless/realtek/rtw88/main.c:1764 request_firmware_work_func+0x13a/0x250 drivers/base/firmware_loader/main.c:1167 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888105776608 pfn:0x105778 head: order:4 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000000040(head|node=0|zone=2) raw: 0200000000000000 ffffea000415dc01 dead000000000122 dead000000000400 raw: ffff888105779100 0000000000000000 00000000ffffffff 0000000000000000 head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000 head: ffff888105776600 0000000000000000 00000001ffffffff 0000000000000000 head: 0200000000000004 ffffea000415dc01 ffffffffffffffff 0000000000000000 head: 0000000000000010 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 4, migratetype Unmovable, gfp_mask 0x140cc0(GFP_USER|__GFP_COMP), pid 4937, tgid 4937 (kworker/1:3), ts 632175140367, free_ts 632038055228 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1311/0x25f0 mm/page_alloc.c:3446 __alloc_pages_noprof+0x21e/0x2290 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] ___kmalloc_large_node+0x7f/0x1a0 mm/slub.c:4107 __kmalloc_large_node_noprof+0x1c/0x70 mm/slub.c:4134 __do_kmalloc_node mm/slub.c:4150 [inline] __kmalloc_noprof.cold+0xc/0x61 mm/slub.c:4174 kmalloc_noprof include/linux/slab.h:685 [inline] usb_get_configuration+0x323/0x5e50 drivers/usb/core/config.c:931 usb_enumerate_device drivers/usb/core/hub.c:2483 [inline] usb_new_device+0x1189/0x1a10 drivers/usb/core/hub.c:2621 hub_port_connect drivers/usb/core/hub.c:5521 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2e58/0x4f40 drivers/usb/core/hub.c:5903 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 2108 tgid 2108 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] __free_pages_ok+0x5c1/0xba0 mm/page_alloc.c:1221 __folio_put+0x1dc/0x260 mm/swap.c:128 device_release+0xa1/0x240 drivers/base/core.c:2582 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1e4/0x5a0 lib/kobject.c:737 put_device+0x1f/0x30 drivers/base/core.c:3790 rtw_usb_probe+0x7a4/0x1d80 drivers/net/wireless/realtek/rtw88/usb.c:925 usb_probe_interface+0x309/0x9d0 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:578 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:657 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:799 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:957 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1029 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532 device_add+0x114b/0x1a70 drivers/base/core.c:3682 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210 Memory state around the buggy address: ffff888105778a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ffff888105778b00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe >ffff888105778b80: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ^ ffff888105778c00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ffff888105778c80: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ==================================================================