JFS: metapage_get_blocks failed ================================================================== BUG: KASAN: slab-use-after-free in release_metapage+0x858/0x880 fs/jfs/jfs_metapage.c:777 Read of size 8 at addr ffff888031f06e28 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Not tainted 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 release_metapage+0x858/0x880 fs/jfs/jfs_metapage.c:777 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 152 bytes inside of freed 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ^ ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== ERROR: (device loop3): release_metapage: metapage_write_one() failed ERROR: (device loop3): remounting filesystem as read-only ================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:229 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x80d/0x880 fs/jfs/jfs_metapage.c:784 Read of size 8 at addr ffff888031f06db8 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Tainted: G B 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 drop_metapage fs/jfs/jfs_metapage.c:229 [inline] release_metapage+0x80d/0x880 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 40 bytes inside of freed 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:229 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x770/0x880 fs/jfs/jfs_metapage.c:784 Read of size 4 at addr ffff888031f06e38 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Tainted: G B 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 drop_metapage fs/jfs/jfs_metapage.c:229 [inline] release_metapage+0x770/0x880 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 168 bytes inside of freed 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ^ ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:229 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x2c3/0x880 fs/jfs/jfs_metapage.c:784 Read of size 8 at addr ffff888031f06db0 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Tainted: G B 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] drop_metapage fs/jfs/jfs_metapage.c:229 [inline] release_metapage+0x2c3/0x880 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 32 bytes inside of freed 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:206 [inline] BUG: KASAN: slab-use-after-free in arch_test_bit arch/x86/include/asm/bitops.h:238 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:229 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x787/0x880 fs/jfs/jfs_metapage.c:784 Read of size 8 at addr ffff888031f06db0 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Tainted: G B 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 constant_test_bit arch/x86/include/asm/bitops.h:206 [inline] arch_test_bit arch/x86/include/asm/bitops.h:238 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] drop_metapage fs/jfs/jfs_metapage.c:229 [inline] release_metapage+0x787/0x880 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 32 bytes inside of freed 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:230 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x30f/0x880 fs/jfs/jfs_metapage.c:784 Read of size 8 at addr ffff888031f06db0 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Tainted: G B 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] drop_metapage fs/jfs/jfs_metapage.c:230 [inline] release_metapage+0x30f/0x880 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 32 bytes inside of freed 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: slab-use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:206 [inline] BUG: KASAN: slab-use-after-free in arch_test_bit arch/x86/include/asm/bitops.h:238 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:230 [inline] BUG: KASAN: slab-use-after-free in release_metapage+0x84e/0x880 fs/jfs/jfs_metapage.c:784 Read of size 8 at addr ffff888031f06db0 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Tainted: G B 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 constant_test_bit arch/x86/include/asm/bitops.h:206 [inline] arch_test_bit arch/x86/include/asm/bitops.h:238 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] drop_metapage fs/jfs/jfs_metapage.c:230 [inline] release_metapage+0x84e/0x880 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 32 bytes inside of freed 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ================================================================== BUG: KASAN: double-free in mempool_free+0xea/0x3b0 mm/mempool.c:548 Free of addr ffff888031f06d90 by task syz.3.224/6732 CPU: 1 UID: 0 PID: 6732 Comm: syz.3.224 Tainted: G B 6.12.0-rc7-syzkaller-00125-gcfaaa7d010d1 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report_invalid_free+0xaa/0xd0 mm/kasan/report.c:563 check_slab_allocation+0xfd/0x130 mm/kasan/common.c:225 kasan_slab_pre_free include/linux/kasan.h:195 [inline] slab_free_hook mm/slub.c:2287 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x121/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] drop_metapage fs/jfs/jfs_metapage.c:234 [inline] release_metapage+0x47d/0x880 fs/jfs/jfs_metapage.c:784 write_metapage fs/jfs/jfs_metapage.h:75 [inline] flush_metapage fs/jfs/jfs_metapage.h:81 [inline] ea_write+0x5c4/0xc60 fs/jfs/xattr.c:280 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1022d7e719 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:00007f10211b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f1022f36130 RCX: 00007f1022d7e719 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007f1022df175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1022f36130 R15: 00007fff39c1ba28 Allocated by task 6732: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 ea_write+0x6d2/0xc60 fs/jfs/xattr.c:256 ea_put fs/jfs/xattr.c:621 [inline] __jfs_setxattr+0xebd/0x1070 fs/jfs/xattr.c:787 __jfs_xattr_set+0xc6/0x150 fs/jfs/xattr.c:936 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_lsetxattr fs/xattr.c:683 [inline] __se_sys_lsetxattr fs/xattr.c:679 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:679 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6731: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 mempool_free+0xea/0x3b0 mm/mempool.c:548 free_metapage fs/jfs/jfs_metapage.c:197 [inline] metapage_release_folio+0x2f7/0x4e0 fs/jfs/jfs_metapage.c:552 folio_invalidate mm/truncate.c:141 [inline] truncate_cleanup_folio+0x31c/0x4b0 mm/truncate.c:161 truncate_inode_folio mm/truncate.c:177 [inline] truncate_inode_pages_range+0xab0/0xe80 mm/truncate.c:399 jfs_remount+0x4c1/0x650 fs/jfs/super.c:451 legacy_reconfigure+0x11c/0x180 fs/fs_context.c:685 reconfigure_super+0x452/0xb60 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:262 [inline] vfs_fsconfig_locked fs/fsopen.c:291 [inline] __do_sys_fsconfig+0x9d6/0xbe0 fs/fsopen.c:472 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888031f06d90 which belongs to the cache jfs_mp of size 184 The buggy address is located 0 bytes inside of 184-byte region [ffff888031f06d90, ffff888031f06e48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31f06 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888146eb88c0 ffffea000088dec0 0000000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 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 6130, tgid 6129 (syz.4.58), ts 107410633367, free_ts 107408589595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 mempool_alloc_noprof+0x179/0x390 mm/mempool.c:402 alloc_metapage fs/jfs/jfs_metapage.c:182 [inline] __get_metapage+0x789/0xfb0 fs/jfs/jfs_metapage.c:652 diMount+0xe6/0x8d0 fs/jfs/jfs_imap.c:111 jfs_mount+0x171/0x8a0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:556 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 kernel_thread+0xc0/0x100 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:767 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888031f06c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ffff888031f06d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc >ffff888031f06d80: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888031f06e00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888031f06e80: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================