================================================================== BUG: KASAN: slab-out-of-bounds in ar5523_cmd_tx_cb+0x220/0x240 drivers/net/wireless/ath/ar5523/ar5523.c:228 Read of size 8 at addr ffff88813ce23450 by task udevd/1179 CPU: 1 PID: 1179 Comm: udevd Not tainted 5.19.0-syzkaller-13666-gffcf9c5700e4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/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 ar5523_cmd_tx_cb+0x220/0x240 drivers/net/wireless/ath/ar5523/ar5523.c:228 __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+0x1c0/0x9a9 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:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:kasan_check_range+0x17/0x180 mm/kasan/generic.c:188 Code: ff ff 89 45 08 5b 5d 41 5c c3 66 0f 1f 84 00 00 00 00 00 48 85 f6 0f 84 3c 01 00 00 49 89 f9 41 54 44 0f b6 c2 49 01 f1 55 53 <0f> 82 18 01 00 00 48 b8 ff ff ff ff ff 7f ff ff 48 39 c7 0f 86 05 RSP: 0018:ffffc900005a7970 EFLAGS: 00000286 RAX: 0000000000000100 RBX: ffffffff88de9668 RCX: ffffffff8128f8b8 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881000674e0 RBP: ffff8881000674e0 R08: 0000000000000000 R09: ffff8881000674e8 R10: ffffed102000ce9b R11: 0000000000000000 R12: 1ffff920000b4f35 R13: ffff888100067540 R14: ffff8881000674d8 R15: ffff8881000674d8 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:1265 [inline] rwsem_test_oflags kernel/locking/rwsem.c:152 [inline] is_rwsem_reader_owned kernel/locking/rwsem.c:193 [inline] is_rwsem_reader_owned kernel/locking/rwsem.c:182 [inline] __up_read+0x228/0x720 kernel/locking/rwsem.c:1328 kernfs_dop_revalidate+0x34f/0x600 fs/kernfs/dir.c:1117 d_revalidate fs/namei.c:856 [inline] d_revalidate fs/namei.c:853 [inline] lookup_fast+0x22d/0x520 fs/namei.c:1646 walk_component+0x5e/0x5a0 fs/namei.c:1989 link_path_walk.part.0+0x7e6/0xf60 fs/namei.c:2320 link_path_walk fs/namei.c:2244 [inline] path_lookupat+0xb7/0x840 fs/namei.c:2473 filename_lookup+0x1ce/0x590 fs/namei.c:2503 user_path_at_empty+0x42/0x60 fs/namei.c:2876 do_readlinkat+0xcd/0x2f0 fs/stat.c:456 __do_sys_readlink fs/stat.c:489 [inline] __se_sys_readlink fs/stat.c:486 [inline] __x64_sys_readlink+0x74/0xb0 fs/stat.c:486 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:0x7fd898e18277 Code: 73 01 c3 48 8b 0d 01 dc 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 59 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d d1 db 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007ffdb3902518 EFLAGS: 00000246 ORIG_RAX: 0000000000000059 RAX: ffffffffffffffda RBX: 00007ffdb3902528 RCX: 00007fd898e18277 RDX: 0000000000000400 RSI: 00007ffdb3902528 RDI: 00007ffdb3902a08 RBP: 0000000000000400 R08: 0000000007ffffff R09: 0000559331e119a0 R10: 00007fd898ea5fc0 R11: 0000000000000246 R12: 00007ffdb3902a08 R13: 00007ffdb3902978 R14: 0000559331dd2910 R15: 0000000000000000 Allocated by task 0: (stack is not available) The buggy address belongs to the object at ffff88813ce23400 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 80 bytes inside of 512-byte region [ffff88813ce23400, ffff88813ce23600) The buggy address belongs to the physical page: page:ffffea0004f38800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13ce20 head:ffffea0004f38800 order:2 compound_mapcount:0 compound_pincount:0 memcg:ffff88811ccf8201 flags: 0x200000000010200(slab|head|node=0|zone=2) raw: 0200000000010200 0000000000000000 dead000000000122 ffff888100042dc0 raw: 0000000000000000 0000000080100010 00000001ffffffff ffff88811ccf8201 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 1168, tgid 1168 (klogd), ts 2667746675370, free_ts 2667366626185 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:5515 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x7b4/0xda0 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] __kmalloc_node_track_caller+0x139/0x360 mm/slub.c:4955 kmalloc_reserve net/core/skbuff.c:358 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:430 alloc_skb include/linux/skbuff.h:1257 [inline] alloc_skb_with_frags+0x93/0x6c0 net/core/skbuff.c:6018 sock_alloc_send_pskb+0x7a3/0x930 net/core/sock.c:2663 unix_dgram_sendmsg+0x415/0x1b50 net/unix/af_unix.c:1912 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 __sys_sendto+0x236/0x340 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2125 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+0x19/0x420 mm/page_alloc.c:3476 device_release+0x9f/0x240 drivers/base/core.c:2330 kobject_cleanup lib/kobject.c:673 [inline] kobject_release lib/kobject.c:704 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1be/0x4c0 lib/kobject.c:721 put_device+0x1b/0x30 drivers/base/core.c:3624 ar5523_probe+0xe38/0x1d10 drivers/net/wireless/ath/ar5523/ar5523.c:1719 usb_probe_interface+0x30b/0x7f0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:530 [inline] really_probe+0x249/0xb90 drivers/base/dd.c:609 __driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:748 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:778 __device_attach_driver+0x206/0x2e0 drivers/base/dd.c:901 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427 __device_attach+0x1e4/0x530 drivers/base/dd.c:973 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487 device_add+0xbd5/0x1e90 drivers/base/core.c:3517 usb_set_configuration+0x1019/0x1900 drivers/usb/core/message.c:2170 Memory state around the buggy address: ffff88813ce23300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88813ce23380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88813ce23400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88813ce23480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88813ce23500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: ff 89 45 08 5b 5d decl 0x5d5b0845(%rcx) 6: 41 5c pop %r12 8: c3 retq 9: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) 10: 00 00 12: 48 85 f6 test %rsi,%rsi 15: 0f 84 3c 01 00 00 je 0x157 1b: 49 89 f9 mov %rdi,%r9 1e: 41 54 push %r12 20: 44 0f b6 c2 movzbl %dl,%r8d 24: 49 01 f1 add %rsi,%r9 27: 55 push %rbp 28: 53 push %rbx * 29: 0f 82 18 01 00 00 jb 0x147 <-- trapping instruction 2f: 48 b8 ff ff ff ff ff movabs $0xffff7fffffffffff,%rax 36: 7f ff ff 39: 48 39 c7 cmp %rax,%rdi 3c: 0f .byte 0xf 3d: 86 .byte 0x86 3e: 05 .byte 0x5