usb 4-1: ath: unknown panic pattern! ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:147 [inline] BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:1197 [inline] BUG: KASAN: use-after-free in kfree_skb_reason+0x33/0x3e0 net/core/skbuff.c:885 Read of size 4 at addr ffff88813c6b2ea4 by task syz-executor.5/17180 CPU: 0 PID: 17180 Comm: syz-executor.5 Not tainted 6.0.0-syzkaller-09039-ga6afa4199d3d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] refcount_read include/linux/refcount.h:147 [inline] skb_unref include/linux/skbuff.h:1197 [inline] kfree_skb_reason+0x33/0x3e0 net/core/skbuff.c:885 kfree_skb include/linux/skbuff.h:1214 [inline] ath9k_hif_usb_reg_in_cb+0x4c5/0x640 drivers/net/wireless/ath/ath9k/hif_usb.c:770 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1671 usb_hcd_giveback_urb+0x380/0x430 drivers/usb/core/hcd.c:1754 dummy_timer+0x11ff/0x32c0 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1bd/0x9ab kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x113/0x170 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194 Code: 74 24 10 e8 0a 79 31 fb 48 89 ef e8 92 fa 31 fb 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 03 59 27 fb 65 8b 05 ac ca 09 7a 85 c0 74 0a 5b 5d c3 e8 90 d7 RSP: 0018:ffffc9000552fe10 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff11c53c9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff8881199ec008 R08: 0000000000000001 R09: 0000000000000001 R10: ffffed102333d801 R11: 0000000000000000 R12: 0000000000000293 R13: ffff8881199ec008 R14: fffffffffffffff0 R15: 1ffff92000aa5fce spin_unlock_irqrestore include/linux/spinlock.h:404 [inline] raw_ioctl_ep0_stall drivers/usb/gadget/legacy/raw_gadget.c:784 [inline] raw_ioctl+0xeed/0x27c0 drivers/usb/gadget/legacy/raw_gadget.c:1286 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f8a93e93367 Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 f4 57 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8a935e4098 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f8a935e5110 RCX: 00007f8a93e93367 RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000005 RBP: 0000000000000005 R08: 000000000000ffff R09: 000000000000000b R10: 00007f8a935e4140 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000020000a00 R15: 00000000000010d0 Allocated by task 4135: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:470 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3248 [inline] kmem_cache_alloc_node+0x309/0x3c0 mm/slub.c:3298 __alloc_skb+0x210/0x2f0 net/core/skbuff.c:497 alloc_skb include/linux/skbuff.h:1265 [inline] ath9k_hif_usb_alloc_reg_in_urbs drivers/net/wireless/ath/ath9k/hif_usb.c:963 [inline] ath9k_hif_usb_alloc_urbs+0x91d/0x1050 drivers/net/wireless/ath/ath9k/hif_usb.c:1022 ath9k_hif_usb_dev_init drivers/net/wireless/ath/ath9k/hif_usb.c:1108 [inline] ath9k_hif_usb_firmware_cb+0x148/0x530 drivers/net/wireless/ath/ath9k/hif_usb.c:1241 request_firmware_work_func+0x12c/0x230 drivers/base/firmware_loader/main.c:1107 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2ea/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 17180: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x14a/0x1b0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook mm/slub.c:1785 [inline] slab_free mm/slub.c:3539 [inline] kmem_cache_free+0xd3/0x620 mm/slub.c:3556 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:812 __kfree_skb net/core/skbuff.c:869 [inline] kfree_skb_reason+0x13c/0x3e0 net/core/skbuff.c:891 kfree_skb include/linux/skbuff.h:1214 [inline] ath9k_htc_rx_msg+0x357/0xbd0 drivers/net/wireless/ath/ath9k/htc_hst.c:469 ath9k_hif_usb_reg_in_cb+0x1ac/0x640 drivers/net/wireless/ath/ath9k/hif_usb.c:739 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1671 usb_hcd_giveback_urb+0x380/0x430 drivers/usb/core/hcd.c:1754 dummy_timer+0x11ff/0x32c0 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1bd/0x9ab kernel/softirq.c:571 The buggy address belongs to the object at ffff88813c6b2dc0 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 228 bytes inside of 240-byte region [ffff88813c6b2dc0, ffff88813c6b2eb0) The buggy address belongs to the physical page: page:ffffea0004f1ac80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13c6b2 flags: 0x200000000000200(slab|node=0|zone=2) raw: 0200000000000200 0000000000000000 dead000000000122 ffff88810083f500 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 17068, tgid 17068 (udevd), ts 1118673229020, free_ts 1118636203289 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x11cc/0x2a20 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1829 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x7f1/0xe10 mm/slub.c:3036 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3123 slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3256 [inline] __kmem_cache_alloc_lru mm/slub.c:3263 [inline] kmem_cache_alloc+0x367/0x390 mm/slub.c:3273 skb_clone+0x16e/0x3c0 net/core/skbuff.c:1650 do_one_broadcast net/netlink/af_netlink.c:1450 [inline] netlink_broadcast+0x895/0xd90 net/netlink/af_netlink.c:1516 netlink_sendmsg+0xa8d/0xe10 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5d2/0xb80 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page_list+0x176/0x900 mm/page_alloc.c:3522 release_pages+0xb79/0x11b0 mm/swap.c:1012 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:58 tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu mm/mmu_gather.c:262 [inline] tlb_finish_mmu+0x147/0x7e0 mm/mmu_gather.c:353 exit_mmap+0x1d2/0x490 mm/mmap.c:3118 __mmput kernel/fork.c:1187 [inline] mmput+0xcc/0x410 kernel/fork.c:1208 exit_mm kernel/exit.c:510 [inline] do_exit+0x9e2/0x2930 kernel/exit.c:782 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x2387/0x2610 kernel/signal.c:2857 arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x156/0x200 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88813c6b2d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88813c6b2e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88813c6b2e80: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ^ ffff88813c6b2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88813c6b2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 74 24 je 0x26 2: 10 e8 adc %ch,%al 4: 0a 79 31 or 0x31(%rcx),%bh 7: fb sti 8: 48 89 ef mov %rbp,%rdi b: e8 92 fa 31 fb callq 0xfb31faa2 10: 81 e3 00 02 00 00 and $0x200,%ebx 16: 75 25 jne 0x3d 18: 9c pushfq 19: 58 pop %rax 1a: f6 c4 02 test $0x2,%ah 1d: 75 2d jne 0x4c 1f: 48 85 db test %rbx,%rbx 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 03 59 27 fb callq 0xfb275932 <-- trapping instruction 2f: 65 8b 05 ac ca 09 7a mov %gs:0x7a09caac(%rip),%eax # 0x7a09cae2 36: 85 c0 test %eax,%eax 38: 74 0a je 0x44 3a: 5b pop %rbx 3b: 5d pop %rbp 3c: c3 retq 3d: e8 .byte 0xe8 3e: 90 nop 3f: d7 xlat %ds:(%rbx)