syzbot


KASAN: use-after-free Write in rtl_fw_do_work (2)

Status: fixed on 2021/03/10 01:48
Subsystems: wireless
[Documentation on labels]
Reported-by: syzbot+65be4277f3c489293939@syzkaller.appspotmail.com
Fix commit: 4dfde294b979 rtlwifi: rise completion at the last step of firmware callback
First crash: 1196d, last: 1189d
Discussions (5)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 5.10 01/51] ARC: build: remove non-existing bootpImage from KBUILD_IMAGE 54 (54) 2021/01/17 16:18
[PATCH 5.10 000/145] 5.10.7-rc1 review 152 (152) 2021/01/11 19:59
[PATCH v2] rtlwifi: rise completion at the last step of firmware callback 2 (2) 2020/12/17 16:38
[PATCH] rtlwifi: rise completion at the last step of firmware callback 3 (3) 2020/12/14 05:42
KASAN: use-after-free Write in rtl_fw_do_work (2) 0 (1) 2020/12/09 15:49
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Write in rtl_fw_do_work usb wireless syz 2 1296d 1295d 0/26 closed as invalid on 2020/09/15 11:34

Sample crash report:
rtlwifi: Loading alternative firmware rtlwifi/rtl8192cufw.bin
rtlwifi: Selected firmware is not available
==================================================================
BUG: KASAN: use-after-free in rtl_fw_do_work.cold+0x68/0x6a drivers/net/wireless/realtek/rtlwifi/core.c:93
Write of size 4 at addr ffff88814688ff50 by task kworker/1:8/7523

CPU: 1 PID: 7523 Comm: kworker/1:8 Not tainted 5.10.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events request_firmware_work_func
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385
 __kasan_report mm/kasan/report.c:545 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
 rtl_fw_do_work.cold+0x68/0x6a drivers/net/wireless/realtek/rtlwifi/core.c:93
 request_firmware_work_func+0x12c/0x230 drivers/base/firmware_loader/main.c:1079
 process_one_work+0x933/0x1520 kernel/workqueue.c:2272
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
 kthread+0x38c/0x460 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

The buggy address belongs to the page:
page:00000000e9105a92 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x14688f
flags: 0x200000000000000()
raw: 0200000000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88814688fe00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88814688fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88814688ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                 ^
 ffff88814688ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888146890000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/15 06:00 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a256e24021bf 97183ed7 .config console log report info ci2-upstream-usb
2020/12/13 12:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a256e24021bf bca53db9 .config console log report info ci2-upstream-usb
2020/12/13 01:47 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a256e24021bf bca53db9 .config console log report info ci2-upstream-usb
2020/12/08 20:35 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing b175d273d4e4 40cc414d .config console log report info ci2-upstream-usb
* Struck through repros no longer work on HEAD.