==================================================================
BUG: KASAN: use-after-free in ath9k_hif_usb_rx_stream drivers/net/wireless/ath/ath9k/hif_usb.c:636 [inline]
BUG: KASAN: use-after-free in ath9k_hif_usb_rx_cb+0xdab/0x1020 drivers/net/wireless/ath/ath9k/hif_usb.c:680
Read of size 4 at addr ffff88813f95c0b8 by task syz-executor.4/9085
CPU: 1 PID: 9085 Comm: syz-executor.4 Not tainted 5.10.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x107/0x163 lib/dump_stack.c:118
print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385
__kasan_report mm/kasan/report.c:545 [inline]
kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
ath9k_hif_usb_rx_stream drivers/net/wireless/ath/ath9k/hif_usb.c:636 [inline]
ath9k_hif_usb_rx_cb+0xdab/0x1020 drivers/net/wireless/ath/ath9k/hif_usb.c:680
__usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1728
dummy_timer+0x11f4/0x3280 drivers/usb/gadget/udc/dummy_hcd.c:1969
call_timer_fn+0x1a5/0x630 kernel/time/timer.c:1410
expire_timers kernel/time/timer.c:1455 [inline]
__run_timers.part.0+0x67c/0xa10 kernel/time/timer.c:1747
__run_timers kernel/time/timer.c:1728 [inline]
run_timer_softirq+0x80/0x120 kernel/time/timer.c:1760
__do_softirq+0x1b2/0x945 kernel/softirq.c:298
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+0x80/0xa0 arch/x86/kernel/irq_64.c:77
invoke_softirq kernel/softirq.c:393 [inline]
__irq_exit_rcu kernel/softirq.c:423 [inline]
irq_exit_rcu+0x110/0x1a0 kernel/softirq.c:435
sysvec_apic_timer_interrupt+0x43/0xa0 arch/x86/kernel/apic/apic.c:1091
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:631
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
RIP: 0010:lock_acquire kernel/locking/lockdep.c:5439 [inline]
RIP: 0010:lock_acquire+0x2af/0x870 kernel/locking/lockdep.c:5401
Code: ff 74 24 20 e8 d2 8e ff ff b8 ff ff ff ff 48 83 c4 20 65 0f c1 05 b1 9d db 7e 83 f8 01 4c 8b 14 24 0f 85 f1 03 00 00 41 52 9d 55 fe ff ff 65 ff 05 f5 8d db 7e 48 8b 05 ce 25 0c 07 e8 c9 dd
RSP: 0018:ffffc90012647660 EFLAGS: 00000246
RAX: 0000000000000001 RBX: 1ffff920024c8ece RCX: ffffffff81260674
RDX: 1ffff11021474db4 RSI: 0000000000000001 RDI: ffffffff89295ef8
RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff898c84b7
R10: 0000000000000246 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88810e0d4078 R14: 0000000000000000 R15: 0000000000000000
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x27/0x40 kernel/locking/spinlock.c:151
spin_lock include/linux/spinlock.h:354 [inline]
wp_page_copy+0x625/0x1e80 mm/memory.c:2869
do_wp_page+0x27b/0x14b0 mm/memory.c:3134
handle_pte_fault mm/memory.c:4392 [inline]
__handle_mm_fault mm/memory.c:4509 [inline]
handle_mm_fault+0x1b2a/0x3220 mm/memory.c:4607
do_user_addr_fault+0x560/0xb40 arch/x86/mm/fault.c:1372
handle_page_fault arch/x86/mm/fault.c:1429 [inline]
exc_page_fault+0x9e/0x180 arch/x86/mm/fault.c:1485
asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:583
RIP: 0010:copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:206
Code: 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 1f 00 c3 0f 1f 80 00 00 00 00 0f 1f 00 83 fa 40 0f 82 70 ff ff ff 89 d1 a4 31 c0 0f 1f 00 c3 66 2e 0f 1f 84 00 00 00 00 00 89 d1 83 f8
RSP: 0018:ffffc90012647b60 EFLAGS: 00010206
RAX: 0000000000000001 RBX: 0000000000001000 RCX: 0000000000000100
RDX: 0000000000001000 RSI: ffff88813c5c6f00 RDI: 000000002085e000
RBP: 000000002085e100 R08: 0000000000000000 R09: ffff88813c5c6fff
R10: ffffed10278b8dff R11: 0000000000000000 R12: 000000002085d100
R13: ffff88813c5c6000 R14: 0000000000000000 R15: 0000000000001000
copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline]
copyout lib/iov_iter.c:148 [inline]
copyout+0xb2/0x130 lib/iov_iter.c:142
copy_page_to_iter_iovec lib/iov_iter.c:219 [inline]
copy_page_to_iter+0x3de/0xe50 lib/iov_iter.c:926
shmem_file_read_iter+0x3e6/0xb40 mm/shmem.c:2661
call_read_iter include/linux/fs.h:1881 [inline]
new_sync_read+0x41e/0x6e0 fs/read_write.c:415
vfs_read+0x35c/0x570 fs/read_write.c:496
ksys_read+0x12d/0x250 fs/read_write.c:634
do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45deb9
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f23053ccc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000026780 RCX: 000000000045deb9
RDX: 00000000200001da RSI: 0000000020000100 RDI: 0000000000000004
RBP: 000000000118c0b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118c07c
R13: 00007ffce25cd13f R14: 00007f23053cd9c0 R15: 000000000118c07c
Allocated by task 2638:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_set_track mm/kasan/common.c:56 [inline]
__kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461
kmalloc include/linux/slab.h:557 [inline]
tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822
security_inode_getattr+0xcf/0x140 security/security.c:1279
vfs_getattr fs/stat.c:121 [inline]
vfs_fstat+0x43/0xb0 fs/stat.c:146
__do_sys_newfstat+0x81/0x100 fs/stat.c:386
do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Freed by task 2638:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_set_track+0x1c/0x30 mm/kasan/common.c:56
kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355
__kasan_slab_free+0x102/0x140 mm/kasan/common.c:422
slab_free_hook mm/slub.c:1544 [inline]
slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577
slab_free mm/slub.c:3142 [inline]
kfree+0xe5/0x5e0 mm/slub.c:4124
tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822
security_inode_getattr+0xcf/0x140 security/security.c:1279
vfs_getattr fs/stat.c:121 [inline]
vfs_fstat+0x43/0xb0 fs/stat.c:146
__do_sys_newfstat+0x81/0x100 fs/stat.c:386
do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
The buggy address belongs to the object at ffff88813f95c000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 184 bytes inside of
4096-byte region [ffff88813f95c000, ffff88813f95d000)
The buggy address belongs to the page:
page:0000000021db05a5 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13f958
head:0000000021db05a5 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x200000000010200(slab|head)
raw: 0200000000010200 dead000000000100 dead000000000122 ffff888100042140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88813f95bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88813f95c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88813f95c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88813f95c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88813f95c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================