JFS: metapage_get_blocks failed
ERROR: (device loop5): release_metapage: metapage_write_one() failed
ERROR: (device loop5): 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 ffff888024aacad0 by task syz.5.685/9237
CPU: 1 UID: 0 PID: 9237 Comm: syz.5.685 Not tainted 6.12.0-rc7-syzkaller #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
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:0x7fa9ee17e719
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:00007fa9eef22038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa9ee336130 RCX: 00007fa9ee17e719
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa9ee1f1616 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fa9ee336130 R15: 00007fff283aa7e8
Allocated by task 9237:
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 9236:
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_pages_range+0x271/0xe80 mm/truncate.c:342
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 ffff888024aacaa8
which belongs to the cache jfs_mp of size 184
The buggy address is located 40 bytes inside of
freed 184-byte region [ffff888024aacaa8, ffff888024aacb60)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024aac3e0 pfn:0x24aac
anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888147686a00 0000000000000000 0000000000000001
raw: ffff888024aac3e0 0000000080100002 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 6404, tgid 6403 (syz.5.130), ts 160565234170, free_ts 160544330953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541
prep_new_page mm/page_alloc.c:1549 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459
__alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735
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
diReadSpecial+0x18d/0x6e0 fs/jfs/jfs_imap.c:447
jfs_mount+0xe4/0x8a0 fs/jfs/jfs_mount.c:87
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 6404 tgid 6403 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1112 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642
__put_partials+0x14c/0x170 mm/slub.c:3145
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_noprof+0x121/0x2f0 mm/slub.c:4141
__kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624
kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700
kernfs_create_dir_ns+0x4c/0x150 fs/kernfs/dir.c:1061
internal_create_group+0x34b/0xe50 fs/sysfs/group.c:167
loop_sysfs_init drivers/block/loop.c:762 [inline]
loop_configure+0x8b2/0x11f0 drivers/block/loop.c:1099
lo_ioctl+0x738/0x18b0 drivers/block/loop.c:1525
blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x192/0x220 fs/ioctl.c:893
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
Memory state around the buggy address:
ffff888024aac980: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb
ffff888024aaca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
>ffff888024aaca80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb
^
ffff888024aacb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff888024aacb80: fc fc fc fc fa 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 ffff888024aacb50 by task syz.5.685/9237
CPU: 0 UID: 0 PID: 9237 Comm: syz.5.685 Tainted: G B 6.12.0-rc7-syzkaller #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:0x7fa9ee17e719
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:00007fa9eef22038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa9ee336130 RCX: 00007fa9ee17e719
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa9ee1f1616 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fa9ee336130 R15: 00007fff283aa7e8
Allocated by task 9237:
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 9236:
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_pages_range+0x271/0xe80 mm/truncate.c:342
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 ffff888024aacaa8
which belongs to the cache jfs_mp of size 184
The buggy address is located 168 bytes inside of
freed 184-byte region [ffff888024aacaa8, ffff888024aacb60)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024aac3e0 pfn:0x24aac
anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888147686a00 0000000000000000 0000000000000001
raw: ffff888024aac3e0 0000000080100002 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 6404, tgid 6403 (syz.5.130), ts 160565234170, free_ts 160544330953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541
prep_new_page mm/page_alloc.c:1549 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459
__alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735
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
diReadSpecial+0x18d/0x6e0 fs/jfs/jfs_imap.c:447
jfs_mount+0xe4/0x8a0 fs/jfs/jfs_mount.c:87
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 6404 tgid 6403 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1112 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642
__put_partials+0x14c/0x170 mm/slub.c:3145
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_noprof+0x121/0x2f0 mm/slub.c:4141
__kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624
kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700
kernfs_create_dir_ns+0x4c/0x150 fs/kernfs/dir.c:1061
internal_create_group+0x34b/0xe50 fs/sysfs/group.c:167
loop_sysfs_init drivers/block/loop.c:762 [inline]
loop_configure+0x8b2/0x11f0 drivers/block/loop.c:1099
lo_ioctl+0x738/0x18b0 drivers/block/loop.c:1525
blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x192/0x220 fs/ioctl.c:893
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
Memory state around the buggy address:
ffff888024aaca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
ffff888024aaca80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb
>ffff888024aacb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
^
ffff888024aacb80: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb
ffff888024aacc00: fb fb fb fb fb fb fb fb fb fb fb 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 ffff888024aacac8 by task syz.5.685/9237
CPU: 1 UID: 0 PID: 9237 Comm: syz.5.685 Tainted: G B 6.12.0-rc7-syzkaller #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:0x7fa9ee17e719
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:00007fa9eef22038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa9ee336130 RCX: 00007fa9ee17e719
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa9ee1f1616 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fa9ee336130 R15: 00007fff283aa7e8
Allocated by task 9237:
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 9236:
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_pages_range+0x271/0xe80 mm/truncate.c:342
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 ffff888024aacaa8
which belongs to the cache jfs_mp of size 184
The buggy address is located 32 bytes inside of
freed 184-byte region [ffff888024aacaa8, ffff888024aacb60)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024aac3e0 pfn:0x24aac
anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888147686a00 0000000000000000 0000000000000001
raw: ffff888024aac3e0 0000000080100002 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 6404, tgid 6403 (syz.5.130), ts 160565234170, free_ts 160544330953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541
prep_new_page mm/page_alloc.c:1549 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459
__alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735
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
diReadSpecial+0x18d/0x6e0 fs/jfs/jfs_imap.c:447
jfs_mount+0xe4/0x8a0 fs/jfs/jfs_mount.c:87
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 6404 tgid 6403 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1112 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642
__put_partials+0x14c/0x170 mm/slub.c:3145
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_noprof+0x121/0x2f0 mm/slub.c:4141
__kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624
kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700
kernfs_create_dir_ns+0x4c/0x150 fs/kernfs/dir.c:1061
internal_create_group+0x34b/0xe50 fs/sysfs/group.c:167
loop_sysfs_init drivers/block/loop.c:762 [inline]
loop_configure+0x8b2/0x11f0 drivers/block/loop.c:1099
lo_ioctl+0x738/0x18b0 drivers/block/loop.c:1525
blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x192/0x220 fs/ioctl.c:893
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
Memory state around the buggy address:
ffff888024aac980: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb
ffff888024aaca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
>ffff888024aaca80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb
^
ffff888024aacb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff888024aacb80: fc fc fc fc fa 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 ffff888024aacac8 by task syz.5.685/9237
CPU: 1 UID: 0 PID: 9237 Comm: syz.5.685 Tainted: G B 6.12.0-rc7-syzkaller #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:0x7fa9ee17e719
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:00007fa9eef22038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa9ee336130 RCX: 00007fa9ee17e719
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa9ee1f1616 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fa9ee336130 R15: 00007fff283aa7e8
Allocated by task 9237:
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 9236:
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_pages_range+0x271/0xe80 mm/truncate.c:342
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 ffff888024aacaa8
which belongs to the cache jfs_mp of size 184
The buggy address is located 32 bytes inside of
freed 184-byte region [ffff888024aacaa8, ffff888024aacb60)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024aac3e0 pfn:0x24aac
anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888147686a00 0000000000000000 0000000000000001
raw: ffff888024aac3e0 0000000080100002 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 6404, tgid 6403 (syz.5.130), ts 160565234170, free_ts 160544330953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541
prep_new_page mm/page_alloc.c:1549 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459
__alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735
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
diReadSpecial+0x18d/0x6e0 fs/jfs/jfs_imap.c:447
jfs_mount+0xe4/0x8a0 fs/jfs/jfs_mount.c:87
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 6404 tgid 6403 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1112 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642
__put_partials+0x14c/0x170 mm/slub.c:3145
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_noprof+0x121/0x2f0 mm/slub.c:4141
__kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624
kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700
kernfs_create_dir_ns+0x4c/0x150 fs/kernfs/dir.c:1061
internal_create_group+0x34b/0xe50 fs/sysfs/group.c:167
loop_sysfs_init drivers/block/loop.c:762 [inline]
loop_configure+0x8b2/0x11f0 drivers/block/loop.c:1099
lo_ioctl+0x738/0x18b0 drivers/block/loop.c:1525
blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x192/0x220 fs/ioctl.c:893
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
Memory state around the buggy address:
ffff888024aac980: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb
ffff888024aaca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
>ffff888024aaca80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb
^
ffff888024aacb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff888024aacb80: fc fc fc fc fa 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 ffff888024aacac8 by task syz.5.685/9237
CPU: 0 UID: 0 PID: 9237 Comm: syz.5.685 Tainted: G B 6.12.0-rc7-syzkaller #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:0x7fa9ee17e719
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:00007fa9eef22038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa9ee336130 RCX: 00007fa9ee17e719
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa9ee1f1616 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fa9ee336130 R15: 00007fff283aa7e8
Allocated by task 9237:
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 9236:
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_pages_range+0x271/0xe80 mm/truncate.c:342
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 ffff888024aacaa8
which belongs to the cache jfs_mp of size 184
The buggy address is located 32 bytes inside of
freed 184-byte region [ffff888024aacaa8, ffff888024aacb60)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024aac3e0 pfn:0x24aac
anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888147686a00 0000000000000000 0000000000000001
raw: ffff888024aac3e0 0000000080100002 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 6404, tgid 6403 (syz.5.130), ts 160565234170, free_ts 160544330953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541
prep_new_page mm/page_alloc.c:1549 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459
__alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735
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
diReadSpecial+0x18d/0x6e0 fs/jfs/jfs_imap.c:447
jfs_mount+0xe4/0x8a0 fs/jfs/jfs_mount.c:87
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 6404 tgid 6403 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1112 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642
__put_partials+0x14c/0x170 mm/slub.c:3145
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_noprof+0x121/0x2f0 mm/slub.c:4141
__kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624
kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700
kernfs_create_dir_ns+0x4c/0x150 fs/kernfs/dir.c:1061
internal_create_group+0x34b/0xe50 fs/sysfs/group.c:167
loop_sysfs_init drivers/block/loop.c:762 [inline]
loop_configure+0x8b2/0x11f0 drivers/block/loop.c:1099
lo_ioctl+0x738/0x18b0 drivers/block/loop.c:1525
blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x192/0x220 fs/ioctl.c:893
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
Memory state around the buggy address:
ffff888024aac980: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb
ffff888024aaca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
>ffff888024aaca80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb
^
ffff888024aacb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff888024aacb80: fc fc fc fc fa 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 ffff888024aacac8 by task syz.5.685/9237
CPU: 1 UID: 0 PID: 9237 Comm: syz.5.685 Tainted: G B 6.12.0-rc7-syzkaller #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:0x7fa9ee17e719
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:00007fa9eef22038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa9ee336130 RCX: 00007fa9ee17e719
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa9ee1f1616 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fa9ee336130 R15: 00007fff283aa7e8
Allocated by task 9237:
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 9236:
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_pages_range+0x271/0xe80 mm/truncate.c:342
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 ffff888024aacaa8
which belongs to the cache jfs_mp of size 184
The buggy address is located 32 bytes inside of
freed 184-byte region [ffff888024aacaa8, ffff888024aacb60)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024aac3e0 pfn:0x24aac
anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888147686a00 0000000000000000 0000000000000001
raw: ffff888024aac3e0 0000000080100002 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 6404, tgid 6403 (syz.5.130), ts 160565234170, free_ts 160544330953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541
prep_new_page mm/page_alloc.c:1549 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459
__alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735
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
diReadSpecial+0x18d/0x6e0 fs/jfs/jfs_imap.c:447
jfs_mount+0xe4/0x8a0 fs/jfs/jfs_mount.c:87
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 6404 tgid 6403 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1112 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642
__put_partials+0x14c/0x170 mm/slub.c:3145
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_noprof+0x121/0x2f0 mm/slub.c:4141
__kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624
kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700
kernfs_create_dir_ns+0x4c/0x150 fs/kernfs/dir.c:1061
internal_create_group+0x34b/0xe50 fs/sysfs/group.c:167
loop_sysfs_init drivers/block/loop.c:762 [inline]
loop_configure+0x8b2/0x11f0 drivers/block/loop.c:1099
lo_ioctl+0x738/0x18b0 drivers/block/loop.c:1525
blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x192/0x220 fs/ioctl.c:893
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
Memory state around the buggy address:
ffff888024aac980: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb
ffff888024aaca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
>ffff888024aaca80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb
^
ffff888024aacb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff888024aacb80: fc fc fc fc fa 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 ffff888024aacaa8 by task syz.5.685/9237
CPU: 1 UID: 0 PID: 9237 Comm: syz.5.685 Tainted: G B 6.12.0-rc7-syzkaller #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:0x7fa9ee17e719
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:00007fa9eef22038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa9ee336130 RCX: 00007fa9ee17e719
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa9ee1f1616 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fa9ee336130 R15: 00007fff283aa7e8
Allocated by task 9237:
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 9236:
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_pages_range+0x271/0xe80 mm/truncate.c:342
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 ffff888024aacaa8
which belongs to the cache jfs_mp of size 184
The buggy address is located 0 bytes inside of
184-byte region [ffff888024aacaa8, ffff888024aacb60)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024aac3e0 pfn:0x24aac
anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888147686a00 0000000000000000 0000000000000001
raw: ffff888024aac3e0 0000000080100002 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 6404, tgid 6403 (syz.5.130), ts 160565234170, free_ts 160544330953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541
prep_new_page mm/page_alloc.c:1549 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459
__alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735
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
diReadSpecial+0x18d/0x6e0 fs/jfs/jfs_imap.c:447
jfs_mount+0xe4/0x8a0 fs/jfs/jfs_mount.c:87
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 6404 tgid 6403 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1112 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2642
__put_partials+0x14c/0x170 mm/slub.c:3145
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_noprof+0x121/0x2f0 mm/slub.c:4141
__kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:624
kernfs_new_node+0x186/0x240 fs/kernfs/dir.c:700
kernfs_create_dir_ns+0x4c/0x150 fs/kernfs/dir.c:1061
internal_create_group+0x34b/0xe50 fs/sysfs/group.c:167
loop_sysfs_init drivers/block/loop.c:762 [inline]
loop_configure+0x8b2/0x11f0 drivers/block/loop.c:1099
lo_ioctl+0x738/0x18b0 drivers/block/loop.c:1525
blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x192/0x220 fs/ioctl.c:893
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
Memory state around the buggy address:
ffff888024aac980: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb
ffff888024aaca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
>ffff888024aaca80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb
^
ffff888024aacb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff888024aacb80: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb
==================================================================