syzbot


KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status

Status: auto-closed as invalid on 2021/09/14 14:45
Reported-by: syzbot+92130a4bfe5658805cf6@syzkaller.appspotmail.com
First crash: 548d, last: 416d
similar bugs (5):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status 2 671d 674d 0/1 auto-closed as invalid on 2021/01/02 08:21
linux-4.14 KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status (2) 1 198d 198d 0/1 auto-closed as invalid on 2022/04/19 20:25
linux-4.19 KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status (2) C 47 1d10h 449d 0/1 upstream: reported C repro on 2021/04/14 12:03
upstream KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status 3 1037d 1044d 0/22 auto-closed as invalid on 2020/01/01 21:24
upstream KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status (2) C inconclusive 116 184d 667d 22/22 fixed on 2022/03/08 16:11

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:376 [inline]
BUG: KASAN: slab-out-of-bounds in usb_hcd_poll_rh_status+0x326/0x630 drivers/usb/core/hcd.c:782
Write of size 2 at addr ffff8880a9602800 by task syz-executor.5/5329

CPU: 0 PID: 5329 Comm: syz-executor.5 Not tainted 4.14.232-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report+0x6f/0x80 mm/kasan/report.c:409
 memcpy+0x35/0x50 mm/kasan/kasan.c:303
 memcpy include/linux/string.h:376 [inline]
 usb_hcd_poll_rh_status+0x326/0x630 drivers/usb/core/hcd.c:782
 call_timer_fn+0x14a/0x650 kernel/time/timer.c:1280
 expire_timers+0x232/0x4d0 kernel/time/timer.c:1319
 __run_timers kernel/time/timer.c:1637 [inline]
 run_timer_softirq+0x1d5/0x5a0 kernel/time/timer.c:1650
 __do_softirq+0x24d/0x9ff kernel/softirq.c:288
 invoke_softirq kernel/softirq.c:368 [inline]
 irq_exit+0x193/0x240 kernel/softirq.c:409
 exiting_irq arch/x86/include/asm/apic.h:638 [inline]
 smp_apic_timer_interrupt+0x141/0x5e0 arch/x86/kernel/apic/apic.c:1106
 apic_timer_interrupt+0x93/0xa0 arch/x86/entry/entry_64.S:793
 </IRQ>
RIP: 0010:__read_once_size_nocheck.constprop.0+0x0/0x10 include/linux/compiler.h:201
RSP: 0018:ffff88804303e930 EFLAGS: 00000287 ORIG_RAX: ffffffffffffff10
RAX: ffff888043040000 RBX: 1ffff11008607d28 RCX: ffffffff8a73b1e4
RDX: ffff88804303eab0 RSI: ffff88804303e960 RDI: ffff88804303f6c8
RBP: ffff88804303f6c8 R08: 0000000000000001 R09: 0000000000000001
R10: ffff88804303f6f8 R11: 0000000000000001 R12: ffff88804303ea70
R13: ffff88804303eab0 R14: ffff888043038000 R15: ffff88804303ea70
 deref_stack_reg arch/x86/kernel/unwind_orc.c:289 [inline]
 deref_stack_reg+0x124/0x1a0 arch/x86/kernel/unwind_orc.c:283
 unwind_next_frame+0xfcc/0x17d0 arch/x86/kernel/unwind_orc.c:474
 __save_stack_trace+0x90/0x160 arch/x86/kernel/stacktrace.c:44
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 slab_post_alloc_hook mm/slab.h:442 [inline]
 slab_alloc mm/slab.c:3390 [inline]
 kmem_cache_alloc+0x111/0x3c0 mm/slab.c:3550
 mempool_alloc+0x10e/0x2d0 mm/mempool.c:330
 bio_alloc_bioset+0x41b/0x830 block/bio.c:486
 bio_alloc include/linux/bio.h:422 [inline]
 io_submit_init_bio fs/ext4/page-io.c:374 [inline]
 io_submit_add_bh fs/ext4/page-io.c:399 [inline]
 ext4_bio_write_page+0x721/0x1130 fs/ext4/page-io.c:515
 mpage_submit_page+0x128/0x220 fs/ext4/inode.c:2233
 mpage_process_page_bufs+0x425/0x520 fs/ext4/inode.c:2344
 mpage_prepare_extent_to_map+0x43e/0xa10 fs/ext4/inode.c:2716
 ext4_writepages+0xf88/0x32a0 fs/ext4/inode.c:2863
 do_writepages+0xc3/0x240 mm/page-writeback.c:2361
 __filemap_fdatawrite_range+0x236/0x310 mm/filemap.c:346
 file_write_and_wait_range+0x86/0xd0 mm/filemap.c:678
 __generic_file_fsync+0x70/0x190 fs/libfs.c:985
 ext4_sync_file+0x8ed/0x12c0 fs/ext4/fsync.c:118
 vfs_fsync_range+0x103/0x260 fs/sync.c:196
 generic_write_sync include/linux/fs.h:2682 [inline]
 ext4_file_write_iter+0x5fa/0xd20 fs/ext4/file.c:281
 call_write_iter include/linux/fs.h:1778 [inline]
 do_iter_readv_writev+0x4cf/0x5f0 fs/read_write.c:675
 do_iter_write+0x152/0x550 fs/read_write.c:954
 vfs_iter_write+0x70/0xa0 fs/read_write.c:967
 iter_file_splice_write+0x52b/0xa90 fs/splice.c:749
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x115/0x160 fs/splice.c:1018
 splice_direct_to_actor+0x27c/0x730 fs/splice.c:973
 do_splice_direct+0x164/0x210 fs/splice.c:1061
 do_sendfile+0x47f/0xb30 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1496 [inline]
 SyS_sendfile64+0x9b/0x110 fs/read_write.c:1488
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x4665d9
RSP: 002b:00007f7c98915188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665d9
RDX: 0000000020000240 RSI: 0000000000000004 RDI: 0000000000000004
RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000007fff R11: 0000000000000246 R12: 000000000056bf60
R13: 00007fffd93b700f R14: 00007f7c98915300 R15: 0000000000022000

