[v6.1] KASAN: use-after-free Read in ocfs2_claim_suballoc_bits

3 views
Skip to first unread message

syzbot

unread,
May 31, 2025, 11:41:34 PM5/31/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: da3c5173c55f Linux 6.1.140
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11e30c82580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2bfe5a2f04bb30e3
dashboard link: https://syzkaller.appspot.com/bug?extid=fb408929fcf86a347a21
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/2c3ee4de68a1/disk-da3c5173.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/19742d73f52b/vmlinux-da3c5173.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0ffdd39d32ee/Image-da3c5173.gz.xz

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

==================================================================
BUG: KASAN: use-after-free in ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1391 [inline]
BUG: KASAN: use-after-free in ocfs2_claim_suballoc_bits+0x88c/0x1bfc fs/ocfs2/suballoc.c:1927
Read of size 4 at addr ffff0000fbf34000 by task syz.2.300/5659

CPU: 1 PID: 5659 Comm: syz.2.300 Not tainted 6.1.140-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_load4_noabort+0x2c/0x38 mm/kasan/report_generic.c:350
ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1391 [inline]
ocfs2_claim_suballoc_bits+0x88c/0x1bfc fs/ocfs2/suballoc.c:1927
ocfs2_claim_new_inode+0x2e8/0x700 fs/ocfs2/suballoc.c:2210
ocfs2_mknod_locked+0xfc/0x228 fs/ocfs2/namei.c:635
ocfs2_mknod+0xe64/0x1f18 fs/ocfs2/namei.c:381
ocfs2_mkdir+0x19c/0x4f0 fs/ocfs2/namei.c:657
vfs_mkdir+0x314/0x4d4 fs/namei.c:4106
do_mkdirat+0x1b4/0x3e0 fs/namei.c:4131
__do_sys_mkdirat fs/namei.c:4146 [inline]
__se_sys_mkdirat fs/namei.c:4144 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4144
__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 physical page:
page:00000000018cf753 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x13bf34
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc0003dde308 fffffc00038a1208 0000000000000000
raw: 0000000000000001 0000000000000002 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000fbf33f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff0000fbf33f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000fbf34000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff0000fbf34080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000fbf34100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
OCFS2: ERROR (device loop2): int ocfs2_validate_gd_self(struct super_block *, struct buffer_head *, int): Group descriptor #0 has bad signature
On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
OCFS2: File system is now read-only.
(syz.2.300,5659,1):ocfs2_search_chain:1761 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_search_chain:1871 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_claim_suballoc_bits:1940 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_claim_suballoc_bits:1983 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_claim_new_inode:2216 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_claim_new_inode:2231 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_mknod_locked:639 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_mknod:385 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_mknod:502 ERROR: status = -30
(syz.2.300,5659,1):ocfs2_mkdir:659 ERROR: status = -30


---
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,
Jun 1, 2025, 12:29:32 AM6/1/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: da3c5173c55f Linux 6.1.140
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13f4300c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2bfe5a2f04bb30e3
dashboard link: https://syzkaller.appspot.com/bug?extid=fb408929fcf86a347a21
compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=127e9970580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=110c7ed4580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/71d845f551f8/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=147e9970580000)

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

loop0: detected capacity change from 0 to 32768
ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode.
==================================================================
BUG: KASAN: use-after-free in ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1391 [inline]
BUG: KASAN: use-after-free in ocfs2_claim_suballoc_bits+0x88c/0x1bfc fs/ocfs2/suballoc.c:1927
Read of size 4 at addr ffff0000e526f000 by task syz-executor223/4314

CPU: 1 PID: 4314 Comm: syz-executor223 Not tainted 6.1.140-syzkaller #0
page:00000000fc2da8a5 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12526f
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc0003949c08 ffff00019f751e20 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000e526ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff0000e526ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000e526f000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff0000e526f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000e526f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
OCFS2: ERROR (device loop0): int ocfs2_validate_gd_self(struct super_block *, struct buffer_head *, int): Group descriptor #0 has bad signature
On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
OCFS2: File system is now read-only.
(syz-executor223,4314,1):ocfs2_search_chain:1761 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_search_chain:1871 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_claim_suballoc_bits:1940 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_claim_suballoc_bits:1983 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_claim_new_inode:2216 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_claim_new_inode:2231 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_mknod_locked:639 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_mknod:385 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_mknod:502 ERROR: status = -30
(syz-executor223,4314,1):ocfs2_mkdir:659 ERROR: status = -30


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages