================================================================== BUG: KASAN: slab-out-of-bounds in find_endpoint+0x2a3/0x2c0 drivers/usb/gadget/udc/dummy_hcd.c:1618 Read of size 1 at addr ffff8880133a3a93 by task syz-executor/5739 CPU: 1 UID: 0 PID: 5739 Comm: syz-executor Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 find_endpoint+0x2a3/0x2c0 drivers/usb/gadget/udc/dummy_hcd.c:1618 dummy_timer+0x500/0x3700 drivers/usb/gadget/udc/dummy_hcd.c:1890 __run_hrtimer kernel/time/hrtimer.c:2067 [inline] __hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2124 hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2141 handle_softirqs+0x1e6/0x9d0 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0x16a/0x210 kernel/softirq.c:758 irq_exit_rcu+0x9/0x30 kernel/softirq.c:775 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/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+0x31/0x80 kernel/locking/spinlock.c:221 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 f6 5a 15 f6 48 89 df e8 7e b1 15 f6 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 05 a7 04 f6 65 48 83 3d 74 a4 ba 08 00 74 16 5b RSP: 0000:ffffc90004ca7c40 EFLAGS: 00000246 RAX: 0000000000000006 RBX: ffff888024908ea0 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffffff8e3f18bd RDI: ffffffff8c622c80 RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 1ffff110001334b0 R13: ffffc90004ca7cc8 R14: 0000000000000000 R15: 0000000000000004 do_wait+0x13b/0x570 kernel/exit.c:1754 kernel_wait4+0x16d/0x280 kernel/exit.c:1917 __do_compat_sys_wait4+0x15b/0x170 kernel/exit.c:1975 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] do_int80_emulation+0x166/0x650 arch/x86/entry/syscall_32.c:166 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598 RIP: 0023:0xf71375ab Code: 57 56 53 8b 44 24 14 f6 00 08 75 23 8b 44 24 18 8b 5c 24 1c 8b 4c 24 20 8b 54 24 24 8b 74 24 28 8b 7c 24 2c 8b 6c 24 30 cd 80 <5b> 5e 5f 5d c3 5b 5e 5f 5d e9 f7 a1 ff ff 66 90 66 90 66 90 90 53 RSP: 002b:00000000ff9bda7c EFLAGS: 00000246 ORIG_RAX: 0000000000000072 RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00000000ff9bdc18 RDX: 0000000040000001 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5453: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5414 [inline] __kmalloc_node_noprof+0x342/0x880 mm/slub.c:5426 _kmalloc_node_noprof include/linux/slab.h:1200 [inline] qdisc_alloc+0xbb/0xb30 net/sched/sch_generic.c:998 qdisc_create_dflt+0x93/0x490 net/sched/sch_generic.c:1053 attach_one_default_qdisc net/sched/sch_generic.c:1219 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2749 [inline] attach_default_qdiscs net/sched/sch_generic.c:1237 [inline] dev_activate+0x64f/0xce0 net/sched/sch_generic.c:1296 __dev_open+0x490/0x8f0 net/core/dev.c:1733 __dev_change_flags+0x596/0x850 net/core/dev.c:9812 netif_change_flags+0x8d/0x160 net/core/dev.c:9877 dev_change_flags+0xba/0x260 net/core/dev_api.c:68 devinet_ioctl+0x110b/0x1f10 net/ipv4/devinet.c:1199 inet_ioctl+0x3aa/0x3f0 net/ipv4/af_inet.c:1009 sock_do_ioctl+0x118/0x280 net/socket.c:1325 sock_ioctl+0x599/0x6b0 net/socket.c:1446 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x121/0x770 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880133a3800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 19 bytes to the right of allocated 640-byte region [ffff8880133a3800, ffff8880133a3a80) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x133a0 head: order:3 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 ffff88801c042dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801c042dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6769, tgid 6768 (syz.3.188), ts 110390211357 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943 __alloc_pages_slowpath mm/page_alloc.c:4884 [inline] __alloc_frozen_pages_noprof+0x936/0x3300 mm/page_alloc.c:5449 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab mm/slub.c:3462 [inline] new_slab+0xa9/0x6e0 mm/slub.c:3513 refill_objects+0xe3/0x410 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kvmalloc_node_noprof+0x7bb/0x9b0 mm/slub.c:7005 _kvmalloc_array_node_noprof include/linux/slab.h:1374 [inline] io_alloc_cache_init+0x38/0x170 io_uring/alloc_cache.c:25 io_ring_ctx_alloc io_uring/io_uring.c:266 [inline] io_uring_create io_uring/io_uring.c:2976 [inline] io_uring_setup.cold+0x4aa/0x1c5e io_uring/io_uring.c:3111 __do_sys_io_uring_setup io_uring/io_uring.c:3145 [inline] __se_sys_io_uring_setup io_uring/io_uring.c:3136 [inline] __ia32_sys_io_uring_setup+0xc2/0x170 io_uring/io_uring.c:3136 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] do_int80_emulation+0x166/0x650 arch/x86/entry/syscall_32.c:166 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598 page last free pid 0 tgid 0 ts 104050234785 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962 rcu_do_batch kernel/rcu/tree.c:2650 [inline] rcu_core+0x5f0/0x1260 kernel/rcu/tree.c:2919 handle_softirqs+0x1e6/0x9d0 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0x16a/0x210 kernel/softirq.c:758 irq_exit_rcu+0x9/0x30 kernel/softirq.c:775 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 Memory state around the buggy address: ffff8880133a3980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880133a3a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880133a3a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880133a3b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880133a3b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: f5 cmc 1: 53 push %rbx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 89 fb mov %rdi,%rbx a: 48 83 c7 18 add $0x18,%rdi e: e8 f6 5a 15 f6 call 0xf6155b09 13: 48 89 df mov %rbx,%rdi 16: e8 7e b1 15 f6 call 0xf615b199 1b: f7 c5 00 02 00 00 test $0x200,%ebp 21: 75 23 jne 0x46 23: 9c pushf 24: 58 pop %rax 25: f6 c4 02 test $0x2,%ah 28: 75 37 jne 0x61 * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 05 a7 04 f6 call 0xf604a739 34: 65 48 83 3d 74 a4 ba cmpq $0x0,%gs:0x8baa474(%rip) # 0x8baa4b1 3b: 08 00 3d: 74 16 je 0x55 3f: 5b pop %rbx