EXT4-fs error (device loop1): ext4_readdir:260: inode #2: block 48: comm syz-executor: path /15/file0: bad entry in directory: rec_len is smaller than minimal - offset=980, inode=0, rec_len=0, size=1024 fake=0 ================================================================== BUG: KASAN: slab-use-after-free in ext4_read_inline_data fs/ext4/inline.c:209 [inline] BUG: KASAN: slab-use-after-free in ext4_read_inline_dir+0x48b/0xdf0 fs/ext4/inline.c:1483 Read of size 836 at addr ffff888011913205 by task syz-executor/6832 CPU: 0 UID: 0 PID: 6832 Comm: syz-executor Not tainted 6.11.0-rc5-syzkaller-00079-g928f79a188aa #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 ext4_read_inline_data fs/ext4/inline.c:209 [inline] ext4_read_inline_dir+0x48b/0xdf0 fs/ext4/inline.c:1483 ext4_readdir+0x3bb/0x3500 fs/ext4/dir.c:158 iterate_dir+0x57a/0x810 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:407 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:392 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7feae9fac093 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 32 43 f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007fff2c2a6f18 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00005555826c0640 RCX: 00007feae9fac093 RDX: 0000000000008000 RSI: 00005555826c0640 RDI: 0000000000000006 RBP: 00005555826c0614 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000016 R14: 00005555826c0610 R15: 00007fff2c2aa2b0 Allocated by task 4668: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4080 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:664 netlink_sendmsg+0x638/0xcb0 net/netlink/af_netlink.c:1876 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2597 ___sys_sendmsg net/socket.c:2651 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2680 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6699: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4548 netlink_recvmsg+0x60a/0x11d0 net/netlink/af_netlink.c:1979 sock_recvmsg_nosec net/socket.c:1046 [inline] sock_recvmsg+0x22f/0x280 net/socket.c:1068 ____sys_recvmsg+0x1db/0x470 net/socket.c:2816 ___sys_recvmsg net/socket.c:2858 [inline] __sys_recvmsg+0x2f0/0x3e0 net/socket.c:2888 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888011913140 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 197 bytes inside of freed 240-byte region [ffff888011913140, ffff888011913230) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11913 ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff888018efb780 ffffea0001f546c0 dead000000000003 raw: 0000000000000000 00000000000c000c 00000001fdffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 0, tgid 0 (swapper/0), ts 60570349411, free_ts 60563259776 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __kmem_cache_alloc_bulk mm/slub.c:4762 [inline] kmem_cache_alloc_bulk_noprof+0x202/0x790 mm/slub.c:4834 napi_skb_cache_get+0x3e0/0x6f0 net/core/skbuff.c:351 __napi_build_skb net/core/skbuff.c:533 [inline] napi_alloc_skb+0x4e3/0xa00 net/core/skbuff.c:856 page_to_skb+0x276/0x9b0 drivers/net/virtio_net.c:797 receive_mergeable drivers/net/virtio_net.c:2256 [inline] receive_buf+0x3af/0x16e0 drivers/net/virtio_net.c:2394 virtnet_receive_packets drivers/net/virtio_net.c:2699 [inline] virtnet_receive drivers/net/virtio_net.c:2723 [inline] virtnet_poll+0x2688/0x3870 drivers/net/virtio_net.c:2818 __napi_poll+0xcb/0x490 net/core/dev.c:6772 napi_poll net/core/dev.c:6841 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:6963 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 page last free pid 5200 tgid 5200 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2612 skb_free_frag include/linux/skbuff.h:3383 [inline] skb_free_head net/core/skbuff.c:1094 [inline] skb_release_data+0x6b2/0x880 net/core/skbuff.c:1123 skb_release_all net/core/skbuff.c:1188 [inline] __kfree_skb+0x55/0x70 net/core/skbuff.c:1202 tcp_rcv_established+0x10a5/0x2020 net/ipv4/tcp_input.c:6140 tcp_v4_do_rcv+0x96d/0xc70 net/ipv4/tcp_ipv4.c:1911 sk_backlog_rcv include/net/sock.h:1111 [inline] __release_sock+0x214/0x350 net/core/sock.c:3004 __sk_flush_backlog+0x36/0xc0 net/core/sock.c:3024 sk_flush_backlog include/net/sock.h:1174 [inline] tcp_sendmsg_locked+0x3cbb/0x4e10 net/ipv4/tcp.c:1160 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1354 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x1a6/0x270 net/socket.c:745 sock_write_iter+0x2dd/0x400 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888011913100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888011913180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888011913200: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ^ ffff888011913280: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888011913300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ==================================================================