==================================================================
BUG: KASAN: slab-use-after-free in find_endpoint drivers/usb/gadget/udc/dummy_hcd.c:1618 [inline]
BUG: KASAN: slab-use-after-free in dummy_timer+0xcdb/0x4cf0 drivers/usb/gadget/udc/dummy_hcd.c:1890
Read of size 1 at addr ffff88807b3c44e8 by task syz.0.449/7500
CPU: 0 UID: 0 PID: 7500 Comm: syz.0.449 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description+0x55/0x1e0 mm/kasan/report.c:378
print_report+0x58/0x70 mm/kasan/report.c:482
kasan_report+0x117/0x150 mm/kasan/report.c:595
find_endpoint drivers/usb/gadget/udc/dummy_hcd.c:1618 [inline]
dummy_timer+0xcdb/0x4cf0 drivers/usb/gadget/udc/dummy_hcd.c:1890
__run_hrtimer kernel/time/hrtimer.c:2067 [inline]
__hrtimer_run_queues+0x3bc/0xa10 kernel/time/hrtimer.c:2124
hrtimer_run_softirq+0x1e3/0x2e0 kernel/time/hrtimer.c:2141
handle_softirqs+0x226/0x860 kernel/softirq.c:645
__do_softirq kernel/softirq.c:679 [inline]
invoke_softirq kernel/softirq.c:519 [inline]
__irq_exit_rcu+0xcb/0x220 kernel/softirq.c:767
irq_exit_rcu+0x9/0x30 kernel/softirq.c:784
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x47/0x80 kernel/locking/spinlock.c:221
Code: f7 e8 ed 53 bd f5 f7 c3 00 02 00 00 74 05 e8 e0 8d e9 f5 9c 58 a9 00 02 00 00 75 29 f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 84 6d ae f5 65 48 8b 05 9c f1 ad 07 48 85 c0 74 18 5b 41 5e e9
RSP: 0018:ffffc90004caf758 EFLAGS: 00000206
RAX: 0000000000000006 RBX: 0000000000000246 RCX: 8000000000000001
RDX: 0000000000000006 RSI: ffffffff8e473d4d RDI: 0000000000000001
RBP: 0000000000000007 R08: ffffffff907a137f R09: 1ffffffff20f426f
R10: dffffc0000000000 R11: fffffbfff20f4270 R12: 0000000000000000
R13: dffffc0000000000 R14: ffff88801c788000 R15: 1ffff11005305e94
spin_unlock_irqrestore include/linux/spinlock.h:425 [inline]
dummy_urb_enqueue+0x587/0x780 drivers/usb/gadget/udc/dummy_hcd.c:1337
usb_hcd_submit_urb+0x328/0x1b60 drivers/usb/core/hcd.c:1542
usblp_submit_read+0x26f/0x4d0 drivers/usb/class/usblp.c:1043
handle_bidir drivers/usb/class/usblp.c:399 [inline]
usblp_open+0x289/0x430 drivers/usb/class/usblp.c:449
usb_open+0x156/0x1e0 drivers/usb/core/file.c:47
chrdev_open+0x4d9/0x600 fs/char_dev.c:411
do_dentry_open+0x816/0x1380 fs/open.c:996
vfs_open+0x3b/0x340 fs/open.c:1101
do_open fs/namei.c:4837 [inline]
path_openat+0x1443/0x1d60 fs/namei.c:5000
do_file_open+0x23e/0x4a0 fs/namei.c:5029
do_sys_openat2+0x115/0x200 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_sys_openat fs/open.c:1439 [inline]
__se_sys_openat fs/open.c:1434 [inline]
__x64_sys_openat+0x138/0x170 fs/open.c:1434
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f66d915e98e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007f66da144b28 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f66da1456c0 RCX: 00007f66d915e98e
RDX: 0000000000000002 RSI: 00007f66da144c00 RDI: ffffffffffffff9c
RBP: 00007f66d9235024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f66d9426038 R14: 00007f66d9425fa0 R15: 00007fffa71fd8c8
Allocated by task 136:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x321/0x600 mm/slub.c:5563
_kmalloc_noprof include/linux/slab.h:991 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
fuse_writepage_args_alloc fs/fuse/file.c:2067 [inline]
fuse_writepage_args_setup fs/fuse/file.c:2114 [inline]
fuse_iomap_writeback_range+0xa74/0x18f0 fs/fuse/file.c:2254
iomap_writeback_range fs/iomap/buffered-io.c:1896 [inline]
iomap_writeback_folio+0x1526/0x2490 fs/iomap/buffered-io.c:2022
iomap_writepages+0x167/0x2e0 fs/iomap/buffered-io.c:2085
fuse_writepages+0x2f5/0x3d0 fs/fuse/file.c:2317
do_writepages+0x338/0x560 mm/page-writeback.c:2560
__writeback_single_inode+0x136/0x1220 fs/fs-writeback.c:1788
writeback_sb_inodes+0x9de/0x1b00 fs/fs-writeback.c:2099
__writeback_inodes_wb+0x114/0x240 fs/fs-writeback.c:2175
wb_writeback+0x42f/0xad0 fs/fs-writeback.c:2286
wb_check_background_flush fs/fs-writeback.c:2356 [inline]
wb_do_writeback fs/fs-writeback.c:2470 [inline]
wb_workfn+0xd5b/0x10f0 fs/fs-writeback.c:2497
process_one_work kernel/workqueue.c:3387 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3470
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3551
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Freed by task 136:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2748 [inline]
slab_free mm/slub.c:6499 [inline]
kfree+0x1c5/0x650 mm/slub.c:6792
fuse_send_writepage fs/fuse/file.c:1976 [inline]
fuse_flush_writepages+0x7a7/0x950 fs/fuse/file.c:1999
fuse_writepages_send fs/fuse/file.c:2177 [inline]
fuse_iomap_writeback_range+0x94a/0x18f0 fs/fuse/file.c:2247
iomap_writeback_range fs/iomap/buffered-io.c:1896 [inline]
iomap_writeback_folio+0x1526/0x2490 fs/iomap/buffered-io.c:2022
iomap_writepages+0x167/0x2e0 fs/iomap/buffered-io.c:2085
fuse_writepages+0x2f5/0x3d0 fs/fuse/file.c:2317
do_writepages+0x338/0x560 mm/page-writeback.c:2560
__writeback_single_inode+0x136/0x1220 fs/fs-writeback.c:1788
writeback_sb_inodes+0x9de/0x1b00 fs/fs-writeback.c:2099
__writeback_inodes_wb+0x114/0x240 fs/fs-writeback.c:2175
wb_writeback+0x42f/0xad0 fs/fs-writeback.c:2286
wb_check_background_flush fs/fs-writeback.c:2356 [inline]
wb_do_writeback fs/fs-writeback.c:2470 [inline]
wb_workfn+0xd5b/0x10f0 fs/fs-writeback.c:2497
process_one_work kernel/workqueue.c:3387 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3470
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3551
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
The buggy address belongs to the object at ffff88807b3c4400
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 232 bytes inside of
freed 512-byte region [ffff88807b3c4400, ffff88807b3c4600)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b3c4
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b041c80 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b041c80 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4983, tgid 4983 (udevadm), ts 29360616081
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0x2209/0x2280 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x217/0x5a0 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab+0x7d/0x620 mm/slub.c:3462
new_slab mm/slub.c:3513 [inline]
refill_objects+0x2d5/0x350 mm/slub.c:7410
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
__kmalloc_cache_noprof+0x39b/0x600 mm/slub.c:5559
_kmalloc_noprof include/linux/slab.h:991 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
kernfs_fop_open+0x3ac/0xce0 fs/kernfs/file.c:634
do_dentry_open+0x816/0x1380 fs/open.c:996
vfs_open+0x3b/0x340 fs/open.c:1101
do_open fs/namei.c:4837 [inline]
path_openat+0x1443/0x1d60 fs/namei.c:5000
do_file_open+0x23e/0x4a0 fs/namei.c:5029
do_sys_openat2+0x115/0x200 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_sys_openat fs/open.c:1439 [inline]
__se_sys_openat fs/open.c:1434 [inline]
__x64_sys_openat+0x138/0x170 fs/open.c:1434
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 1 tgid 1 ts 23738775037 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
free_pages_prepare+0x9eb/0xaf0 mm/page_alloc.c:1463
__free_contig_range_common+0x174/0x340 mm/page_alloc.c:7072
destroy_args+0x4e5/0x570 mm/debug_vm_pgtable.c:993
debug_vm_pgtable+0x3f8/0x410 mm/debug_vm_pgtable.c:1368
do_one_initcall+0x250/0x870 init/main.c:1357
do_initcall_level+0x10a/0x1a0 init/main.c:1419
do_initcalls+0x59/0xa0 init/main.c:1435
kernel_init_freeable+0x29d/0x3e0 init/main.c:1670
kernel_init+0x22/0x1d0 init/main.c:1560
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff88807b3c4380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807b3c4400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807b3c4480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807b3c4500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807b3c4580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: f7 e8 imul %eax
2: ed in (%dx),%eax
3: 53 push %rbx
4: bd f5 f7 c3 00 mov $0xc3f7f5,%ebp
9: 02 00 add (%rax),%al
b: 00 74 05 e8 add %dh,-0x18(%rbp,%rax,1)
f: e0 8d loopne 0xffffff9e
11: e9 f5 9c 58 a9 jmp 0xa9589d0b
16: 00 02 add %al,(%rdx)
18: 00 00 add %al,(%rax)
1a: 75 29 jne 0x45
1c: f7 c3 00 02 00 00 test $0x200,%ebx
22: 74 01 je 0x25
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 84 6d ae f5 call 0xf5ae6db3 <-- trapping instruction
2f: 65 48 8b 05 9c f1 ad mov %gs:0x7adf19c(%rip),%rax # 0x7adf1d3
36: 07
37: 48 85 c0 test %rax,%rax
3a: 74 18 je 0x54
3c: 5b pop %rbx
3d: 41 5e pop %r14
3f: e9 .byte 0xe9