================================================================== BUG: KASAN: slab-out-of-bounds in cfg80211_wext_freq+0x1f1/0x230 net/wireless/wext-compat.c:235 Read of size 2 at addr ffff8880131b1940 by task syz.2.11/3612 CPU: 1 PID: 3612 Comm: syz.2.11 Not tainted 5.15.161-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 cfg80211_wext_freq+0x1f1/0x230 net/wireless/wext-compat.c:235 cfg80211_wext_siwscan+0x4fd/0xfc0 net/wireless/scan.c:2831 ioctl_standard_iw_point+0x781/0xca0 net/wireless/wext-core.c:848 ioctl_standard_call+0xc3/0x280 net/wireless/wext-core.c:1033 wext_ioctl_dispatch+0x16f/0x460 net/wireless/wext-core.c:997 wext_handle_ioctl+0x15b/0x260 net/wireless/wext-core.c:1058 sock_ioctl+0x13b/0x770 net/socket.c:1191 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fc7f6453b29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc7f4ed4048 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fc7f65e1fa0 RCX: 00007fc7f6453b29 RDX: 0000000020000000 RSI: 0000000000008b18 RDI: 0000000000000003 RBP: 00007fc7f64d4756 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fc7f65e1fa0 R15: 00007ffcd86869c8 Allocated by task 3612: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] ioctl_standard_iw_point+0x4aa/0xca0 net/wireless/wext-core.c:809 ioctl_standard_call+0xc3/0x280 net/wireless/wext-core.c:1033 wext_ioctl_dispatch+0x16f/0x460 net/wireless/wext-core.c:997 wext_handle_ioctl+0x15b/0x260 net/wireless/wext-core.c:1058 sock_ioctl+0x13b/0x770 net/socket.c:1191 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff8880131b1800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 320 bytes inside of 512-byte region [ffff8880131b1800, ffff8880131b1a00) The buggy address belongs to the page: page:ffffea00004c6c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x131b0 head:ffffea00004c6c00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000726b00 0000000400000004 ffff888011c41c80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 9, ts 4345131466, free_ts 4343023550 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0x1c9/0x300 mm/slub.c:4403 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] tomoyo_init_log+0x1adf/0x1fe0 security/tomoyo/audit.c:275 tomoyo_supervisor+0x3b8/0x12c0 security/tomoyo/common.c:2097 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x5ba/0x810 security/tomoyo/file.c:734 tomoyo_path_chown+0x3e/0xb0 security/tomoyo/tomoyo.c:358 security_path_chown+0xd9/0x130 security/security.c:1228 chown_common+0x52b/0x890 fs/open.c:678 init_chown+0x116/0x180 fs/init.c:93 do_name+0x2d3/0x3a0 init/initramfs.c:372 write_buffer init/initramfs.c:432 [inline] unpack_to_rootfs+0x215/0x500 init/initramfs.c:485 do_populate_rootfs+0x43/0x240 init/initramfs.c:674 async_run_entry_fn+0xa2/0x410 kernel/async.c:127 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 stack_depot_save+0x3ef/0x440 lib/stackdepot.c:335 kasan_save_stack mm/kasan/common.c:40 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xd1/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] tomoyo_commit_ok+0x25/0x1d0 security/tomoyo/memory.c:76 tomoyo_update_domain+0x54d/0x890 security/tomoyo/domain.c:139 tomoyo_update_path_number_acl security/tomoyo/file.c:691 [inline] tomoyo_write_file+0x809/0xe50 security/tomoyo/file.c:1034 tomoyo_write_domain2+0x1d8/0x240 security/tomoyo/common.c:1152 tomoyo_add_entry security/tomoyo/common.c:2042 [inline] tomoyo_supervisor+0xf5d/0x12c0 security/tomoyo/common.c:2103 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x5ba/0x810 security/tomoyo/file.c:734 tomoyo_path_chown+0x3e/0xb0 security/tomoyo/tomoyo.c:358 security_path_chown+0xd9/0x130 security/security.c:1228 chown_common+0x52b/0x890 fs/open.c:678 init_chown+0x116/0x180 fs/init.c:93 do_name+0x1f8/0x3a0 init/initramfs.c:365 Memory state around the buggy address: ffff8880131b1800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880131b1880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880131b1900: 00 00 00 00 00 00 00 04 fc fc fc fc fc fc fc fc ^ ffff8880131b1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880131b1a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================