syzbot


KASAN: use-after-free Read in rtw_load_firmware_cb

Status: fixed on 2024/10/22 11:57
Subsystems: usb wireless
[Documentation on labels]
Reported-by: syzbot+6c6c08700f9480c41fe3@syzkaller.appspotmail.com
Fix commit: 0e735a4c6137 wifi: rtw88: always wait for both firmware loading attempts
First crash: 130d, last: 67d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] wifi: rtw88: always wait for both firmware loading attempts 2 (2) 2024/08/02 01:31
[syzbot] [wireless?] [usb?] KASAN: use-after-free Read in rtw_load_firmware_cb 1 (4) 2024/07/26 17:14
Last patch testing requests (2)
Created Duration User Patch Repo Result
2024/07/26 12:26 1h46m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git 933069701c1b OK log
2024/07/26 03:10 11m lizhi.xu@windriver.com patch https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git 933069701c1b report log

Sample crash report:
rtw_8822cu 1-1:15.79: Direct firmware load for rtw88/rtw8822c_wow_fw.bin failed with error -2
==================================================================
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 ffff888113218bc0 by task kworker/1:0/24

CPU: 1 UID: 0 PID: 24 Comm: kworker/1:0 Not tainted 6.10.0-syzkaller-g933069701c1b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Workqueue: events request_firmware_work_func
Call Trace:
 <TASK>
 __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/0xf20 kernel/workqueue.c:3390
 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
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88811321e000 pfn:0x113218
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff88811321e000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 4, migratetype Unmovable, gfp_mask 0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), pid 800, tgid 800 (kworker/1:2), ts 45650744583, free_ts 45694748540
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493
 prep_new_page mm/page_alloc.c:1501 [inline]
 get_page_from_freelist+0x1311/0x25f0 mm/page_alloc.c:3438
 __alloc_pages_noprof+0x21e/0x2290 mm/page_alloc.c:4696
 __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:4103
 __kmalloc_large_node_noprof+0x1c/0x70 mm/slub.c:4130
 __do_kmalloc_node mm/slub.c:4146 [inline]
 __kmalloc_noprof.cold+0xc/0x61 mm/slub.c:4170
 kmalloc_noprof include/linux/slab.h:685 [inline]
 kzalloc_noprof include/linux/slab.h:807 [inline]
 wiphy_new_nm+0x701/0x2120 net/wireless/core.c:477
 ieee80211_alloc_hw_nm+0x1b7a/0x2260 net/mac80211/main.c:828
 ieee80211_alloc_hw include/net/mac80211.h:4857 [inline]
 rtw_usb_probe+0x32/0x1d80 drivers/net/wireless/realtek/rtw88/usb.c:853
 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:656
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:798
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:956
 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457
 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1028
page last free pid 800 tgid 800 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1094 [inline]
 __free_pages_ok+0x5c1/0xba0 mm/page_alloc.c:1214
 __folio_put+0x1dc/0x260 mm/swap.c:128
 device_release+0xa1/0x240 drivers/base/core.c:2581
 kobject_cleanup lib/kobject.c:689 [inline]
 kobject_release lib/kobject.c:720 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x1fa/0x5b0 lib/kobject.c:737
 put_device+0x1f/0x30 drivers/base/core.c:3787
 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:656
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:798
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:956
 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457
 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1028
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532
 device_add+0x114b/0x1a70 drivers/base/core.c:3679
 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210

Memory state around the buggy address:
 ffff888113218a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888113218b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888113218b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                           ^
 ffff888113218c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888113218c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (848):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/25 19:56 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 933069701c1b 466a14e5 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/07/25 17:45 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 933069701c1b 466a14e5 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/07/25 15:32 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 933069701c1b 466a14e5 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/07/25 13:32 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 933069701c1b 466a14e5 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/27 01:56 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/26 13:14 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/26 06:58 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/26 05:20 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/26 04:06 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/25 22:10 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/25 17:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/25 11:36 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/25 04:41 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/24 23:59 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/24 19:11 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/24 16:04 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/24 08:45 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/24 06:59 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/24 05:25 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/24 01:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/23 21:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/23 19:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/23 12:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/23 09:06 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/23 06:34 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/23 00:52 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/22 14:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/22 11:45 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/22 03:37 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/21 23:33 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/21 14:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/21 09:10 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/20 23:59 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/20 22:42 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/20 18:02 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/20 15:29 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/20 14:29 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/20 02:57 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/19 23:02 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/19 21:40 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/19 19:31 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/19 09:32 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/19 05:19 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/19 03:43 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/19 02:35 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/18 20:22 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/18 00:24 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/17 18:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/17 16:49 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/17 12:27 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in rtw_load_firmware_cb
2024/09/26 18:26 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb general protection fault in rtw_load_firmware_cb
2024/09/08 23:24 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9c0c11bb87b0 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb general protection fault in rtw_load_firmware_cb
* Struck through repros no longer work on HEAD.