[v6.1] KASAN: use-after-free Read in release_metapage (4)

2 views
Skip to first unread message

syzbot

unread,
May 21, 2025, 10:20:26 PM5/21/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 325285d9fc86 Linux 6.1.139
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12deb9f4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=3254a6fa7465fc6c
dashboard link: https://syzkaller.appspot.com/bug?extid=163200ef55c12985d915
compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/9a08990888bb/disk-325285d9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/53f0b4d064d5/vmlinux-325285d9.xz
kernel image: https://storage.googleapis.com/syzbot-assets/37e51bf8213e/Image-325285d9.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+163200...@syzkaller.appspotmail.com

loop4: detected capacity change from 0 to 32768
==================================================================
BUG: KASAN: use-after-free in drop_metapage fs/jfs/jfs_metapage.c:223 [inline]
BUG: KASAN: use-after-free in release_metapage+0x718/0xc90 fs/jfs/jfs_metapage.c:757
Read of size 8 at addr ffff0000d4fae310 by task syz.4.877/6958

CPU: 1 PID: 6958 Comm: syz.4.877 Not tainted 6.1.139-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
print_address_description+0x88/0x220 mm/kasan/report.c:316
print_report+0x50/0x68 mm/kasan/report.c:427
kasan_report+0xa8/0x100 mm/kasan/report.c:531
__asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
drop_metapage fs/jfs/jfs_metapage.c:223 [inline]
release_metapage+0x718/0xc90 fs/jfs/jfs_metapage.c:757
write_metapage fs/jfs/jfs_metapage.h:75 [inline]
flush_metapage fs/jfs/jfs_metapage.h:81 [inline]
ea_write+0x4e0/0xb40 fs/jfs/xattr.c:280
ea_put fs/jfs/xattr.c:619 [inline]
__jfs_setxattr+0xa20/0xfc8 fs/jfs/xattr.c:792
__jfs_xattr_set+0xe0/0x178 fs/jfs/xattr.c:941
jfs_xattr_set+0x58/0x70 fs/jfs/xattr.c:965
__vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
__vfs_setxattr_noperm+0x120/0x564 fs/xattr.c:216
__vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
vfs_setxattr+0x158/0x2ac fs/xattr.c:309
do_setxattr fs/xattr.c:594 [inline]
setxattr+0x228/0x28c fs/xattr.c:617
path_setxattr+0x12c/0x25c fs/xattr.c:636
__do_sys_lsetxattr fs/xattr.c:659 [inline]
__se_sys_lsetxattr fs/xattr.c:655 [inline]
__arm64_sys_lsetxattr+0xbc/0xd8 fs/xattr.c:655
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Allocated by task 6958:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
__kasan_slab_alloc+0x70/0x88 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x74/0x43c mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x234/0x318 mm/slub.c:3422
mempool_alloc_slab+0x58/0x74 mm/mempool.c:512
mempool_alloc+0x150/0x3f4 mm/mempool.c:392
alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
__get_metapage+0x5c4/0xfcc fs/jfs/jfs_metapage.c:651
ea_write+0x470/0xb40 fs/jfs/xattr.c:256
ea_put fs/jfs/xattr.c:619 [inline]
__jfs_setxattr+0xa20/0xfc8 fs/jfs/xattr.c:792
__jfs_xattr_set+0xe0/0x178 fs/jfs/xattr.c:941
jfs_xattr_set+0x58/0x70 fs/jfs/xattr.c:965
__vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
__vfs_setxattr_noperm+0x120/0x564 fs/xattr.c:216
__vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
vfs_setxattr+0x158/0x2ac fs/xattr.c:309
do_setxattr fs/xattr.c:594 [inline]
setxattr+0x228/0x28c fs/xattr.c:617
path_setxattr+0x12c/0x25c fs/xattr.c:636
__do_sys_lsetxattr fs/xattr.c:659 [inline]
__se_sys_lsetxattr fs/xattr.c:655 [inline]
__arm64_sys_lsetxattr+0xbc/0xd8 fs/xattr.c:655
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Freed by task 6965:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516
____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1750
slab_free mm/slub.c:3661 [inline]
kmem_cache_free+0x11c/0x324 mm/slub.c:3683
mempool_free_slab+0x28/0x38 mm/mempool.c:519
mempool_free+0xbc/0x2e0 mm/mempool.c:501
free_metapage fs/jfs/jfs_metapage.c:191 [inline]
metapage_release_folio+0x44c/0x5b8 fs/jfs/jfs_metapage.c:551
filemap_release_folio+0x170/0x248 mm/filemap.c:4043
fallback_migrate_folio mm/migrate.c:919 [inline]
move_to_new_folio+0x2ec/0xb5c mm/migrate.c:961
__migrate_folio_move mm/migrate.c:1199 [inline]
migrate_folio_move mm/migrate.c:1297 [inline]
migrate_pages_batch mm/migrate.c:1639 [inline]
migrate_pages+0x259c/0x3bbc mm/migrate.c:1843
compact_zone+0x2274/0x3c94 mm/compaction.c:2414
compact_node+0x1d8/0x370 mm/compaction.c:2691
compact_nodes mm/compaction.c:2707 [inline]
sysctl_compaction_handler+0x88/0x108 mm/compaction.c:2749
proc_sys_call_handler+0x3fc/0x69c fs/proc/proc_sysctl.c:602
proc_sys_write+0x2c/0x3c fs/proc/proc_sysctl.c:628
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x530/0x91c fs/read_write.c:861
vfs_iter_write+0x88/0xac fs/read_write.c:902
iter_file_splice_write+0x500/0xa18 fs/splice.c:685
do_splice_from fs/splice.c:763 [inline]
direct_splice_actor+0xe4/0x134 fs/splice.c:950
splice_direct_to_actor+0x3b4/0x978 fs/splice.c:896
do_splice_direct+0x158/0x244 fs/splice.c:1002
do_sendfile+0x458/0xc88 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1323 [inline]
__se_sys_sendfile64 fs/read_write.c:1309 [inline]
__arm64_sys_sendfile64+0x130/0x360 fs/read_write.c:1309
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the object at ffff0000d4fae2e8
which belongs to the cache jfs_mp of size 184
The buggy address is located 40 bytes inside of
184-byte region [ffff0000d4fae2e8, ffff0000d4fae3a0)

The buggy address belongs to the physical page:
page:00000000ccb5f087 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x114fae
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 0000000000000000 dead000000000122 ffff0000c6ed4480
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000d4fae200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000d4fae280: fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb
>ffff0000d4fae300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000d4fae380: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000d4fae400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Aug 29, 2025, 10:20:16 PM8/29/25
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages