================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline] BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:927 Write of size 4 at addr ffff88805c5e3910 by task syz-executor.0/7001 CPU: 0 PID: 7001 Comm: syz-executor.0 Not tainted 6.8.0-syzkaller-08073-g480e035fc4c7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline] usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:927 __usb_hcd_giveback_urb+0x25c/0x530 drivers/usb/core/hcd.c:1637 dummy_timer+0x8aa/0x3220 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x17e/0x600 kernel/time/timer.c:1792 expire_timers kernel/time/timer.c:1843 [inline] __run_timers kernel/time/timer.c:2408 [inline] __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2419 run_timer_base kernel/time/timer.c:2428 [inline] run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2438 __do_softirq+0x2bc/0x943 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:debug_spin_lock_after kernel/locking/spinlock_debug.c:95 [inline] RIP: 0010:do_raw_spin_lock+0x19e/0x370 kernel/locking/spinlock_debug.c:118 Code: 00 65 8b 1d 00 d5 90 7e 41 0f b6 04 17 84 c0 0f 85 90 01 00 00 48 8b 44 24 18 89 18 48 8b 44 24 20 80 3c 10 00 48 8b 5c 24 30 <74> 12 48 89 df e8 a8 49 85 00 48 ba 00 00 00 00 00 fc ff df 48 8b RSP: 0018:ffffc90003787a40 EFLAGS: 00000246 RAX: 1ffff11004436492 RBX: ffff8880221b2490 RCX: 0000000000000001 RDX: dffffc0000000000 RSI: 0000000000000004 RDI: ffffc90003787aa0 RBP: ffffc90003787b10 R08: 0000000000000003 R09: fffff520006f0f54 R10: dffffc0000000000 R11: fffff520006f0f54 R12: ffff8880221b2480 R13: 1ffff920006f0f54 R14: ffffc90003787aa0 R15: 1ffff11004436491 spin_lock include/linux/spinlock.h:351 [inline] io_cq_lock io_uring/io_uring.c:644 [inline] __io_cqring_overflow_flush+0x156/0x610 io_uring/io_uring.c:696 io_cqring_do_overflow_flush io_uring/io_uring.c:722 [inline] io_cqring_wait io_uring/io_uring.c:2669 [inline] __do_sys_io_uring_enter io_uring/io_uring.c:3701 [inline] __se_sys_io_uring_enter+0x1fb1/0x2b80 io_uring/io_uring.c:3591 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7fc5c0e7dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc5c1b5d0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007fc5c0fabf80 RCX: 00007fc5c0e7dda9 RDX: 0000000000000003 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 00007fc5c0eca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fc5c0fabf80 R15: 00007fc5c10cfa48 Allocated by task 23517: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x1db/0x360 mm/slub.c:3997 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] usbtmc_open+0x93/0x890 drivers/usb/class/usbtmc.c:175 usb_open+0x225/0x300 drivers/usb/core/file.c:47 chrdev_open+0x5b0/0x630 fs/char_dev.c:414 do_dentry_open+0x907/0x15a0 fs/open.c:955 do_open fs/namei.c:3642 [inline] path_openat+0x2860/0x3240 fs/namei.c:3799 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Freed by task 23517: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x14a/0x380 mm/slub.c:4390 usbtmc_release+0x24f/0x280 drivers/usb/class/usbtmc.c:261 __fput+0x429/0x8a0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:108 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x168/0x360 kernel/entry/common.c:212 do_syscall_64+0x10a/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff88805c5e3800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 272 bytes inside of freed 1024-byte region [ffff88805c5e3800, ffff88805c5e3c00) The buggy address belongs to the physical page: page:ffffea0001717800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5c5e0 head:ffffea0001717800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888014c41dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 59, tgid 59 (kworker/u8:4), ts 82154029045, free_ts 81324803177 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x256/0x680 mm/page_alloc.c:4569 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xc73/0x1260 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc+0x2e5/0x4a0 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] neigh_alloc net/core/neighbour.c:494 [inline] ___neigh_create+0x691/0x2450 net/core/neighbour.c:648 ip6_finish_output2+0x1629/0x1670 net/ipv6/ip6_output.c:128 ip6_finish_output+0x41e/0x810 net/ipv6/ip6_output.c:222 NF_HOOK include/linux/netfilter.h:314 [inline] ndisc_send_skb+0xab0/0x1380 net/ipv6/ndisc.c:509 addrconf_dad_completed+0x76c/0xcd0 net/ipv6/addrconf.c:4357 addrconf_dad_work+0xdc2/0x16f0 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 page last free pid 1101 tgid 1101 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] __free_pages_ok+0xc42/0xd70 mm/page_alloc.c:1269 io_rings_free+0xa4/0x380 io_uring/io_uring.c:2791 io_ring_ctx_free+0x798/0x9c0 io_uring/io_uring.c:2911 io_ring_exit_work+0x7c7/0x850 io_uring/io_uring.c:3125 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Memory state around the buggy address: ffff88805c5e3800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805c5e3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805c5e3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805c5e3980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805c5e3a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 00 65 8b add %ah,-0x75(%rbp) 3: 1d 00 d5 90 7e sbb $0x7e90d500,%eax 8: 41 0f b6 04 17 movzbl (%r15,%rdx,1),%eax d: 84 c0 test %al,%al f: 0f 85 90 01 00 00 jne 0x1a5 15: 48 8b 44 24 18 mov 0x18(%rsp),%rax 1a: 89 18 mov %ebx,(%rax) 1c: 48 8b 44 24 20 mov 0x20(%rsp),%rax 21: 80 3c 10 00 cmpb $0x0,(%rax,%rdx,1) 25: 48 8b 5c 24 30 mov 0x30(%rsp),%rbx * 2a: 74 12 je 0x3e <-- trapping instruction 2c: 48 89 df mov %rbx,%rdi 2f: e8 a8 49 85 00 call 0x8549dc 34: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 3b: fc ff df 3e: 48 rex.W 3f: 8b .byte 0x8b