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:223 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0xcde/0xdc0 fs/jfs/jfs_metapage.c:786 Read of size 8 at addr ffff888078414fa0 by task syz-executor.1/21297 CPU: 2 PID: 21297 Comm: syz-executor.1 Not tainted 6.8.0-rc1-syzkaller-00026-g7ed2632ec7d7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 drop_metapage fs/jfs/jfs_metapage.c:223 [inline] release_metapage+0xcde/0xdc0 fs/jfs/jfs_metapage.c:786 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_put fs/jfs/xattr.c:614 [inline] __jfs_setxattr+0xd08/0x1060 fs/jfs/xattr.c:783 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:917 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 ovl_do_setxattr fs/overlayfs/overlayfs.h:310 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:322 [inline] ovl_make_workdir fs/overlayfs/super.c:710 [inline] ovl_get_workdir fs/overlayfs/super.c:822 [inline] ovl_fill_super+0x1475/0x6520 fs/overlayfs/super.c:1375 vfs_get_super fs/super.c:1273 [inline] get_tree_nodev+0xd6/0x180 fs/super.c:1292 vfs_get_tree+0x8c/0x370 fs/super.c:1784 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x79/0x110 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x70/0x7a RIP: 0023:0xf7f58579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7f535ac EFLAGS: 00000292 ORIG_RAX: 0000000000000015 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000200000c0 RDX: 0000000020000340 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 21297: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:314 [inline] __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc+0x136/0x320 mm/slub.c:3867 mempool_alloc+0x176/0x390 mm/mempool.c:408 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5ee/0x1170 fs/jfs/jfs_metapage.c:651 ea_get+0xda0/0x12c0 fs/jfs/xattr.c:526 __jfs_setxattr+0x1ed/0x1060 fs/jfs/xattr.c:718 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:917 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 ovl_do_setxattr fs/overlayfs/overlayfs.h:310 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:322 [inline] ovl_make_workdir fs/overlayfs/super.c:710 [inline] ovl_get_workdir fs/overlayfs/super.c:822 [inline] ovl_fill_super+0x1475/0x6520 fs/overlayfs/super.c:1375 vfs_get_super fs/super.c:1273 [inline] get_tree_nodev+0xd6/0x180 fs/super.c:1292 vfs_get_tree+0x8c/0x370 fs/super.c:1784 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x79/0x110 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x70/0x7a Freed by task 109: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640 poison_slab_object mm/kasan/common.c:241 [inline] __kasan_slab_free+0x121/0x1b0 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kmem_cache_free+0x129/0x350 mm/slub.c:4363 mempool_free+0xe7/0x3a0 mm/mempool.c:554 free_metapage fs/jfs/jfs_metapage.c:191 [inline] metapage_release_folio+0x2d2/0x4e0 fs/jfs/jfs_metapage.c:551 filemap_release_folio+0x1f1/0x270 mm/filemap.c:4088 shrink_folio_list+0x292c/0x3ea0 mm/vmscan.c:1369 evict_folios+0x6e7/0x1b90 mm/vmscan.c:4521 try_to_shrink_lruvec+0x638/0xa10 mm/vmscan.c:4726 shrink_one+0x3f4/0x7b0 mm/vmscan.c:4765 shrink_many mm/vmscan.c:4828 [inline] lru_gen_shrink_node mm/vmscan.c:4929 [inline] shrink_node+0x2149/0x3740 mm/vmscan.c:5888 kswapd_shrink_node mm/vmscan.c:6693 [inline] balance_pgdat+0x9d2/0x1a90 mm/vmscan.c:6883 kswapd+0x5be/0xbf0 mm/vmscan.c:7143 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff888078414f78 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888078414f78, ffff888078415030) The buggy address belongs to the physical page: page:ffffea0001e10500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78414 head:ffffea0001e10500 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000840(slab|head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000840 ffff888017109680 dead000000000122 0000000000000000 raw: 0000000000000000 00000000801f001f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 21297, tgid 21296 (syz-executor.1), ts 752438283037, free_ts 738475606005 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311 __alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4af/0x19a0 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmem_cache_alloc+0x2e9/0x320 mm/slub.c:3867 mempool_alloc+0x176/0x390 mm/mempool.c:408 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline] __get_metapage+0x5ee/0x1170 fs/jfs/jfs_metapage.c:651 dbMount+0x11b/0xa40 fs/jfs/jfs_dmap.c:169 jfs_mount+0x282/0x890 fs/jfs/jfs_mount.c:121 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1df/0x2d0 fs/super.c:1663 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8c/0x370 fs/super.c:1784 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 page last free pid 23 tgid 23 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x51f/0xb10 mm/page_alloc.c:2346 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486 kasan_depopulate_vmalloc_pte+0x63/0x80 mm/kasan/shadow.c:415 apply_to_pte_range mm/memory.c:2619 [inline] apply_to_pmd_range mm/memory.c:2663 [inline] apply_to_pud_range mm/memory.c:2699 [inline] apply_to_p4d_range mm/memory.c:2735 [inline] __apply_to_page_range+0x57e/0xdb0 mm/memory.c:2769 kasan_release_vmalloc+0xa8/0xc0 mm/kasan/shadow.c:532 __purge_vmap_area_lazy+0x8b9/0x2170 mm/vmalloc.c:1770 drain_vmap_area_work+0x54/0xd0 mm/vmalloc.c:1804 process_one_work+0x886/0x15d0 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Memory state around the buggy address: ffff888078414e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888078414f00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fa >ffff888078414f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078415000: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff888078415080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi