loop0: detected capacity change from 0 to 32768 overlayfs: upper fs needs to support d_type. overlayfs: upper fs does not support tmpfile. overlayfs: upper fs does not support RENAME_WHITEOUT. ================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:312 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x738/0xaa0 fs/jfs/jfs_metapage.c:893 Read of size 8 at addr ffff888012fb0500 by task syz.0.0/5328 CPU: 0 UID: 0 PID: 5328 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 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 drop_metapage fs/jfs/jfs_metapage.c:312 [inline] release_metapage+0x738/0xaa0 fs/jfs/jfs_metapage.c:893 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_put fs/jfs/xattr.c:623 [inline] __jfs_setxattr+0xe37/0x1160 fs/jfs/xattr.c:792 __jfs_xattr_set+0xda/0x170 fs/jfs/xattr.c:941 __vfs_setxattr+0x43c/0x480 fs/xattr.c:218 __vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:252 vfs_setxattr+0x163/0x360 fs/xattr.c:339 ovl_do_setxattr fs/overlayfs/overlayfs.h:323 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:335 [inline] ovl_verify_set_fh+0x136/0x200 fs/overlayfs/namei.c:556 ovl_verify_origin_xattr+0x98/0x180 fs/overlayfs/namei.c:584 ovl_verify_upper fs/overlayfs/overlayfs.h:769 [inline] ovl_get_indexdir+0x4aa/0x600 fs/overlayfs/super.c:894 ovl_fill_super_creds fs/overlayfs/super.c:1474 [inline] ovl_fill_super+0x37f5/0x5e20 fs/overlayfs/super.c:1560 vfs_get_super fs/super.c:1327 [inline] get_tree_nodev+0xbb/0x150 fs/super.c:1346 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount+0x341/0xd30 fs/namespace.c:3834 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4383 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4360 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5213f9cdd9 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:00007f5214f0bfe8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f5214215fa0 RCX: 00007f5213f9cdd9 RDX: 0000200000000000 RSI: 0000200000000040 RDI: 0000000000000000 RBP: 00007f5214032d69 R08: 0000200000000100 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5214216038 R14: 00007f5214215fa0 R15: 00007ffee5635ae8 Allocated by task 5328: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4569 [inline] slab_alloc_node mm/slub.c:4898 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4905 mempool_alloc_noprof+0x1ce/0x300 mm/mempool.c:566 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x50c/0xe20 fs/jfs/jfs_metapage.c:761 ea_get+0xb9a/0x1330 fs/jfs/xattr.c:528 __jfs_setxattr+0x5ba/0x1160 fs/jfs/xattr.c:727 __jfs_xattr_set+0xda/0x170 fs/jfs/xattr.c:941 __vfs_setxattr+0x43c/0x480 fs/xattr.c:218 __vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:252 vfs_setxattr+0x163/0x360 fs/xattr.c:339 ovl_do_setxattr fs/overlayfs/overlayfs.h:323 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:335 [inline] ovl_verify_set_fh+0x136/0x200 fs/overlayfs/namei.c:556 ovl_verify_origin_xattr+0x98/0x180 fs/overlayfs/namei.c:584 ovl_verify_upper fs/overlayfs/overlayfs.h:769 [inline] ovl_get_indexdir+0x4aa/0x600 fs/overlayfs/super.c:894 ovl_fill_super_creds fs/overlayfs/super.c:1474 [inline] ovl_fill_super+0x37f5/0x5e20 fs/overlayfs/super.c:1560 vfs_get_super fs/super.c:1327 [inline] get_tree_nodev+0xbb/0x150 fs/super.c:1346 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount+0x341/0xd30 fs/namespace.c:3834 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4383 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4360 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 75: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2689 [inline] slab_free mm/slub.c:6246 [inline] kmem_cache_free+0x182/0x650 mm/slub.c:6373 mempool_free+0xec/0x130 mm/mempool.c:711 free_metapage fs/jfs/jfs_metapage.c:280 [inline] metapage_release_folio+0x46c/0x5b0 fs/jfs/jfs_metapage.c:637 shrink_folio_list+0x2249/0x52a0 mm/vmscan.c:1466 evict_folios+0x4998/0x5ac0 mm/vmscan.c:4854 try_to_shrink_lruvec+0xbca/0x1050 mm/vmscan.c:5009 shrink_one+0x25c/0x710 mm/vmscan.c:5069 shrink_many mm/vmscan.c:5132 [inline] lru_gen_shrink_node mm/vmscan.c:5210 [inline] shrink_node+0x31bf/0x3ae0 mm/vmscan.c:6198 kswapd_shrink_node mm/vmscan.c:7052 [inline] balance_pgdat mm/vmscan.c:7228 [inline] kswapd+0x1736/0x2de0 mm/vmscan.c:7501 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888012fb04d8 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888012fb04d8, ffff888012fb0590) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888012fb07c0 pfn:0x12fb0 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff8880304e7a00 ffff8880002a7048 ffff8880002a7048 raw: ffff888012fb07c0 0000000800100008 00000000f5000000 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 0xd2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5328, tgid 5327 (syz.0.0), ts 105370662115, free_ts 105231946086 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1858 prep_new_page mm/page_alloc.c:1866 [inline] get_page_from_freelist+0x24ba/0x2540 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5226 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab+0x77/0x660 mm/slub.c:3467 new_slab mm/slub.c:3525 [inline] refill_objects+0x339/0x3d0 mm/slub.c:7251 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x321/0x720 mm/slub.c:4651 alloc_from_pcs mm/slub.c:4749 [inline] slab_alloc_node mm/slub.c:4883 [inline] kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4905 mempool_alloc_noprof+0x1ce/0x300 mm/mempool.c:566 alloc_metapage fs/jfs/jfs_metapage.c:264 [inline] __get_metapage+0x50c/0xe20 fs/jfs/jfs_metapage.c:761 ea_write+0x5f0/0xde0 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:626 [inline] __jfs_setxattr+0x944/0x1160 fs/jfs/xattr.c:792 __jfs_xattr_set+0xda/0x170 fs/jfs/xattr.c:941 __vfs_setxattr+0x43c/0x480 fs/xattr.c:218 __vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:252 vfs_setxattr+0x163/0x360 fs/xattr.c:339 ovl_do_setxattr fs/overlayfs/overlayfs.h:323 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:335 [inline] ovl_verify_set_fh+0x136/0x200 fs/overlayfs/namei.c:556 page last free pid 5281 tgid 5281 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0xbc7/0xd30 mm/page_alloc.c:2943 __slab_free+0x274/0x2c0 mm/slub.c:5608 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4569 [inline] slab_alloc_node mm/slub.c:4898 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4905 alloc_filename fs/namei.c:142 [inline] do_getname+0x2e/0x250 fs/namei.c:182 getname_flags fs/namei.c:225 [inline] getname include/linux/fs.h:2526 [inline] class_filename_constructor include/linux/fs.h:2553 [inline] __do_sys_rename fs/namei.c:6214 [inline] __se_sys_rename+0x2b/0x2c0 fs/namei.c:6212 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888012fb0400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888012fb0480: fc fc fc fc fc fc fc fc fc fc fc fa fb fb fb fb >ffff888012fb0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888012fb0580: fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ffff888012fb0600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================