Allocated by task 5373:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15a/0x400 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 proc_do_submiturb+0x280f/0x3610 drivers/usb/core/devio.c:1684
 proc_submiturb drivers/usb/core/devio.c:1841 [inline]
 usbdev_do_ioctl+0x665/0x2b70 drivers/usb/core/devio.c:2495
 usbdev_ioctl+0x21/0x30 drivers/usb/core/devio.c:2599
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 4612:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 aa_free_task_context+0xda/0x130 security/apparmor/context.c:54
 apparmor_cred_free+0x34/0x70 security/apparmor/lsm.c:58
 security_cred_free+0x71/0xb0 security/security.c:1003
 put_cred_rcu+0xe3/0x300 kernel/cred.c:117
 __put_cred+0x1a1/0x210 kernel/cred.c:151
 put_cred include/linux/cred.h:271 [inline]
 SYSC_faccessat fs/open.c:444 [inline]
 SyS_faccessat+0x52a/0x680 fs/open.c:353
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880a9602800
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
 32-byte region [ffff8880a9602800, ffff8880a9602820)
The buggy address belongs to the page:
page:ffffea0002a58080 count:1 mapcount:0 mapping:ffff8880a9602000 index:0xffff8880a9602fc1
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880a9602000 ffff8880a9602fc1 000000010000003e
raw: ffffea0002cc4ee0 ffffea0002ae7ea0 ffff88813fe801c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a9602700: 00 01 fc fc fc fc fc fc 00 01 fc fc fc fc fc fc
 ffff8880a9602780: 00 04 fc fc fc fc fc fc 00 04 fc fc fc fc fc fc
>ffff8880a9602800: 01 fc fc fc fc fc fc fc 06 fc fc fc fc fc fc fc
                   ^
 ffff8880a9602880: 06 fc fc fc fc fc fc fc 06 fc fc fc fc fc fc fc
 ffff8880a9602900: 06 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc
==================================================================

Crashes (7):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2021/05/17 14:44 linux-4.14.y 7d7d1c0ab3eb a2eb125d .config log report info KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status
ci2-linux-4-14 2021/05/04 16:19 linux-4.14.y 7d7d1c0ab3eb 06c27ff5 .config log report info KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status
ci2-linux-4-14 2021/04/09 12:46 linux-4.14.y 0cc244011f40 6a81331a .config log report info KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status
ci2-linux-4-14 2021/03/31 13:16 linux-4.14.y bd634aa64163 6a81331a .config log report info KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status
ci2-linux-4-14 2021/03/29 20:21 linux-4.14.y 670d6552eda8 6a81331a .config log report info KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status
ci2-linux-4-14 2021/03/04 00:56 linux-4.14.y 397a88b2cc86 06ed56cd .config log report info KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status
ci2-linux-4-14 2021/01/05 09:56 linux-4.14.y 1752938529c6 2a28ff1f .config log report info