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 ffff888011dbf500 by task syz.0.0/5349 CPU: 0 UID: 0 PID: 5349 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_write+0x662/0xde0 fs/jfs/xattr.c:280 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 ovl_verify_origin_fh fs/overlayfs/overlayfs.h:756 [inline] ovl_get_indexdir+0x1ff/0x600 fs/overlayfs/super.c:857 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+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd88ad9ce59 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:00007fd88bc3cfe8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fd88b015fa0 RCX: 00007fd88ad9ce59 RDX: 0000200000000000 RSI: 0000200000000040 RDI: 0000000000000000 RBP: 00007fd88ae32d6f R08: 0000200000000100 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd88b016038 R14: 00007fd88b015fa0 R15: 00007ffc83ede8a8 Allocated by task 5349: 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:4570 [inline] slab_alloc_node mm/slub.c:4899 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4906 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 ovl_verify_origin_fh fs/overlayfs/overlayfs.h:756 [inline] ovl_get_indexdir+0x1ff/0x600 fs/overlayfs/super.c:857 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+0x174/0x580 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:6251 [inline] kmem_cache_free+0x182/0x650 mm/slub.c:6378 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+0x389/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 ffff888011dbf4d8 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888011dbf4d8, ffff888011dbf590) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888011dbf7c0 pfn:0x11dbf flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff888000fd8a00 ffff888000ffc048 ffff888000ffc048 raw: ffff888011dbf7c0 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 5349, tgid 5348 (syz.0.0), ts 135442327840, free_ts 135062510419 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x22d/0x280 mm/page_alloc.c:1853 prep_new_page mm/page_alloc.c:1861 [inline] get_page_from_freelist+0x2593/0x2610 mm/page_alloc.c:3941 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5221 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:7272 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x321/0x720 mm/slub.c:4652 alloc_from_pcs mm/slub.c:4750 [inline] slab_alloc_node mm/slub.c:4884 [inline] kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4906 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+0x702/0x1330 fs/jfs/xattr.c:549 __jfs_getxattr+0xe7/0x490 fs/jfs/xattr.c:816 __vfs_getxattr+0x3f4/0x430 fs/xattr.c:441 vfs_getxattr+0x251/0x2b0 fs/xattr.c:474 ovl_do_getxattr fs/overlayfs/overlayfs.h:289 [inline] ovl_getxattr_upper fs/overlayfs/overlayfs.h:308 [inline] ovl_get_fh+0x14c/0x690 fs/overlayfs/namei.c:123 ovl_verify_fh+0x27/0x140 fs/overlayfs/namei.c:532 ovl_verify_set_fh+0x32/0x200 fs/overlayfs/namei.c:554 page last free pid 5347 tgid 5347 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1397 [inline] __free_frozen_pages+0xc1c/0xd30 mm/page_alloc.c:2938 __slab_free+0x274/0x2c0 mm/slub.c:5613 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:4570 [inline] slab_alloc_node mm/slub.c:4899 [inline] __kmalloc_cache_noprof+0x2ba/0x660 mm/slub.c:5415 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] drm_atomic_state_alloc+0xa9/0x100 drivers/gpu/drm/drm_atomic.c:178 drm_atomic_helper_dirtyfb+0x129/0xf80 drivers/gpu/drm/drm_damage_helper.c:128 drm_fbdev_shmem_helper_fb_dirty+0x160/0x2d0 drivers/gpu/drm/drm_fbdev_shmem.c:117 drm_fb_helper_fb_dirty drivers/gpu/drm/drm_fb_helper.c:249 [inline] drm_fb_helper_damage_work+0x2b3/0x750 drivers/gpu/drm/drm_fb_helper.c:275 process_one_work kernel/workqueue.c:3314 [inline] process_scheduled_works+0xb5d/0x1860 kernel/workqueue.c:3397 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3478 kthread+0x389/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 Memory state around the buggy address: ffff888011dbf400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888011dbf480: fc fc fc fc fc fc fc fc fc fc fc fa fb fb fb fb >ffff888011dbf500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888011dbf580: fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ffff888011dbf600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================