==================================================================
BUG: KASAN: use-after-free in ath9k_hif_usb_rx_cb+0x1120/0x1130 drivers/net/wireless/ath/ath9k/hif_usb.c:686
Read of size 4 at addr ffff8880203b42f4 by task swapper/0/0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc6-syzkaller-00115-g4a57a8400075 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description+0x65/0x4b0 mm/kasan/report.c:313
print_report+0xf4/0x210 mm/kasan/report.c:429
kasan_report+0xfb/0x130 mm/kasan/report.c:491
ath9k_hif_usb_rx_cb+0x1120/0x1130 drivers/net/wireless/ath/ath9k/hif_usb.c:686
__usb_hcd_giveback_urb+0x369/0x530 drivers/usb/core/hcd.c:1670
dummy_timer+0x86b/0x3110 drivers/usb/gadget/udc/dummy_hcd.c:1988
call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers+0x76a/0x980 kernel/time/timer.c:1790
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803
__do_softirq+0x382/0x793 kernel/softirq.c:571
__irq_exit_rcu+0xec/0x170 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20
RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:22 [inline]
RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline]
RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:130 [inline]
RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:112 [inline]
RIP: 0010:acpi_idle_do_entry drivers/acpi/processor_idle.c:554 [inline]
RIP: 0010:acpi_idle_enter+0x43d/0x7a0 drivers/acpi/processor_idle.c:691
Code: ff e8 e7 44 f4 fc 48 83 e3 08 44 8b 7c 24 04 0f 85 10 01 00 00 e8 f3 ec fa fc 66 90 e8 0c 40 f4 fc 0f 00 2d 15 29 62 06 fb f4 <4c> 89 e3 48 c1 eb 03 42 80 3c 2b 00 74 08 4c 89 e7 e8 7d f9 46 fd
RSP: 0018:ffffffff8c807ba0 EFLAGS: 000002d3
RAX: ffffffff84935544 RBX: 0000000000000000 RCX: ffffffff8c8bb8c0
RDX: 0000000000000000 RSI: ffffffff8a8d2bc0 RDI: ffffffff8ae9a280
RBP: ffffffff8c807c50 R08: ffffffff84935529 R09: fffffbfff1917719
R10: fffffbfff1917719 R11: 1ffffffff1917718 R12: ffffffff8c807be0
R13: dffffc0000000000 R14: ffff888145e08000 R15: 0000000000000001
cpuidle_enter_state+0x517/0xed0 drivers/cpuidle/cpuidle.c:237
cpuidle_enter+0x59/0x90 drivers/cpuidle/cpuidle.c:351
call_cpuidle kernel/sched/idle.c:155 [inline]
cpuidle_idle_call kernel/sched/idle.c:236 [inline]
do_idle+0x3d2/0x640 kernel/sched/idle.c:303
cpu_startup_entry+0x15/0x20 kernel/sched/idle.c:400
rest_init+0x24f/0x270 init/main.c:726
arch_call_rest_init+0xa/0xa init/main.c:882
start_kernel+0x4ac/0x55b init/main.c:1137
secondary_startup_64_no_verify+0xcf/0xdb
Allocated by task 3607:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:436 [inline]
____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:515
kasan_kmalloc include/linux/kasan.h:234 [inline]
__kmalloc+0x223/0x370 mm/slub.c:4446
kmalloc include/linux/slab.h:605 [inline]
tomoyo_realpath_from_path+0xd8/0x5f0 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_number_perm+0x219/0x7b0 security/tomoyo/file.c:723
security_file_ioctl+0x55/0xb0 security/security.c:1551
__do_sys_ioctl fs/ioctl.c:864 [inline]
__se_sys_ioctl+0x48/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Freed by task 3607:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0xd8/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:200 [inline]
slab_free_hook mm/slub.c:1754 [inline]
slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1780
slab_free mm/slub.c:3536 [inline]
kfree+0xc6/0x210 mm/slub.c:4584
tomoyo_realpath_from_path+0x5bf/0x5f0 security/tomoyo/realpath.c:291
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_number_perm+0x219/0x7b0 security/tomoyo/file.c:723
security_file_ioctl+0x55/0xb0 security/security.c:1551
__do_sys_ioctl fs/ioctl.c:864 [inline]
__se_sys_ioctl+0x48/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff8880203b4000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 756 bytes inside of
4096-byte region [ffff8880203b4000, ffff8880203b5000)
The buggy address belongs to the physical page:
page:ffffea000080ec00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x203b0
head:ffffea000080ec00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011c42140
raw: 0000000000000000 0000000080040004 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2958, tgid 2958 (syslogd), ts 51761343251, free_ts 51754846831
prep_new_page mm/page_alloc.c:2456 [inline]
get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4198
__alloc_pages+0x259/0x560 mm/page_alloc.c:5426
alloc_slab_page+0x70/0xf0 mm/slub.c:1824
allocate_slab+0x5e/0x520 mm/slub.c:1969
new_slab mm/slub.c:2029 [inline]
___slab_alloc+0x42e/0xce0 mm/slub.c:3031
__slab_alloc mm/slub.c:3118 [inline]
slab_alloc_node mm/slub.c:3209 [inline]
slab_alloc mm/slub.c:3251 [inline]
__kmalloc+0x2ba/0x370 mm/slub.c:4442
kmalloc include/linux/slab.h:605 [inline]
tomoyo_realpath_from_path+0xd8/0x5f0 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x22f/0x490 security/tomoyo/file.c:771
security_file_open+0x50/0x560 security/security.c:1645
do_dentry_open+0x34a/0x1040 fs/open.c:835
do_open fs/namei.c:3520 [inline]
path_openat+0x26c0/0x2ec0 fs/namei.c:3653
do_filp_open+0x277/0x4f0 fs/namei.c:3680
do_sys_openat2+0x13b/0x500 fs/open.c:1278
do_sys_open fs/open.c:1294 [inline]
__do_sys_openat fs/open.c:1310 [inline]
__se_sys_openat fs/open.c:1305 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1305
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 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:1371 [inline]
free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1421
free_unref_page_prepare mm/page_alloc.c:3343 [inline]
free_unref_page+0x7d/0x390 mm/page_alloc.c:3438
free_large_kmalloc+0xeb/0x1a0 mm/slub.c:3575
kfree+0x188/0x210 mm/slub.c:4580
device_release+0x98/0x1c0
kobject_cleanup+0x235/0x470 lib/kobject.c:673
ath9k_htc_probe_device+0xfe8/0x2090 drivers/net/wireless/ath/ath9k/htc_drv_init.c:976
ath9k_htc_hw_init+0x30/0x70 drivers/net/wireless/ath/ath9k/htc_hst.c:508
ath9k_hif_usb_firmware_cb+0x250/0x4d0 drivers/net/wireless/ath/ath9k/hif_usb.c:1245
request_firmware_work_func+0x198/0x270 drivers/base/firmware_loader/main.c:1107
process_one_work+0x81c/0xd10 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30
Memory state around the buggy address:
ffff8880203b4180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880203b4200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880203b4280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880203b4300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880203b4380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: e8 e7 44 f4 fc callq 0xfcf444ec
5: 48 83 e3 08 and $0x8,%rbx
9: 44 8b 7c 24 04 mov 0x4(%rsp),%r15d
e: 0f 85 10 01 00 00 jne 0x124
14: e8 f3 ec fa fc callq 0xfcfaed0c
19: 66 90 xchg %ax,%ax
1b: e8 0c 40 f4 fc callq 0xfcf4402c
20: 0f 00 2d 15 29 62 06 verw 0x6622915(%rip) # 0x662293c
27: fb sti
28: f4 hlt
* 29: 4c 89 e3 mov %r12,%rbx <-- trapping instruction
2c: 48 c1 eb 03 shr $0x3,%rbx
30: 42 80 3c 2b 00 cmpb $0x0,(%rbx,%r13,1)
35: 74 08 je 0x3f
37: 4c 89 e7 mov %r12,%rdi
3a: e8 7d f9 46 fd callq 0xfd46f9bc