================================================================== BUG: KASAN: slab-out-of-bounds in ext4_ext_binsearch fs/ext4/extents.c:837 [inline] BUG: KASAN: slab-out-of-bounds in ext4_find_extent+0xbc8/0xde0 fs/ext4/extents.c:953 Read of size 4 at addr ffff88807b40b76c by task syz-executor.2/20057 CPU: 1 PID: 20057 Comm: syz-executor.2 Not tainted 6.4.0-syzkaller-01312-gb19edac5992d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x163/0x540 mm/kasan/report.c:462 kasan_report+0x176/0x1b0 mm/kasan/report.c:572 ext4_ext_binsearch fs/ext4/extents.c:837 [inline] ext4_find_extent+0xbc8/0xde0 fs/ext4/extents.c:953 ext4_ext_create_new_leaf fs/ext4/extents.c:1440 [inline] ext4_ext_insert_extent+0x151f/0x4e60 fs/ext4/extents.c:2102 ext4_ext_map_blocks+0x1bd6/0x7210 fs/ext4/extents.c:4307 ext4_map_blocks+0xa4c/0x1cf0 fs/ext4/inode.c:623 _ext4_get_block+0x238/0x6a0 fs/ext4/inode.c:779 ext4_block_write_begin+0x53e/0x15a0 fs/ext4/inode.c:1059 ext4_write_begin+0x619/0x10b0 ext4_da_write_begin+0x300/0xa40 fs/ext4/inode.c:2893 generic_perform_write+0x300/0x5e0 mm/filemap.c:3946 ext4_buffered_write_iter+0x123/0x3a0 fs/ext4/file.c:300 ext4_file_write_iter+0x1d7/0x1940 do_iter_write+0x84f/0xde0 fs/read_write.c:860 iter_file_splice_write+0x843/0xfe0 fs/splice.c:762 do_splice_from fs/splice.c:840 [inline] direct_splice_actor+0xea/0x1c0 fs/splice.c:1027 splice_direct_to_actor+0x37e/0x9a0 fs/splice.c:982 do_splice_direct+0x286/0x3d0 fs/splice.c:1070 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fc54de8c389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc54eb49168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007fc54dfabf80 RCX: 00007fc54de8c389 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000006 RBP: 00007fc54ded7493 R08: 0000000000000000 R09: 0000000000000000 R10: 0001000000201005 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd1383669f R14: 00007fc54eb49300 R15: 0000000000022000 Allocated by task 5117: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0xb9/0x230 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:680 [inline] ieee802_11_parse_elems_full+0x112/0x2a40 net/mac80211/util.c:1609 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2305 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2312 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1605 [inline] ieee80211_ibss_rx_queued_mgmt+0x513/0x2cf0 net/mac80211/ibss.c:1638 ieee80211_iface_process_skb net/mac80211/iface.c:1594 [inline] ieee80211_iface_work+0x7bd/0xd00 net/mac80211/iface.c:1648 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2408 worker_thread+0xa63/0x1210 kernel/workqueue.c:2555 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 5117: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0x264/0x3c0 mm/slub.c:3799 ieee80211_ibss_rx_queued_mgmt+0x1af7/0x2cf0 ieee80211_iface_process_skb net/mac80211/iface.c:1594 [inline] ieee80211_iface_work+0x7bd/0xd00 net/mac80211/iface.c:1648 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2408 worker_thread+0xa63/0x1210 kernel/workqueue.c:2555 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 __call_rcu_common kernel/rcu/tree.c:2649 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2763 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2408 worker_thread+0xa63/0x1210 kernel/workqueue.c:2555 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 __call_rcu_common kernel/rcu/tree.c:2649 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2763 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2408 worker_thread+0xa63/0x1210 kernel/workqueue.c:2555 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88807b40b000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 876 bytes to the right of allocated 1024-byte region [ffff88807b40b000, ffff88807b40b400) The buggy address belongs to the physical page: page:ffffea0001ed0200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807b40e000 pfn:0x7b408 head:ffffea0001ed0200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012441dc0 ffffea0000e82810 ffffea0000b5b210 raw: ffff88807b40e000 000000000010000e 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 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5117, tgid 5117 (kworker/u4:6), ts 263895341401, free_ts 260393287491 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1744 prep_new_page mm/page_alloc.c:1751 [inline] get_page_from_freelist+0x320e/0x3390 mm/page_alloc.c:3523 __alloc_pages+0x255/0x670 mm/page_alloc.c:4794 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3192 __slab_alloc mm/slub.c:3291 [inline] __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x1b8/0x290 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node_track_caller+0xa5/0x230 mm/slab_common.c:986 kmalloc_reserve+0xfe/0x240 net/core/skbuff.c:585 pskb_expand_head+0x202/0x1340 net/core/skbuff.c:2054 __skb_cow include/linux/skbuff.h:3589 [inline] skb_cow_head include/linux/skbuff.h:3623 [inline] batadv_skb_head_push+0x164/0x1f0 net/batman-adv/soft-interface.c:72 batadv_send_skb_packet+0xee/0x660 net/batman-adv/send.c:86 batadv_iv_ogm_send_to_if net/batman-adv/bat_iv_ogm.c:392 [inline] batadv_iv_ogm_emit net/batman-adv/bat_iv_ogm.c:420 [inline] batadv_iv_send_outstanding_bat_ogm_packet+0x673/0x810 net/batman-adv/bat_iv_ogm.c:1700 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2408 worker_thread+0xa63/0x1210 kernel/workqueue.c:2555 kthread+0x2b8/0x350 kernel/kthread.c:379 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1308 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2577 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2672 discard_slab mm/slub.c:2097 [inline] __unfreeze_partials+0x1b1/0x1f0 mm/slub.c:2636 put_cpu_partial+0x116/0x180 mm/slub.c:2712 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711 slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc_lru+0x11f/0x2e0 mm/slub.c:3482 __d_alloc+0x31/0x710 fs/dcache.c:1769 d_alloc_pseudo+0x1d/0x70 fs/dcache.c:1899 alloc_file_pseudo+0x135/0x2f0 fs/file_table.c:323 sock_alloc_file+0xb8/0x280 net/socket.c:466 sock_map_fd net/socket.c:491 [inline] __sys_socket+0x1ce/0x3a0 net/socket.c:1672 __do_sys_socket net/socket.c:1677 [inline] __se_sys_socket net/socket.c:1675 [inline] __x64_sys_socket+0x7a/0x90 net/socket.c:1675 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88807b40b600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b40b680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807b40b700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807b40b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b40b800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================