syzbot


KASAN: slab-out-of-bounds Read in p54u_load_firmware_cb

Status: closed as dup on 2019/08/13 13:28
Subsystems: wireless usb
[Documentation on labels]
Reported-by: syzbot+6d237e74cdc13f036473@syzkaller.appspotmail.com
First crash: 2018d, last: 1941d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: use-after-free Read in p54u_load_firmware_cb wireless usb syz 40 1933d 2016d
Discussions (6)
Title Replies (including bot) Last reply
KASAN: slab-out-of-bounds Read in p54u_load_firmware_cb 5 (7) 2019/08/13 13:27
Reminder: 11 open syzbot bugs in "net/wireless" subsystem 1 (1) 2019/07/24 01:47
Reminder: 67 open syzbot bugs in usb subsystem 1 (1) 2019/07/24 01:35
Reminder: 47 open syzbot bugs in usb subsystem 1 (1) 2019/07/09 19:01
Reminder: 12 open syzbot bugs in "net/wireless" subsystem 1 (1) 2019/06/25 05:51
Reminder: 42 open syzbot bugs in usb subsystem 1 (1) 2019/06/25 03:44

Sample crash report:
usb 3-1: Direct firmware load for isl3887usb failed with error -2
usb 3-1: Firmware not found.
==================================================================
BUG: KASAN: slab-out-of-bounds in p54u_load_firmware_cb.cold+0x97/0x13d drivers/net/wireless/intersil/p54/p54usb.c:936
Read of size 8 at addr ffff8881c9cf7588 by task kworker/1:5/2759

CPU: 1 PID: 2759 Comm: kworker/1:5 Not tainted 5.2.0-rc5+ #11
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+0xca/0x13e lib/dump_stack.c:113
 print_address_description+0x67/0x231 mm/kasan/report.c:188
 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:317
 kasan_report+0xe/0x20 mm/kasan/common.c:614
 p54u_load_firmware_cb.cold+0x97/0x13d drivers/net/wireless/intersil/p54/p54usb.c:936
 request_firmware_work_func+0x126/0x242 drivers/base/firmware_loader/main.c:785
 process_one_work+0x905/0x1570 kernel/workqueue.c:2269
 worker_thread+0x96/0xe20 kernel/workqueue.c:2415
 kthread+0x30b/0x410 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 1612:
 save_stack+0x1b/0x80 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:462
 kmalloc include/linux/slab.h:547 [inline]
 syslog_print kernel/printk/printk.c:1346 [inline]
 do_syslog kernel/printk/printk.c:1519 [inline]
 do_syslog+0x4f4/0x12e0 kernel/printk/printk.c:1493
 kmsg_read+0x8a/0xb0 fs/proc/kmsg.c:40
 proc_reg_read+0x1c1/0x280 fs/proc/inode.c:221
 __vfs_read+0x76/0x100 fs/read_write.c:425
 vfs_read+0x18e/0x3d0 fs/read_write.c:461
 ksys_read+0x127/0x250 fs/read_write.c:587
 do_syscall_64+0xb7/0x560 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 1612:
 save_stack+0x1b/0x80 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x130/0x180 mm/kasan/common.c:451
 slab_free_hook mm/slub.c:1421 [inline]
 slab_free_freelist_hook mm/slub.c:1448 [inline]
 slab_free mm/slub.c:2994 [inline]
 kfree+0xd7/0x280 mm/slub.c:3949
 syslog_print kernel/printk/printk.c:1405 [inline]
 do_syslog kernel/printk/printk.c:1519 [inline]
 do_syslog+0xff3/0x12e0 kernel/printk/printk.c:1493
 kmsg_read+0x8a/0xb0 fs/proc/kmsg.c:40
 proc_reg_read+0x1c1/0x280 fs/proc/inode.c:221
 __vfs_read+0x76/0x100 fs/read_write.c:425
 vfs_read+0x18e/0x3d0 fs/read_write.c:461
 ksys_read+0x127/0x250 fs/read_write.c:587
 do_syscall_64+0xb7/0x560 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8881c9cf7180
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 8 bytes to the right of
 1024-byte region [ffff8881c9cf7180, ffff8881c9cf7580)
The buggy address belongs to the page:
page:ffffea0007273d00 refcount:1 mapcount:0 mapping:ffff8881dac02a00 index:0x0 compound_mapcount: 0
flags: 0x200000000010200(slab|head)
raw: 0200000000010200 dead000000000100 dead000000000200 ffff8881dac02a00
raw: 0000000000000000 00000000000e000e 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881c9cf7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881c9cf7500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881c9cf7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff8881c9cf7600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881c9cf7680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/20 02:19 https://github.com/google/kasan.git usb-fuzzer 9939f56ee6c0 34bf9440 .config console log report syz ci2-upstream-usb
2019/07/21 04:24 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 1656845f .config console log report ci2-upstream-usb
2019/07/20 16:14 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 1656845f .config console log report ci2-upstream-usb
2019/07/17 12:31 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 0d10349c .config console log report ci2-upstream-usb
2019/07/11 03:01 https://github.com/google/kasan.git usb-fuzzer 7829a896a587 ff7bf04c .config console log report ci2-upstream-usb
2019/07/09 07:20 https://github.com/google/kasan.git usb-fuzzer 7829a896a587 f62e1e85 .config console log report ci2-upstream-usb
2019/05/31 00:59 https://github.com/google/kasan.git usb-fuzzer 69bbe8c72e6f d9aaf3c2 .config console log report ci2-upstream-usb
2019/05/05 05:43 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce d28f4ce5 .config console log report ci2-upstream-usb
* Struck through repros no longer work on HEAD.