[syzbot] [ntfs3?] kernel BUG in folio_set_bh (2)

3 views
Skip to first unread message

syzbot

unread,
Jan 12, 2026, 8:31:27 PM (9 hours ago) Jan 12
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, nt...@lists.linux.dev, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 54e82e93ca93 Merge tag 'core_urgent_for_v6.19_rc4' of git:..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15df619a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=513255d80ab78f2b
dashboard link: https://syzkaller.appspot.com/bug?extid=9c4e33e12283d9437c25
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14eac5fa580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=107ad19a580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-54e82e93.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f3befb5f53a4/vmlinux-54e82e93.xz
kernel image: https://storage.googleapis.com/syzbot-assets/92820ca1dbd8/bzImage-54e82e93.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/16357ad8c17b/mount_0.gz

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

ntfs3: block size(32768) > page size(4096) not supported by filesystem
------------[ cut here ]------------
kernel BUG at fs/buffer.c:1582!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5660 Comm: syz.0.28 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:folio_set_bh+0x1dc/0x1e0 fs/buffer.c:1582
Code: 4c 89 e2 e8 a6 8f 7b 02 e9 42 ff ff ff e8 dc 0f 74 ff 48 89 df 48 c7 c6 80 8a 7a 8b e8 0d 0f db fe 90 0f 0b e8 c5 0f 74 ff 90 <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f
RSP: 0018:ffffc9000365f938 EFLAGS: 00010293
RAX: ffffffff824cf79b RBX: ffffea000161a100 RCX: ffff888042f38000
RDX: 0000000000000000 RSI: 0000000000001000 RDI: 0000000000001000
RBP: dffffc0000000000 R08: ffffea000161a107 R09: 1ffffd40002c3420
R10: dffffc0000000000 R11: fffff940002c3421 R12: 0000000000000000
R13: 0000000000001000 R14: ffff888048834658 R15: 0000000000001000
FS: 00005555565a0500(0000) GS:ffff88808d414000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fad523b5000 CR3: 00000000529ff000 CR4: 0000000000352ef0
Call Trace:
<TASK>
folio_alloc_buffers+0x3a0/0x640 fs/buffer.c:946
grow_dev_folio fs/buffer.c:1075 [inline]
grow_buffers fs/buffer.c:1116 [inline]
__getblk_slow fs/buffer.c:1134 [inline]
bdev_getblk+0x2cc/0x6e0 fs/buffer.c:1461
__bread_gfp+0x89/0x3b0 fs/buffer.c:1515
sb_bread include/linux/buffer_head.h:346 [inline]
romfs_blk_read fs/romfs/storage.c:114 [inline]
romfs_dev_read+0x22b/0x350 fs/romfs/storage.c:229
romfs_fill_super+0x20e/0x720 fs/romfs/super.c:486
get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1691
vfs_get_tree+0x92/0x2a0 fs/super.c:1751
fc_mount fs/namespace.c:1199 [inline]
do_new_mount_fc fs/namespace.c:3636 [inline]
do_new_mount+0x302/0xa10 fs/namespace.c:3712
do_mount fs/namespace.c:4035 [inline]
__do_sys_mount fs/namespace.c:4224 [inline]
__se_sys_mount+0x313/0x410 fs/namespace.c:4201
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f99b118f7c9
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:00007fffee29d558 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f99b13e5fa0 RCX: 00007f99b118f7c9
RDX: 0000200000000000 RSI: 00002000000001c0 RDI: 0000200000000140
RBP: 00007f99b1213f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000008000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f99b13e5fa0 R14: 00007f99b13e5fa0 R15: 0000000000000005
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:folio_set_bh+0x1dc/0x1e0 fs/buffer.c:1582
Code: 4c 89 e2 e8 a6 8f 7b 02 e9 42 ff ff ff e8 dc 0f 74 ff 48 89 df 48 c7 c6 80 8a 7a 8b e8 0d 0f db fe 90 0f 0b e8 c5 0f 74 ff 90 <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f
RSP: 0018:ffffc9000365f938 EFLAGS: 00010293
RAX: ffffffff824cf79b RBX: ffffea000161a100 RCX: ffff888042f38000
RDX: 0000000000000000 RSI: 0000000000001000 RDI: 0000000000001000
RBP: dffffc0000000000 R08: ffffea000161a107 R09: 1ffffd40002c3420
R10: dffffc0000000000 R11: fffff940002c3421 R12: 0000000000000000
R13: 0000000000001000 R14: ffff888048834658 R15: 0000000000001000
FS: 00005555565a0500(0000) GS:ffff88808d414000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c0094f8000 CR3: 00000000529ff000 CR4: 0000000000352ef0


---
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 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.

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,
2:59 AM (2 hours ago) 2:59 AM
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: [PATCH] romfs: check sb_set_blocksize() return value
Author: karti...@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

romfs_fill_super() ignores the return value of sb_set_blocksize(), which
can fail if the requested block size is incompatible with the block
device's configuration.

This can be triggered by setting a loop device's block size larger than
PAGE_SIZE using ioctl(LOOP_SET_BLOCK_SIZE, 32768), then mounting a romfs
filesystem on that device.

When sb_set_blocksize(sb, ROMBSIZE) is called with ROMBSIZE=4096 but the
device has logical_block_size=32768, bdev_validate_blocksize() fails
because the requested size is smaller than the device's logical block
size. sb_set_blocksize() returns 0 (failure), but romfs ignores this and
continues mounting.

The superblock's block size remains at the device's logical block size
(32768). Later, when sb_bread() attempts I/O with this oversized block
size, it triggers a kernel BUG in folio_set_bh():

kernel BUG at fs/buffer.c:1582!
BUG_ON(size > PAGE_SIZE);

Fix by checking the return value of sb_set_blocksize() and failing the
mount with -EINVAL if it returns 0.

Reported-by: syzbot+9c4e33...@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9c4e33e12283d9437c25
Signed-off-by: Deepanshu Kartikey <karti...@gmail.com>
---
fs/romfs/super.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/romfs/super.c b/fs/romfs/super.c
index 360b00854115..ac55193bf398 100644
--- a/fs/romfs/super.c
+++ b/fs/romfs/super.c
@@ -458,7 +458,10 @@ static int romfs_fill_super(struct super_block *sb, struct fs_context *fc)

#ifdef CONFIG_BLOCK
if (!sb->s_mtd) {
- sb_set_blocksize(sb, ROMBSIZE);
+ if (!sb_set_blocksize(sb, ROMBSIZE)) {
+ errorf(fc, "romfs: unable to set blocksize\n");
+ return -EINVAL;
+ }
} else {
sb->s_blocksize = ROMBSIZE;
sb->s_blocksize_bits = blksize_bits(ROMBSIZE);
--
2.43.0

syzbot

unread,
3:35 AM (2 hours ago) 3:35 AM
to karti...@gmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+9c4e33...@syzkaller.appspotmail.com
Tested-by: syzbot+9c4e33...@syzkaller.appspotmail.com

Tested on:

commit: b71e635f Merge tag 'cgroup-for-6.19-rc5-fixes' of git:..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15df7922580000
kernel config: https://syzkaller.appspot.com/x/.config?x=3027d9a5f96d82ca
dashboard link: https://syzkaller.appspot.com/bug?extid=9c4e33e12283d9437c25
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=150315fa580000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages