================================================================== BUG: KASAN: slab-out-of-bounds in ext4_read_inline_data fs/ext4/inline.c:210 [inline] BUG: KASAN: slab-out-of-bounds in ext4_inlinedir_to_tree+0x560/0x1160 fs/ext4/inline.c:1394 Read of size 68 at addr ffff888124aa5ec9 by task syz-executor.0/348 CPU: 0 PID: 348 Comm: syz-executor.0 Not tainted 6.1.75-syzkaller-1151022-gfa87a072a7fc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 kasan_check_range+0x294/0x2a0 mm/kasan/generic.c:189 memcpy+0x2d/0x70 mm/kasan/shadow.c:65 ext4_read_inline_data fs/ext4/inline.c:210 [inline] ext4_inlinedir_to_tree+0x560/0x1160 fs/ext4/inline.c:1394 ext4_htree_fill_tree+0x5d1/0x13e0 fs/ext4/namei.c:1210 ext4_dx_readdir fs/ext4/dir.c:597 [inline] ext4_readdir+0x2f4b/0x3930 fs/ext4/dir.c:142 iterate_dir+0x265/0x610 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0a4d8a9363 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 62 8b fa 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 b0 ff ff ff f7 d8 RSP: 002b:00007fffb4329628 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00005555572d9890 RCX: 00007f0a4d8a9363 RDX: 0000000000008000 RSI: 00005555572d9890 RDI: 0000000000000006 RBP: 00005555572d9864 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffb0 R13: 0000000000000016 R14: 00005555572d9860 R15: 0000000000000008 Allocated by task 140: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] kmem_cache_alloc_node+0x18a/0x2d0 mm/slub.c:3466 __alloc_skb+0xcc/0x2d0 net/core/skbuff.c:505 alloc_skb include/linux/skbuff.h:1283 [inline] alloc_skb_with_frags+0xa6/0x680 net/core/skbuff.c:6156 sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2751 unix_dgram_sendmsg+0x5b1/0x2050 net/unix/af_unix.c:1943 sock_sendmsg_nosec net/socket.c:716 [inline] __sock_sendmsg net/socket.c:728 [inline] sock_write_iter+0x394/0x4e0 net/socket.c:1133 do_iter_write+0x6e6/0xc50 fs/read_write.c:861 vfs_writev+0x2d4/0x590 fs/read_write.c:934 do_writev+0x1aa/0x340 fs/read_write.c:977 __do_sys_writev fs/read_write.c:1050 [inline] __se_sys_writev fs/read_write.c:1047 [inline] __x64_sys_writev+0x7d/0x90 fs/read_write.c:1047 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 194: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3684 [inline] kmem_cache_free+0x291/0x510 mm/slub.c:3706 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:871 [inline] consume_skb+0xb4/0x250 net/core/skbuff.c:1035 skb_free_datagram+0x15/0x20 net/core/datagram.c:322 __unix_dgram_recvmsg+0xcce/0x12b0 net/unix/af_unix.c:2530 unix_dgram_recvmsg+0xb7/0xd0 net/unix/af_unix.c:2547 sock_recvmsg_nosec net/socket.c:1020 [inline] sock_recvmsg net/socket.c:1038 [inline] sock_read_iter+0x3b2/0x4b0 net/socket.c:1111 call_read_iter include/linux/fs.h:2252 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x771/0xad0 fs/read_write.c:470 ksys_read+0x199/0x2c0 fs/read_write.c:613 __do_sys_read fs/read_write.c:623 [inline] __se_sys_read fs/read_write.c:621 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:621 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888124aa5dc0 which belongs to the cache skbuff_head_cache of size 256 The buggy address is located 9 bytes to the right of 256-byte region [ffff888124aa5dc0, ffff888124aa5ec0) The buggy address belongs to the physical page: page:ffffea000492a940 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x124aa5 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881002a7800 raw: 0000000000000000 00000000000c000c 00000001ffffffff 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 316, tgid 316 (sshd), ts 34390274327, free_ts 34389967967 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5712 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] kmem_cache_alloc_node+0x1c9/0x2d0 mm/slub.c:3466 __alloc_skb+0xcc/0x2d0 net/core/skbuff.c:505 alloc_skb include/linux/skbuff.h:1283 [inline] __tcp_send_ack+0x95/0x6c0 net/ipv4/tcp_output.c:3978 tcp_send_ack+0x3b/0x60 net/ipv4/tcp_output.c:4010 __tcp_cleanup_rbuf+0x1ee/0x480 net/ipv4/tcp.c:1620 tcp_cleanup_rbuf net/ipv4/tcp.c:1631 [inline] tcp_recvmsg_locked+0x1c07/0x24c0 net/ipv4/tcp.c:2637 tcp_recvmsg+0x258/0x920 net/ipv4/tcp.c:2667 inet_recvmsg+0x14e/0x500 net/ipv4/af_inet.c:864 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498 free_unref_page+0xb2/0x5c0 mm/page_alloc.c:3594 __folio_put_small mm/swap.c:105 [inline] __folio_put+0xaa/0xe0 mm/swap.c:128 folio_put include/linux/mm.h:1422 [inline] put_page include/linux/mm.h:1474 [inline] anon_pipe_buf_release+0x187/0x200 fs/pipe.c:138 pipe_buf_release include/linux/pipe_fs_i.h:183 [inline] pipe_read+0x5a6/0x1040 fs/pipe.c:324 call_read_iter include/linux/fs.h:2252 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x771/0xad0 fs/read_write.c:470 ksys_read+0x199/0x2c0 fs/read_write.c:613 __do_sys_read fs/read_write.c:623 [inline] __se_sys_read fs/read_write.c:621 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:621 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888124aa5d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888124aa5e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888124aa5e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888124aa5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888124aa5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1432: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir3916732297/syzkaller.pKpyYf/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1858: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1432: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir3916732297/syzkaller.pKpyYf/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1858: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1432: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir3916732297/syzkaller.pKpyYf/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1858: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1432: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir3916732297/syzkaller.pKpyYf/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1858: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs error (device loop0): ext4_inlinedir_to_tree:1432: inode #12: block 7: comm syz-executor.0: path /root/syzkaller-testdir3916732297/syzkaller.pKpyYf/0/file0/file0: bad entry in directory: directory entry overrun - offset=34816, inode=2538880996, rec_len=34812, size=128 fake=0 EXT4-fs error (device loop0): empty_inline_dir:1858: inode #12: block 7: comm syz-executor.0: bad entry in directory: directory entry overrun - offset=4, inode=2538880996, rec_len=34812, size=60 fake=0 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs warning (device loop0): empty_inline_dir:1865: bad inline directory (dir #12) - inode 2538880996, rec_len 34812, name_len 234inline size 60 EXT4-fs (loop0): unmounting filesystem.