================================================================== 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 drivers/usb/core/urb.c:927 [inline] BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:924 Write of size 4 at addr ffff88802ef25910 by task swapper/0/0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.6.0-rc1-syzkaller-00240-gf0b0d403eabb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0xef/0x190 mm/kasan/generic.c:187 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline] usb_anchor_suspend_wakeups drivers/usb/core/urb.c:927 [inline] usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:924 __usb_hcd_giveback_urb+0x217/0x5c0 drivers/usb/core/hcd.c:1637 usb_hcd_giveback_urb+0x389/0x430 drivers/usb/core/hcd.c:1733 dummy_timer+0x1415/0x35f0 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x764/0xb10 kernel/time/timer.c:2022 run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035 __do_softirq+0x218/0x965 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1074 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline] RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:72 [inline] RIP: 0010:acpi_safe_halt+0x1b/0x20 drivers/acpi/processor_idle.c:113 Code: ed c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 65 48 8b 04 25 c0 bc 03 00 48 8b 00 a8 08 75 0c 66 90 0f 00 2d 97 39 b5 00 fb f4 c3 0f 1f 00 0f b6 47 08 3c 01 74 0b 3c 02 74 05 8b 7f 04 eb 9f RSP: 0018:ffffffff8c807d70 EFLAGS: 00000246 RAX: 0000000000004000 RBX: 0000000000000001 RCX: ffffffff8a3f00ae RDX: 0000000000000001 RSI: ffff8880132ee000 RDI: ffff8880132ee064 RBP: ffff8880132ee064 R08: 0000000000000001 R09: ffffed1017306dbd R10: ffff8880b9836deb R11: 0000000000000000 R12: ffff8881412ef800 R13: ffffffff8d6607c0 R14: 0000000000000000 R15: 0000000000000000 acpi_idle_enter+0xc5/0x160 drivers/acpi/processor_idle.c:707 cpuidle_enter_state+0x82/0x500 drivers/cpuidle/cpuidle.c:267 cpuidle_enter+0x4e/0xa0 drivers/cpuidle/cpuidle.c:388 cpuidle_idle_call kernel/sched/idle.c:215 [inline] do_idle+0x315/0x3f0 kernel/sched/idle.c:282 cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:379 rest_init+0x16f/0x2b0 init/main.c:726 arch_call_rest_init+0x13/0x30 init/main.c:823 start_kernel+0x39f/0x480 init/main.c:1068 x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:556 x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:537 secondary_startup_64_no_verify+0x166/0x16b Allocated by task 24369: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] usbtmc_open+0xa6/0x9b0 drivers/usb/class/usbtmc.c:175 usb_open+0x20f/0x2e0 drivers/usb/core/file.c:47 chrdev_open+0x277/0x700 fs/char_dev.c:414 do_dentry_open+0x88b/0x1730 fs/open.c:929 do_open fs/namei.c:3639 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3796 do_filp_open+0x1de/0x430 fs/namei.c:3823 do_sys_openat2+0x176/0x1e0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 24369: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 usbtmc_release+0x285/0x390 drivers/usb/class/usbtmc.c:261 __fput+0x3f7/0xa70 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 sctp_transport_destroy net/sctp/transport.c:171 [inline] sctp_transport_put+0x121/0x180 net/sctp/transport.c:484 sctp_association_free+0x4d3/0x7d0 net/sctp/associola.c:379 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1330 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline] sctp_do_sm+0x2636/0x5c40 net/sctp/sm_sideeffect.c:1169 sctp_assoc_bh_rcv+0x392/0x6f0 net/sctp/associola.c:1051 sctp_inq_push+0x1d5/0x270 net/sctp/inqueue.c:80 sctp_backlog_rcv+0x169/0x590 net/sctp/input.c:331 sk_backlog_rcv include/net/sock.h:1121 [inline] __release_sock+0x132/0x3a0 net/core/sock.c:2983 release_sock+0x58/0x1b0 net/core/sock.c:3520 sctp_close+0x447/0x940 net/sctp/socket.c:1535 inet_release+0x132/0x270 net/ipv4/af_inet.c:433 inet6_release+0x4f/0x70 net/ipv6/af_inet6.c:484 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1402 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 sctp_transport_destroy net/sctp/transport.c:171 [inline] sctp_transport_put+0x121/0x180 net/sctp/transport.c:484 sctp_association_free+0x4d3/0x7d0 net/sctp/associola.c:379 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1330 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline] sctp_do_sm+0x2636/0x5c40 net/sctp/sm_sideeffect.c:1169 sctp_assoc_bh_rcv+0x392/0x6f0 net/sctp/associola.c:1051 sctp_inq_push+0x1d5/0x270 net/sctp/inqueue.c:80 sctp_backlog_rcv+0x169/0x590 net/sctp/input.c:331 sk_backlog_rcv include/net/sock.h:1121 [inline] __release_sock+0x132/0x3a0 net/core/sock.c:2983 release_sock+0x58/0x1b0 net/core/sock.c:3520 sctp_wait_for_connect+0x1c8/0x5b0 net/sctp/socket.c:9341 __sctp_connect+0x9a3/0xc30 net/sctp/socket.c:1246 sctp_connect net/sctp/socket.c:4810 [inline] sctp_inet_connect+0x15f/0x1f0 net/sctp/socket.c:4825 __sys_connect_file+0x15b/0x1a0 net/socket.c:2033 __sys_connect+0x145/0x170 net/socket.c:2050 __do_sys_connect net/socket.c:2060 [inline] __se_sys_connect net/socket.c:2057 [inline] __x64_sys_connect+0x72/0xb0 net/socket.c:2057 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88802ef25800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 272 bytes inside of freed 1024-byte region [ffff88802ef25800, ffff88802ef25c00) The buggy address belongs to the physical page: page:ffffea0000bbc800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ef20 head:ffffea0000bbc800 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 ffff888012c41dc0 dead000000000100 dead000000000122 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 782, tgid 782 (kworker/1:2), ts 925961113646, free_ts 924899384202 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8be/0x1570 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] kzalloc include/linux/slab.h:720 [inline] ieee802_11_parse_elems_full+0xc7/0x1380 net/mac80211/util.c:1602 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2326 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2333 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1609 [inline] ieee80211_ibss_rx_queued_mgmt+0xc65/0x2ee0 net/mac80211/ibss.c:1642 ieee80211_iface_process_skb net/mac80211/iface.c:1604 [inline] ieee80211_iface_work+0xa1f/0xd40 net/mac80211/iface.c:1658 cfg80211_wiphy_work+0x24e/0x330 net/wireless/core.c:435 process_one_work+0x887/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784 kthread+0x33a/0x430 kernel/kthread.c:388 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x19b/0x350 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1114 kmalloc include/linux/slab.h:599 [inline] usb_control_msg+0xbd/0x4a0 drivers/usb/core/message.c:144 usb_clear_port_feature drivers/usb/core/hub.c:433 [inline] hub_port_disable+0x1d0/0x600 drivers/usb/core/hub.c:4532 hub_port_init+0xb7a/0x3850 drivers/usb/core/hub.c:5096 hub_port_connect drivers/usb/core/hub.c:5369 [inline] hub_port_connect_change drivers/usb/core/hub.c:5580 [inline] port_event drivers/usb/core/hub.c:5740 [inline] hub_event+0x2b64/0x4e00 drivers/usb/core/hub.c:5822 process_one_work+0x887/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784 kthread+0x33a/0x430 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff88802ef25800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ef25880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802ef25900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802ef25980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ef25a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: ed in (%dx),%eax 1: c3 ret 2: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) 9: 00 00 00 00 d: 66 90 xchg %ax,%ax f: 65 48 8b 04 25 c0 bc mov %gs:0x3bcc0,%rax 16: 03 00 18: 48 8b 00 mov (%rax),%rax 1b: a8 08 test $0x8,%al 1d: 75 0c jne 0x2b 1f: 66 90 xchg %ax,%ax 21: 0f 00 2d 97 39 b5 00 verw 0xb53997(%rip) # 0xb539bf 28: fb sti 29: f4 hlt * 2a: fa cli <-- trapping instruction 2b: c3 ret 2c: 0f 1f 00 nopl (%rax) 2f: 0f b6 47 08 movzbl 0x8(%rdi),%eax 33: 3c 01 cmp $0x1,%al 35: 74 0b je 0x42 37: 3c 02 cmp $0x2,%al 39: 74 05 je 0x40 3b: 8b 7f 04 mov 0x4(%rdi),%edi 3e: eb 9f jmp 0xffffffdf