================================================================== BUG: KASAN: slab-out-of-bounds in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1515 Read of size 1 at addr ffff88810c89dd23 by task syz-executor.0/358 CPU: 0 PID: 358 Comm: syz-executor.0 Not tainted 5.10.223-syzkaller-1003215-g0890c03b8b7d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1515 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1700 __ext4_find_entry+0x2b0/0x1990 fs/ext4/namei.c:1588 ext4_lookup_entry fs/ext4/namei.c:1743 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1811 __lookup_hash+0x143/0x290 fs/namei.c:1541 filename_create+0x202/0x750 fs/namei.c:3608 user_path_create fs/namei.c:3665 [inline] do_mkdirat+0xcc/0x2c0 fs/namei.c:3805 __do_sys_mkdirat fs/namei.c:3823 [inline] __se_sys_mkdirat fs/namei.c:3821 [inline] __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3821 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f7d9d28eae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7d9ce110c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f7d9d3adf80 RCX: 00007f7d9d28eae9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f7d9d2da47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f7d9d3adf80 R15: 00007fff1a571bd8 Allocated by task 0: (stack is not available) Freed by task 356: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/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:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 skb_free_head net/core/skbuff.c:606 [inline] skb_release_data+0x5c6/0x6f0 net/core/skbuff.c:626 skb_release_all net/core/skbuff.c:680 [inline] __kfree_skb net/core/skbuff.c:694 [inline] consume_skb+0xac/0x250 net/core/skbuff.c:851 skb_free_datagram+0x28/0xe0 net/core/datagram.c:325 netlink_recvmsg+0x5ef/0x11b0 net/netlink/af_netlink.c:1995 ____sys_recvmsg+0x286/0x530 ___sys_recvmsg+0x1ec/0x690 net/socket.c:2637 __sys_recvmsg net/socket.c:2667 [inline] __do_sys_recvmsg net/socket.c:2677 [inline] __se_sys_recvmsg net/socket.c:2674 [inline] __x64_sys_recvmsg+0x1ee/0x2c0 net/socket.c:2674 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88810c89d800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 291 bytes to the right of 1024-byte region [ffff88810c89d800, ffff88810c89dc00) The buggy address belongs to the page: page:ffffea0004322600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10c898 head:ffffea0004322600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00 raw: 0000000000000000 0000000080100010 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 351, ts 47802286195, free_ts 47770903296 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] __kmalloc+0x204/0x330 mm/slub.c:4029 __kmalloc_node include/linux/slab.h:418 [inline] kmalloc_node include/linux/slab.h:575 [inline] kvmalloc_node+0x82/0x130 mm/util.c:612 kvmalloc include/linux/mm.h:822 [inline] xt_alloc_table_info+0x42/0xb0 net/netfilter/x_tables.c:1172 do_replace net/ipv6/netfilter/ip6_tables.c:1145 [inline] do_ip6t_set_ctl+0xb1b/0x1220 net/ipv6/netfilter/ip6_tables.c:1646 nf_setsockopt+0x274/0x2a0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x2789/0x3ea0 net/ipv6/ipv6_sockglue.c:1014 tcp_setsockopt+0x22d/0x3660 net/ipv4/tcp.c:3499 sock_common_setsockopt+0xa2/0xc0 net/core/sock.c:3318 __sys_setsockopt+0x502/0x870 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 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_pages_ok+0x82c/0x850 mm/page_alloc.c:1629 free_the_page+0x76/0x370 mm/page_alloc.c:5409 __free_pages+0x67/0xc0 mm/page_alloc.c:5418 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab mm/slub.c:1915 [inline] unfreeze_partials+0x15e/0x190 mm/slub.c:2410 put_cpu_partial+0xbf/0x180 mm/slub.c:2446 __slab_free+0x2c8/0x3a0 mm/slub.c:3095 do_slab_free mm/slub.c:3191 [inline] ___cache_free+0x111/0x130 mm/slub.c:3210 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x47/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 fib_table_insert+0x6ac/0x1eb0 net/ipv4/fib_trie.c:1313 fib_magic net/ipv4/fib_frontend.c:1093 [inline] fib_add_ifaddr+0xe1e/0x1a40 net/ipv4/fib_frontend.c:1137 Memory state around the buggy address: ffff88810c89dc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810c89dc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810c89dd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88810c89dd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810c89de00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== EXT4-fs error (device loop0): ext4_find_dest_de:2076: inode #12: block 7: comm syz-executor.0: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=3089191003, rec_len=43069, size=56 fake=0