loop0: detected capacity change from 1024 to 1023 EXT4-fs error (device loop0): ext4_readdir:264: inode #19: block 128: comm syz.0.0: path /: bad entry in directory: rec_len is smaller than minimal - offset=0, inode=771883264, rec_len=0, size=1024 fake=0 overlayfs: cleanup of 'bus/work' failed (-117) overlayfs: failed to create directory ./bus/work (errno: 17); mounting read-only EXT4-fs error (device loop0): ext4_xattr_block_get:597: inode #12: comm syz.0.0: corrupted xattr block 144: invalid header overlayfs: failed to get uuid (/file0, err=-117); falling back to uuid=null. ================================================================== BUG: KASAN: use-after-free in xattr_find_entry+0x1a5/0x280 fs/ext4/xattr.c:334 Read of size 4 at addr ffff88804ba91004 by task syz.0.0/5326 CPU: 0 UID: 0 PID: 5326 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 xattr_find_entry+0x1a5/0x280 fs/ext4/xattr.c:334 ext4_xattr_ibody_get+0x25d/0x510 fs/ext4/xattr.c:655 ext4_xattr_get+0x123/0x6a0 fs/ext4/xattr.c:709 __vfs_getxattr+0x3f4/0x430 fs/xattr.c:423 vfs_getxattr+0x231/0x290 fs/xattr.c:456 ovl_do_getxattr fs/overlayfs/overlayfs.h:283 [inline] ovl_path_getxattr fs/overlayfs/overlayfs.h:310 [inline] ovl_get_dir_xattr_val+0x21d/0x360 fs/overlayfs/util.c:859 ovl_is_impuredir fs/overlayfs/overlayfs.h:597 [inline] ovl_get_root+0x3a7/0x820 fs/overlayfs/super.c:1328 ovl_fill_super+0x35d3/0x3da0 fs/overlayfs/super.c:1552 vfs_get_super fs/super.c:1324 [inline] get_tree_nodev+0xbb/0x150 fs/super.c:1343 vfs_get_tree+0x92/0x2b0 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount+0x302/0xa10 fs/namespace.c:3727 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount+0x313/0x410 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff98d78efc9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff98e707038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007ff98d9e5fa0 RCX: 00007ff98d78efc9 RDX: 0000200000000440 RSI: 0000200000000100 RDI: 0000000000000000 RBP: 00007ff98d811f91 R08: 0000200000000040 R09: 0000000000000000 R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff98d9e6038 R14: 00007ff98d9e5fa0 R15: 00007ffd31719438 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x4ba91 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea00012e9d88 ffffea00012ea488 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5296, tgid 5296 (udevd), ts 76079047313, free_ts 76104623897 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2507 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2517 filemap_alloc_folio_noprof+0xdf/0x470 mm/filemap.c:1020 ractl_alloc_folio mm/readahead.c:189 [inline] page_cache_ra_unbounded+0x35d/0x9a0 mm/readahead.c:275 do_page_cache_ra mm/readahead.c:332 [inline] force_page_cache_ra mm/readahead.c:361 [inline] page_cache_sync_ra+0x443/0xc60 mm/readahead.c:579 filemap_get_pages+0x468/0x1de0 mm/filemap.c:2638 filemap_read+0x3f6/0x11a0 mm/filemap.c:2748 blkdev_read_iter+0x30a/0x440 block/fops.c:859 new_sync_read fs/read_write.c:491 [inline] vfs_read+0x55a/0xa30 fs/read_write.c:572 ksys_read+0x145/0x250 fs/read_write.c:715 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5327 tgid 5325 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] free_unref_folios+0xdb3/0x14f0 mm/page_alloc.c:2963 folios_put_refs+0x584/0x670 mm/swap.c:1002 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x346/0xda0 mm/truncate.c:383 kill_bdev block/bdev.c:91 [inline] set_blocksize+0x32a/0x500 block/bdev.c:207 sb_set_blocksize block/bdev.c:224 [inline] sb_min_blocksize+0x119/0x210 block/bdev.c:239 ext4_load_super fs/ext4/super.c:5054 [inline] __ext4_fill_super fs/ext4/super.c:5275 [inline] ext4_fill_super+0x6b2/0x61e0 fs/ext4/super.c:5736 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1691 vfs_get_tree+0x92/0x2b0 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount+0x302/0xa10 fs/namespace.c:3727 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount+0x313/0x410 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804ba90f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804ba90f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804ba91000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804ba91080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804ba91100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================