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

6 views
Skip to first unread message

syzbot

unread,
Dec 20, 2021, 3:25:22 PM12/20/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9dfbac0e6b86 Linux 4.14.258
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15711b99b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9cac3dc48a267418
dashboard link: https://syzkaller.appspot.com/bug?extid=b081ff95cf054e8cab1f
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b081ff...@syzkaller.appspotmail.com

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:
<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:__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
entry_SYSCALL_64_after_hwframe+0x46/0xbb
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
entry_SYSCALL_64_after_hwframe+0x46/0xbb

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
entry_SYSCALL_64_after_hwframe+0x46/0xbb

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
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Apr 19, 2022, 4:25:18 PM4/19/22
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages