================================================================== 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/asm-generic/atomic-instrumented.h:240 [inline] BUG: KASAN: use-after-free in usb_anchor_suspend_wakeups drivers/usb/core/urb.c:919 [inline] BUG: KASAN: use-after-free in usb_anchor_suspend_wakeups+0x1a/0x30 drivers/usb/core/urb.c:916 Write of size 4 at addr ffff88801ca4e110 by task kworker/0:6/6764 CPU: 0 PID: 6764 Comm: kworker/0:6 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 check_memory_region_inline mm/kasan/generic.c:179 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:185 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_inc include/asm-generic/atomic-instrumented.h:240 [inline] usb_anchor_suspend_wakeups drivers/usb/core/urb.c:919 [inline] usb_anchor_suspend_wakeups+0x1a/0x30 drivers/usb/core/urb.c:916 __usb_hcd_giveback_urb+0x1d2/0x3f0 drivers/usb/core/hcd.c:1643 dummy_timer+0xeb8/0x2e90 drivers/usb/gadget/udc/dummy_hcd.c:1971 call_timer_fn+0x163/0x4b0 kernel/time/timer.c:1417 expire_timers kernel/time/timer.c:1462 [inline] __run_timers.part.0+0x52a/0x8b0 kernel/time/timer.c:1731 __run_timers kernel/time/timer.c:1712 [inline] run_timer_softirq+0x9c/0x190 kernel/time/timer.c:1744 __do_softirq+0x29b/0x9f6 kernel/softirq.c:343 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:226 [inline] __irq_exit_rcu kernel/softirq.c:420 [inline] irq_exit_rcu+0x134/0x200 kernel/softirq.c:432 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:629 RIP: 0010:console_unlock+0x5ba/0x8c0 kernel/printk/printk.c:2580 Code: 57 fd ff ff 48 c7 c6 94 4f 53 81 48 c7 c7 a0 bd a7 8a e8 e9 eb fd ff e8 d4 2f 00 00 48 83 3c 24 00 0f 85 a1 01 00 00 41 55 9d <8b> 54 24 38 85 d2 0f 84 9b fb ff ff 31 d2 be 15 0a 00 00 48 c7 c7 RSP: 0018:ffffc90003927628 EFLAGS: 00000247 RAX: 0000000000000007 RBX: dffffc0000000000 RCX: 1ffffffff18f715b RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8153515d RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 3a312d3620627375 R12: ffffffff8b82aa30 R13: 0000000000000247 R14: 0000000000000000 R15: ffffc90003927688 vprintk_emit+0xf8/0x2d0 kernel/printk/printk.c:2092 dev_vprintk_emit+0x2c9/0x30d drivers/base/core.c:4301 dev_printk_emit+0x9d/0xce drivers/base/core.c:4312 _dev_info+0xc8/0xf6 drivers/base/core.c:4370 usb_disconnect.cold+0x2e/0x681 drivers/usb/core/hub.c:2200 hub_port_connect drivers/usb/core/hub.c:5074 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0xb2a/0x36a0 drivers/usb/core/hub.c:5591 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 process_scheduled_works kernel/workqueue.c:2337 [inline] worker_thread+0x733/0xf80 kernel/workqueue.c:2423 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Allocated by task 13917: 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:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:682 [inline] usbtmc_open+0x98/0x920 drivers/usb/class/usbtmc.c:175 usb_open+0x1d5/0x2a0 drivers/usb/core/file.c:48 chrdev_open+0x20f/0x650 fs/char_dev.c:414 do_dentry_open+0x42a/0xfb0 fs/open.c:817 do_open fs/namei.c:3254 [inline] path_openat+0x12cd/0x21d0 fs/namei.c:3371 do_filp_open+0x16d/0x390 fs/namei.c:3398 do_sys_openat2+0x11e/0x360 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_openat fs/open.c:1204 [inline] __se_sys_openat fs/open.c:1199 [inline] __x64_sys_openat+0x11b/0x1d0 fs/open.c:1199 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 13917: 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:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kfree+0xdb/0x3b0 mm/slub.c:4139 usbtmc_release+0x237/0x340 drivers/usb/class/usbtmc.c:261 __fput+0x204/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88801ca4e000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 272 bytes inside of 1024-byte region [ffff88801ca4e000, ffff88801ca4e400) The buggy address belongs to the page: page:00000000aee87a6d refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801ca49800 pfn:0x1ca48 head:00000000aee87a6d order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 ffffea0000741800 0000000200000002 ffff88800f841140 raw: ffff88801ca49800 000000008010000e 00000001ffffffff ffff888037a7f101 page dumped because: kasan: bad access detected pages's memcg:ffff888037a7f101 page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5748, ts 70720776880 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x144/0x1c0 mm/page_alloc.c:2297 prep_new_page mm/page_alloc.c:2306 [inline] get_page_from_freelist+0x1c6e/0x3f80 mm/page_alloc.c:3945 __alloc_pages_nodemask+0x2d6/0x730 mm/page_alloc.c:4995 alloc_pages include/linux/gfp.h:547 [inline] alloc_slab_page mm/slub.c:1618 [inline] allocate_slab+0x2b6/0x4a0 mm/slub.c:1758 new_slab mm/slub.c:1821 [inline] new_slab_objects mm/slub.c:2578 [inline] ___slab_alloc+0x476/0x790 mm/slub.c:2741 __slab_alloc.constprop.0+0x95/0xe0 mm/slub.c:2781 slab_alloc_node mm/slub.c:2857 [inline] __kmalloc_node_track_caller+0x1ad/0x3f0 mm/slub.c:4510 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0x7f/0x4e0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1099 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet6_rt_notify+0xd1/0x270 net/ipv6/route.c:6019 fib6_add_rt2node net/ipv6/ip6_fib.c:1248 [inline] fib6_add+0x2101/0x3580 net/ipv6/ip6_fib.c:1475 __ip6_ins_rt net/ipv6/route.c:1317 [inline] ip6_route_add+0x65/0xf0 net/ipv6/route.c:3745 addrconf_prefix_route+0x2b4/0x3f0 net/ipv6/addrconf.c:2413 addrconf_add_linklocal+0x219/0x490 net/ipv6/addrconf.c:3182 addrconf_addr_gen+0x2da/0x320 net/ipv6/addrconf.c:3311 addrconf_notify+0x26a/0x1d80 net/ipv6/addrconf.c:3591 notifier_call_chain+0x94/0x170 kernel/notifier.c:83 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1271 [inline] __free_pages_ok+0x4da/0xed0 mm/page_alloc.c:1536 unfreeze_partials+0x16c/0x1b0 mm/slub.c:2359 put_cpu_partial+0x129/0x200 mm/slub.c:2395 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 ____kasan_kmalloc.constprop.0+0x98/0xa0 mm/kasan/common.c:412 kasan_slab_alloc include/linux/kasan.h:209 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc_node mm/slub.c:2892 [inline] kmem_cache_alloc_node+0x1e0/0x470 mm/slub.c:2928 __alloc_skb+0x42/0x4e0 net/core/skbuff.c:198 alloc_skb include/linux/skbuff.h:1099 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1176 [inline] netlink_sendmsg+0x7ea/0xbe0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 ____sys_sendmsg+0x5bf/0x7a0 net/socket.c:2345 ___sys_sendmsg+0xd3/0x150 net/socket.c:2399 __sys_sendmsg+0xb2/0x140 net/socket.c:2432 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Memory state around the buggy address: ffff88801ca4e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801ca4e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801ca4e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801ca4e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801ca4e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 4 bytes skipped: 0: 48 c7 c6 94 4f 53 81 mov $0xffffffff81534f94,%rsi 7: 48 c7 c7 a0 bd a7 8a mov $0xffffffff8aa7bda0,%rdi e: e8 e9 eb fd ff callq 0xfffdebfc 13: e8 d4 2f 00 00 callq 0x2fec 18: 48 83 3c 24 00 cmpq $0x0,(%rsp) 1d: 0f 85 a1 01 00 00 jne 0x1c4 23: 41 55 push %r13 25: 9d popfq * 26: 8b 54 24 38 mov 0x38(%rsp),%edx <-- trapping instruction 2a: 85 d2 test %edx,%edx 2c: 0f 84 9b fb ff ff je 0xfffffbcd 32: 31 d2 xor %edx,%edx 34: be 15 0a 00 00 mov $0xa15,%esi 39: 48 rex.W 3a: c7 .byte 0xc7 3b: c7 .byte 0xc7