================================================================== BUG: KASAN: slab-out-of-bounds in ext4_ext_binsearch fs/ext4/extents.c:826 [inline] BUG: KASAN: slab-out-of-bounds in ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:945 Read of size 4 at addr ffff888122be1eb8 by task syz.5.538/2379 CPU: 1 PID: 2379 Comm: syz.5.538 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch fs/ext4/extents.c:826 [inline] ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:945 ext4_ext_map_blocks+0x20b/0x5dd0 fs/ext4/extents.c:4160 ext4_map_blocks+0x985/0x1bd0 fs/ext4/inode.c:674 mpage_map_one_extent fs/ext4/inode.c:2452 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2505 [inline] ext4_writepages+0x136a/0x2eb0 fs/ext4/inode.c:2873 do_writepages+0x128/0x280 mm/page-writeback.c:2380 __filemap_fdatawrite_range+0x2a0/0x350 mm/filemap.c:427 filemap_write_and_wait_range+0x65/0x290 mm/filemap.c:660 ext4_punch_hole+0x120/0xad0 fs/ext4/inode.c:4118 ext4_fallocate+0x271/0x1a70 fs/ext4/extents.c:4758 vfs_fallocate+0x4b4/0x590 fs/open.c:310 madvise_remove mm/madvise.c:880 [inline] madvise_vma_behavior mm/madvise.c:904 [inline] madvise_walk_vmas mm/madvise.c:1131 [inline] do_madvise+0x1443/0x1d70 mm/madvise.c:1308 __do_sys_madvise mm/madvise.c:1322 [inline] __se_sys_madvise mm/madvise.c:1320 [inline] __x64_sys_madvise+0xa9/0xc0 mm/madvise.c:1320 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f2f46608eb9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2f45065028 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007f2f46883fa0 RCX: 00007f2f46608eb9 RDX: 0000000000000009 RSI: 0000000000600003 RDI: 0000200000000000 RBP: 00007f2f46676c1f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2f46884038 R14: 00007f2f46883fa0 R15: 00007ffdc380e2c8 Allocated by task 95: 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:430 [inline] ____kasan_kmalloc mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x181/0x2e0 mm/slub.c:2979 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:667 [inline] kobject_uevent_env+0x272/0x700 lib/kobject_uevent.c:539 kobject_synth_uevent+0x57e/0xbb0 lib/kobject_uevent.c:208 uevent_store+0x25/0x60 drivers/base/core.c:2320 dev_attr_store+0x5e/0x80 drivers/base/core.c:2018 sysfs_kf_write+0x129/0x150 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x2c5/0x400 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2066 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0x758/0xdc0 fs/read_write.c:605 ksys_write+0x149/0x250 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 95: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1600 [inline] slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626 slab_free mm/slub.c:3208 [inline] kfree+0xc0/0x270 mm/slub.c:4196 kobject_uevent_env+0x34d/0x700 lib/kobject_uevent.c:641 kobject_synth_uevent+0x57e/0xbb0 lib/kobject_uevent.c:208 uevent_store+0x25/0x60 drivers/base/core.c:2320 dev_attr_store+0x5e/0x80 drivers/base/core.c:2018 sysfs_kf_write+0x129/0x150 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x2c5/0x400 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2066 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0x758/0xdc0 fs/read_write.c:605 ksys_write+0x149/0x250 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff888122be0000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 3768 bytes to the right of 4096-byte region [ffff888122be0000, ffff888122be1000) The buggy address belongs to the page: page:ffffea00048af800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122be0 head:ffffea00048af800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042c00 raw: 0000000000000000 0000000000040004 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 95, ts 50177755780, free_ts 48346359803 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x223b/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x290/0x620 mm/page_alloc.c:5370 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1813 [inline] new_slab+0x84/0x3f0 mm/slub.c:1874 new_slab_objects mm/slub.c:2632 [inline] ___slab_alloc+0x2a6/0x450 mm/slub.c:2796 __slab_alloc+0x63/0xa0 mm/slub.c:2836 slab_alloc_node mm/slub.c:2918 [inline] slab_alloc mm/slub.c:2960 [inline] kmem_cache_alloc_trace+0x1b0/0x2e0 mm/slub.c:2977 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:667 [inline] kernfs_iop_get_link+0x66/0x600 fs/kernfs/symlink.c:136 vfs_readlink+0x179/0x3e0 fs/namei.c:4728 do_readlinkat+0x251/0x490 fs/stat.c:426 __do_sys_readlink fs/stat.c:447 [inline] __se_sys_readlink fs/stat.c:444 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:444 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2b7/0x2d0 mm/page_alloc.c:3336 free_unref_page mm/page_alloc.c:3391 [inline] free_the_page mm/page_alloc.c:5429 [inline] __free_pages+0x146/0x3b0 mm/page_alloc.c:5440 __vunmap+0x86d/0x9f0 mm/vmalloc.c:2307 __vfree mm/vmalloc.c:2356 [inline] vfree+0x61/0x90 mm/vmalloc.c:2387 htable_put+0x5fb/0x650 net/netfilter/xt_hashlimit.c:432 hashlimit_mt_destroy_v1+0x58/0x60 net/netfilter/xt_hashlimit.c:970 cleanup_match net/ipv4/netfilter/ip_tables.c:460 [inline] find_check_entry net/ipv4/netfilter/ip_tables.c:564 [inline] translate_table+0x1a53/0x20e0 net/ipv4/netfilter/ip_tables.c:717 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline] do_ipt_set_ctl+0x958/0xd70 net/ipv4/netfilter/ip_tables.c:1636 nf_setsockopt+0x272/0x2a0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x28b1/0x3490 net/ipv4/ip_sockglue.c:1442 udp_setsockopt+0x8a/0xa0 net/ipv4/udp.c:2750 sock_common_setsockopt+0xa0/0xb0 net/core/sock.c:3326 __sys_setsockopt+0x2fa/0x480 net/socket.c:2146 __do_sys_setsockopt net/socket.c:2157 [inline] __se_sys_setsockopt net/socket.c:2154 [inline] __x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2154 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888122be1d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888122be1e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888122be1e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888122be1f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888122be1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== uffd: Set unprivileged_userfaultfd sysctl knob to 1 if kernel faults must be handled without obtaining CAP_SYS_PTRACE capability