[v6.1] UBSAN: shift-out-of-bounds in gfs2_dir_read

20 views
Skip to first unread message

syzbot

unread,
Jul 14, 2025, 9:59:32 PM7/14/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f2198ea7eb3e Linux 6.1.145
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1765518c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e64d77413184340b
dashboard link: https://syzkaller.appspot.com/bug?extid=949a6433cc143f529b9c
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/b56a4aeab209/disk-f2198ea7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/6e8781bcd6b5/vmlinux-f2198ea7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/54e6b0704c35/Image-f2198ea7.gz.xz

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

gfs2: fsid=syz:syz.s: journal 0 mapped with 5 extents in 0ms
gfs2: fsid=syz:syz.s: first mount done, others may mount
================================================================================
UBSAN: shift-out-of-bounds in fs/gfs2/dir.c:1541:15
shift exponent 32 is too large for 32-bit type 'u32' (aka 'unsigned int')
CPU: 0 PID: 8295 Comm: syz.3.1357 Not tainted 6.1.145-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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
dump_stack+0x1c/0x5c lib/dump_stack.c:113
ubsan_epilogue+0x14/0x48 lib/ubsan.c:151
__ubsan_handle_shift_out_of_bounds+0x2b0/0x34c lib/ubsan.c:321
dir_e_read fs/gfs2/dir.c:1541 [inline]
gfs2_dir_read+0x1334/0x1378 fs/gfs2/dir.c:1582
gfs2_readdir+0x160/0x1c0 fs/gfs2/file.c:115
iterate_dir+0x1f0/0x4cc fs/readdir.c:-1
__do_sys_getdents64 fs/readdir.c:369 [inline]
__se_sys_getdents64 fs/readdir.c:354 [inline]
__arm64_sys_getdents64+0x11c/0x318 fs/readdir.c:354
__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
================================================================================
gfs2: fsid=syz:syz.s: fatal: filesystem consistency error
inode = 12 2341
function = gfs2_dir_get_hash_table, file = fs/gfs2/dir.c, line = 350
gfs2: fsid=syz:syz.s: G: s:SH n:2/925 f:qob t:SH d:EX/0 a:0 v:0 r:3 m:20 p:1
gfs2: fsid=syz:syz.s: H: s:SH f:H e:0 p:8295 [syz.3.1357] iterate_dir+0x1f0/0x4cc fs/readdir.c:-1
gfs2: fsid=syz:syz.s: I: n:12/2341 t:4 f:0x00 d:0x00000006 s:3864 p:0
gfs2: fsid=syz:syz.s: about to withdraw this file system
gfs2: fsid=syz:syz.s: Journal recovery skipped for jid 0 until next mount.
gfs2: fsid=syz:syz.s: Glock dequeues delayed: 0
gfs2: fsid=syz:syz.s: File system withdrawn
CPU: 0 PID: 8295 Comm: syz.3.1357 Not tainted 6.1.145-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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
dump_stack+0x1c/0x5c lib/dump_stack.c:113
gfs2_withdraw+0xf9c/0x13a8 fs/gfs2/util.c:366
gfs2_consist_inode_i+0xf0/0x10c fs/gfs2/util.c:468
gfs2_dir_get_hash_table+0x194/0x830 fs/gfs2/dir.c:350
dir_e_read fs/gfs2/dir.c:1545 [inline]
gfs2_dir_read+0x2b8/0x1378 fs/gfs2/dir.c:1582
gfs2_readdir+0x160/0x1c0 fs/gfs2/file.c:115
iterate_dir+0x1f0/0x4cc fs/readdir.c:-1
__do_sys_getdents64 fs/readdir.c:369 [inline]
__se_sys_getdents64 fs/readdir.c:354 [inline]
__arm64_sys_getdents64+0x11c/0x318 fs/readdir.c:354
__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


---
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,
Jul 14, 2025, 10:48:35 PM7/14/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 89950c454265 Linux 5.15.188
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=130dc7d4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2b66ee871ee5d301
dashboard link: https://syzkaller.appspot.com/bug?extid=f1fa2e48b9372b638fee
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/0ead69d25899/disk-89950c45.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ddd0acb3cb5f/vmlinux-89950c45.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4f764188587c/Image-89950c45.gz.xz

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

