================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_inc include/linux/atomic/atomic-instrumented.h:181 [inline] BUG: KASAN: use-after-free in usb_anchor_suspend_wakeups drivers/usb/core/urb.c:940 [inline] BUG: KASAN: use-after-free in usb_anchor_suspend_wakeups+0x1a/0x30 drivers/usb/core/urb.c:937 Write of size 4 at addr ffff8880753c0910 by task swapper/1/0 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.15.162-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x41/0x5e lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:451 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_inc include/linux/atomic/atomic-instrumented.h:181 [inline] usb_anchor_suspend_wakeups drivers/usb/core/urb.c:940 [inline] usb_anchor_suspend_wakeups+0x1a/0x30 drivers/usb/core/urb.c:937 __usb_hcd_giveback_urb+0x1d2/0x3f0 drivers/usb/core/hcd.c:1661 dummy_timer+0x104d/0x2d20 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x159/0x370 kernel/time/timer.c:1451 expire_timers kernel/time/timer.c:1496 [inline] __run_timers.part.0+0x430/0x780 kernel/time/timer.c:1767 __run_timers kernel/time/timer.c:1745 [inline] run_timer_softirq+0x65/0xf0 kernel/time/timer.c:1780 handle_softirqs+0x1ef/0x520 kernel/softirq.c:558 __do_softirq kernel/softirq.c:592 [inline] invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu kernel/softirq.c:641 [inline] irq_exit_rcu+0xd0/0x110 kernel/softirq.c:653 sysvec_apic_timer_interrupt+0x6a/0x90 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:40 [inline] RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:75 [inline] RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:110 [inline] RIP: 0010:acpi_idle_do_entry+0x180/0x1f0 drivers/acpi/processor_idle.c:570 Code: 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 75 55 48 8b 45 00 a8 08 75 c9 66 90 0f 00 2d 32 47 99 00 fb f4 5d c3 48 89 ef 5d e9 64 f5 ff ff e8 0f 1f 0c fc e9 99 fe ff ff RSP: 0018:ffffc90000d57d30 EFLAGS: 00000246 RAX: 0000000000004000 RBX: ffff88800e196065 RCX: ffffffff85666246 RDX: 1ffff11027fc5ae0 RSI: 0000000000000008 RDI: ffff88813fe2d700 RBP: ffff88813fe2d700 R08: 0000000000000000 R09: ffff88813fe2d707 R10: ffffed1027fc5ae0 R11: 0000000000000001 R12: 0000000000000001 R13: ffff88800e196064 R14: ffff8881415e6804 R15: ffffffff8740a640 acpi_idle_enter+0x299/0x460 drivers/acpi/processor_idle.c:705 cpuidle_enter_state+0x13d/0xa80 drivers/cpuidle/cpuidle.c:237 cpuidle_enter+0x45/0xa0 drivers/cpuidle/cpuidle.c:351 call_cpuidle kernel/sched/idle.c:158 [inline] cpuidle_idle_call kernel/sched/idle.c:239 [inline] do_idle+0x381/0x500 kernel/sched/idle.c:306 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:403 start_secondary+0x20d/0x2b0 arch/x86/kernel/smpboot.c:281 secondary_startup_64_no_verify+0xb0/0xbb Allocated by task 3621: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0x7c/0x90 mm/kasan/common.c:522 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] usbtmc_open+0x98/0x920 drivers/usb/class/usbtmc.c:175 usb_open+0x1b1/0x240 drivers/usb/core/file.c:48 chrdev_open+0x20f/0x650 fs/char_dev.c:414 do_dentry_open+0x46a/0x10e0 fs/open.c:826 do_open fs/namei.c:3608 [inline] path_openat+0x1542/0x2360 fs/namei.c:3742 do_filp_open+0x199/0x3d0 fs/namei.c:3769 do_sys_openat2+0x11e/0x400 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x11b/0x1d0 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x33/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 3621: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xe0/0x110 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook mm/slub.c:1731 [inline] slab_free mm/slub.c:3499 [inline] kfree+0xd0/0x4e0 mm/slub.c:4559 usbtmc_release+0x237/0x340 drivers/usb/class/usbtmc.c:261 __fput+0x1f0/0x9a0 fs/file_table.c:280 task_work_run+0xb8/0x140 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:181 [inline] exit_to_user_mode_prepare+0x15d/0x160 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x12/0x30 kernel/entry/common.c:307 do_syscall_64+0x40/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff8880753c0800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 272 bytes inside of 1024-byte region [ffff8880753c0800, ffff8880753c0c00) The buggy address belongs to the page: page:ffffea0001d4f000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x753c0 head:ffffea0001d4f000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000800000001 ffff888009c41dc0 raw: 0000000000000000 0000000080100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2181, ts 78823218688, free_ts 78821763577 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x12d1/0x2d40 mm/page_alloc.c:4159 __alloc_pages+0x1b2/0x440 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab+0x2eb/0x430 mm/slub.c:1912 new_slab mm/slub.c:1975 [inline] ___slab_alloc+0xa4b/0xfe0 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node_track_caller+0x18e/0x490 mm/slub.c:4958 kmalloc_reserve net/core/skbuff.c:356 [inline] __alloc_skb+0x8b/0x280 net/core/skbuff.c:427 alloc_skb include/linux/skbuff.h:1167 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_fib+0x10b/0x4f0 net/ipv4/fib_semantics.c:520 fib_table_insert+0x68f/0x1fc0 net/ipv4/fib_trie.c:1398 fib_magic.isra.0+0x241/0x2e0 net/ipv4/fib_frontend.c:1093 fib_add_ifaddr+0x519/0x6d0 net/ipv4/fib_frontend.c:1137 fib_netdev_event+0x22b/0x400 net/ipv4/fib_frontend.c:1475 notifier_call_chain+0xd1/0x150 kernel/notifier.c:83 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_info net/core/dev.c:2003 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers net/core/dev.c:2044 [inline] __dev_notify_flags+0x2cb/0x340 net/core/dev.c:8851 dev_change_flags+0xf6/0x150 net/core/dev.c:8889 do_setlink+0x81b/0x2df0 net/core/rtnetlink.c:2741 __rtnl_newlink+0xa9e/0x1390 net/core/rtnetlink.c:3429 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare+0x379/0x850 mm/page_alloc.c:1391 free_unref_page_prepare mm/page_alloc.c:3317 [inline] free_unref_page+0x19/0x4b0 mm/page_alloc.c:3396 __unfreeze_partials+0x2b9/0x2d0 mm/slub.c:2507 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x68/0x110 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x1f0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x73/0x80 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3220 [inline] kmem_cache_alloc_node+0x23d/0x390 mm/slub.c:3256 __alloc_skb+0x153/0x280 net/core/skbuff.c:415 alloc_skb include/linux/skbuff.h:1167 [inline] alloc_skb_with_frags+0x72/0x4a0 net/core/skbuff.c:6170 sock_alloc_send_pskb+0x62a/0x7b0 net/core/sock.c:2530 mld_newpack.isra.0+0x19b/0x800 net/ipv6/mcast.c:1748 add_grhead+0x265/0x350 net/ipv6/mcast.c:1851 add_grec+0xb4d/0xdf0 net/ipv6/mcast.c:1989 mld_send_cr net/ipv6/mcast.c:2115 [inline] mld_ifc_work+0x430/0xc20 net/ipv6/mcast.c:2653 process_one_work+0x800/0x11d0 kernel/workqueue.c:2310 worker_thread+0x4a0/0xdd0 kernel/workqueue.c:2457 Memory state around the buggy address: ffff8880753c0800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880753c0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880753c0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880753c0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880753c0a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 48 89 ea mov %rbp,%rdx 3: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax a: fc ff df d: 48 c1 ea 03 shr $0x3,%rdx 11: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 15: 75 55 jne 0x6c 17: 48 8b 45 00 mov 0x0(%rbp),%rax 1b: a8 08 test $0x8,%al 1d: 75 c9 jne 0xffffffe8 1f: 66 90 xchg %ax,%ax 21: 0f 00 2d 32 47 99 00 verw 0x994732(%rip) # 0x99475a 28: fb sti 29: f4 hlt * 2a: fa cli <-- trapping instruction 2b: 5d pop %rbp 2c: c3 ret 2d: 48 89 ef mov %rbp,%rdi 30: 5d pop %rbp 31: e9 64 f5 ff ff jmp 0xfffff59a 36: e8 0f 1f 0c fc call 0xfc0c1f4a 3b: e9 99 fe ff ff jmp 0xfffffed9