KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status (2)

Status: auto-closed as invalid on 2022/04/19 20:25
First crash: 852d, last: 852d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status 7 1070d 1202d 0/1 auto-closed as invalid on 2021/09/14 14:45
linux-4.19 KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status 2 1325d 1328d 0/1 auto-closed as invalid on 2021/01/02 08:21
linux-4.19 KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status (2) C error 50 416d 1103d 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 usb 3 1691d 1698d 0/26 auto-closed as invalid on 2020/01/01 21:24
upstream KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status (2) usb C inconclusive 116 838d 1321d 20/26 fixed on 2022/03/08 16:11

Sample crash report:
usb usb9: usbfs: process 14415 (syz-executor.1) did not claim interface 0 before use
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 ffff8880abf28e00 by task syz-executor.5/14417

CPU: 0 PID: 14417 Comm: syz-executor.5 Not tainted 4.14.258-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __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
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x50/0x80 kernel/locking/spinlock.c:200
RSP: 0018:ffff8880656b7e58 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff10
RAX: 1ffffffff11e127b RBX: ffff88809bdec8d8 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff88809bdeca04
RBP: ffff88809bdec948 R08: ffffffff8b99fa30 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88809bdec180
R13: 0000000000000000 R14: ffff8880ac3d9d40 R15: ffff8880ac3d9d40
 task_work_run+0xfd/0x190 kernel/task_work.c:106
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
RIP: 0033:0x7f8cb12fce99
RSP: 002b:00007f8cafc72168 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 00007f8cb140ff60 RCX: 00007f8cb12fce99
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007f8cb1356ff1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffcf7a7836f R14: 00007f8cafc72300 R15: 0000000000022000

Allocated by task 14415:
 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_bulk+0x257/0x6d0 drivers/usb/core/devio.c:1209
 usbdev_do_ioctl+0x5b0/0x2b70 drivers/usb/core/devio.c:2449
 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

Freed by task 7982:
 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
 kvfree+0x45/0x50 mm/util.c:416
 __vunmap+0x20f/0x300 mm/vmalloc.c:1548
 vfree+0x4b/0xd0 mm/vmalloc.c:1612
 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:886 [inline]
 get_entries net/ipv6/netfilter/ip6_tables.c:1045 [inline]
 do_ip6t_get_ctl+0x5fc/0x7d0 net/ipv6/netfilter/ip6_tables.c:1716
 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline]
 nf_getsockopt+0x62/0xc0 net/netfilter/nf_sockopt.c:122
 ipv6_getsockopt+0x146/0x1e0 net/ipv6/ipv6_sockglue.c:1376
 tcp_getsockopt+0x7b/0xc0 net/ipv4/tcp.c:3257
 SYSC_getsockopt net/socket.c:1896 [inline]
 SyS_getsockopt+0x102/0x1c0 net/socket.c:1878
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292

The buggy address belongs to the object at ffff8880abf28e00
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
 32-byte region [ffff8880abf28e00, ffff8880abf28e20)
The buggy address belongs to the page:
page:ffffea0002afca00 count:1 mapcount:0 mapping:ffff8880abf28000 index:0xffff8880abf28fc1
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880abf28000 ffff8880abf28fc1 000000010000003f
raw: ffffea0002a5ad60 ffff88813fe75248 ffff88813fe741c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880abf28d00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
 ffff8880abf28d80: fb fb fb fb fc fc fc fc 00 fc fc fc fc fc fc fc
>ffff8880abf28e00: 01 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc
 ffff8880abf28e80: fb fb fb fb fc fc fc fc 00 03 fc fc fc fc fc fc
 ffff8880abf28f00: 05 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/20 20:24 linux-4.14.y 9dfbac0e6b86 62bd192b .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Write in usb_hcd_poll_rh_status
* Struck through repros no longer work on HEAD.