gfs2: fsid=syz:syz.s: journal 0 mapped with 5 extents in 0ms
gfs2: fsid=syz:syz.s: first mount done, others may mount
================================================================================
UBSAN: shift-out-of-bounds in fs/gfs2/dir.c:1542:15
shift exponent 32 is too large for 32-bit type 'u32' (aka 'unsigned int')
CPU: 0 PID: 6178 Comm: syz.3.657 Not tainted 5.15.188-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call trace:
dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
ubsan_epilogue+0x14/0x48 lib/ubsan.c:151
__ubsan_handle_shift_out_of_bounds+0x2b4/0x358 lib/ubsan.c:321
dir_e_read fs/gfs2/dir.c:1542 [inline]
gfs2_dir_read+0x1348/0x138c fs/gfs2/dir.c:1583
gfs2_readdir+0x134/0x194 fs/gfs2/file.c:115
iterate_dir+0x1f0/0x4cc fs/readdir.c:-1
__do_sys_getdents64 fs/readdir.c:369 [inline]
__se_sys_getdents64 fs/readdir.c:354 [inline]
__arm64_sys_getdents64+0x11c/0x340 fs/readdir.c:354
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
================================================================================
gfs2: fsid=syz:syz.s: fatal: filesystem consistency error
inode = 12 2341
function = gfs2_dir_get_hash_table, file = fs/gfs2/dir.c, line = 350
gfs2: fsid=syz:syz.s: about to withdraw this file system
gfs2: fsid=syz:syz.s: Journal recovery skipped for jid 0 until next mount.
gfs2: fsid=syz:syz.s: Glock dequeues delayed: 0
gfs2: fsid=syz:syz.s: File system withdrawn
CPU: 0 PID: 6178 Comm: syz.3.657 Not tainted 5.15.188-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call trace:
dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
gfs2_withdraw+0xc60/0x129c fs/gfs2/util.c:355
gfs2_consist_inode_i+0xcc/0xe8 fs/gfs2/util.c:456
gfs2_dir_get_hash_table+0x194/0x830 fs/gfs2/dir.c:350
dir_e_read fs/gfs2/dir.c:1546 [inline]
gfs2_dir_read+0x2b8/0x138c fs/gfs2/dir.c:1583
gfs2_readdir+0x134/0x194 fs/gfs2/file.c:115
iterate_dir+0x1f0/0x4cc fs/readdir.c:-1
__do_sys_getdents64 fs/readdir.c:369 [inline]
__se_sys_getdents64 fs/readdir.c:354 [inline]
__arm64_sys_getdents64+0x11c/0x340 fs/readdir.c:354
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

syzbot

unread,
Jul 15, 2025, 12:45:34 PM7/15/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: f2198ea7eb3e Linux 6.1.145
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1296e98c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e64d77413184340b
dashboard link: https://syzkaller.appspot.com/bug?extid=949a6433cc143f529b9c
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15464382580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=168d27d4580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/fc02c989e330/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=11464382580000)

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

gfs2: fsid=syz:syz.s: journal 0 mapped with 5 extents in 0ms
gfs2: fsid=syz:syz.s: first mount done, others may mount
================================================================================
UBSAN: shift-out-of-bounds in fs/gfs2/dir.c:1541:15
shift exponent 32 is too large for 32-bit type 'u32' (aka 'unsigned int')
CPU: 0 PID: 4463 Comm: syz.0.16 Not tainted 6.1.145-syzkaller #0
gfs2: fsid=syz:syz.s: H: s:SH f:H e:0 p:4463 [syz.0.16] iterate_dir+0x1f0/0x4cc fs/readdir.c:-1
gfs2: fsid=syz:syz.s: I: n:12/2341 t:4 f:0x00 d:0x00000006 s:3864 p:0
gfs2: fsid=syz:syz.s: about to withdraw this file system
gfs2: fsid=syz:syz.s: Journal recovery skipped for jid 0 until next mount.
gfs2: fsid=syz:syz.s: Glock dequeues delayed: 0
gfs2: fsid=syz:syz.s: File system withdrawn
CPU: 0 PID: 4463 Comm: syz.0.16 Not tainted 6.1.145-syzkaller #0
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.

syzbot

unread,
Jul 15, 2025, 1:58:36 PM7/15/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 89950c454265 Linux 5.15.188
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1684318c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2b66ee871ee5d301
dashboard link: https://syzkaller.appspot.com/bug?extid=f1fa2e48b9372b638fee
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13c1e98c580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=152908f0580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/ddcfb1b176ba/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=16614382580000)

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

gfs2: fsid=syz:syz.s: journal 0 mapped with 5 extents in 0ms
gfs2: fsid=syz:syz.s: first mount done, others may mount
================================================================================
UBSAN: shift-out-of-bounds in fs/gfs2/dir.c:1542:15
shift exponent 32 is too large for 32-bit type 'u32' (aka 'unsigned int')
CPU: 1 PID: 4158 Comm: syz.0.16 Not tainted 5.15.188-syzkaller #0
CPU: 1 PID: 4158 Comm: syz.0.16 Not tainted 5.15.188-syzkaller #0
Reply all
Reply to author
Forward
0 new messages