[v5.15] UBSAN: array-index-out-of-bounds in dbSplit

0 views
Skip to first unread message

syzbot

unread,
Oct 3, 2024, 3:39:25 PM10/3/24
Hello,

syzbot found the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=107453d0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=15fabea3f21e03099ab1
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ef5025f3d708/disk-3a592870.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/776fbdad3aa8/vmlinux-3a592870.xz
kernel image: https://storage.googleapis.com/syzbot-assets/79541db5bd16/bzImage-3a592870.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:2696:27
index 4294967295 is out of range for type 's8[1365]' (aka 'signed char[1365]')
CPU: 0 PID: 4964 Comm: syz.4.274 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_out_of_bounds+0x118/0x140 lib/ubsan.c:282
dbSplit+0x1fd/0x220 fs/jfs/jfs_dmap.c:2696
dbAllocBits+0x4e5/0x9a0 fs/jfs/jfs_dmap.c:2259
dbAllocDmap fs/jfs/jfs_dmap.c:2100 [inline]
dbAllocDmapLev+0x24c/0x490 fs/jfs/jfs_dmap.c:2054
dbAllocCtl+0x113/0x920 fs/jfs/jfs_dmap.c:1891
dbAllocAG+0x28b/0x10b0 fs/jfs/jfs_dmap.c:1432
dbAlloc+0x654/0xc90 fs/jfs/jfs_dmap.c:888
dtSplitUp fs/jfs/jfs_dtree.c:979 [inline]
dtInsert+0xda3/0x6b00 fs/jfs/jfs_dtree.c:868
jfs_create+0x7b2/0xbb0 fs/jfs/namei.c:137
vfs_create+0x306/0x490 fs/namei.c:3162
do_mknodat+0x3f5/0x690 fs/namei.c:3994
__do_sys_mknod fs/namei.c:4027 [inline]
__se_sys_mknod fs/namei.c:4025 [inline]
__x64_sys_mknod+0x8a/0xa0 fs/namei.c:4025
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f2155715ff9
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:00007f2153b6d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000085
RAX: ffffffffffffffda RBX: 00007f21558ce058 RCX: 00007f2155715ff9
RDX: 0000000000000709 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 00007f2155788296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f21558ce058 R15: 00007ffd9fcb94e8
</TASK>
================================================================================


---
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 [email protected].

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,
Oct 7, 2024, 6:13:27 AM10/7/24
syzbot has found a reproducer for the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16f04327980000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1429e79f980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=109c5b80580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/c20ee6e1ed2f/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

loop0: detected capacity change from 0 to 32768
loop0: detected capacity change from 32768 to 32745
================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:2696:27
index 4294967295 is out of range for type 's8[1365]' (aka 'signed char[1365]')
CPU: 1 PID: 3578 Comm: syz-executor402 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_out_of_bounds+0x118/0x140 lib/ubsan.c:282
dbSplit+0x1fd/0x220 fs/jfs/jfs_dmap.c:2696
dbAllocBits+0x4e5/0x9a0 fs/jfs/jfs_dmap.c:2259
dbAllocDmap fs/jfs/jfs_dmap.c:2100 [inline]
dbAllocDmapLev+0x24c/0x490 fs/jfs/jfs_dmap.c:2054
dbAllocCtl+0x113/0x920 fs/jfs/jfs_dmap.c:1891
dbAllocAG+0x28b/0x10b0 fs/jfs/jfs_dmap.c:1432
dbAlloc+0x654/0xc90 fs/jfs/jfs_dmap.c:888
diNewIAG fs/jfs/jfs_imap.c:2510 [inline]
diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
diAllocAG+0xa95/0x1e50 fs/jfs/jfs_imap.c:1669
diAlloc+0x1cf/0x1750 fs/jfs/jfs_imap.c:1590
ialloc+0x8b/0x970 fs/jfs/jfs_inode.c:56
jfs_mkdir+0x1c1/0xbb0 fs/jfs/namei.c:225
vfs_mkdir+0x3b6/0x590 fs/namei.c:4065
do_mkdirat+0x260/0x520 fs/namei.c:4090
__do_sys_mkdirat fs/namei.c:4105 [inline]
__se_sys_mkdirat fs/namei.c:4103 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f3b31fe0c89
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 1f 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff8a9f7298 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f3b31fe0c89
RDX: 0000000000000000 RSI: 00000000200005c0 RDI: 00000000ffffff9c
RBP: 00007f3b320674c8 R08: 00007fff8a9f6dc0 R09: 00007fff8a9f6dc0
R10: 00007fff8a9f6dc0 R11: 0000000000000246 R12: 00007fff8a9f7310
R13: 00007fff8a9f72d0 R14: 0000000000000003 R15: 0000000000000000
</TASK>
================================================================================


---
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,
Oct 7, 2024, 1:48:24 PM10/7/24
Hello,

syzbot found the following issue on:

HEAD commit: aa4cd140bba5 Linux 6.1.112
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1253a7d0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=33931c04473f8585
dashboard link: https://syzkaller.appspot.com/bug?extid=7c2910d2b31421b7a9f2
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2a9778339706/disk-aa4cd140.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b568a6da8a9b/vmlinux-aa4cd140.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3c56af7eb2c4/bzImage-aa4cd140.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:2630:27
index 4294967295 is out of range for type 's8[1365]' (aka 'signed char[1365]')
CPU: 0 PID: 4252 Comm: syz.1.148 Not tainted 6.1.112-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_out_of_bounds+0x118/0x140 lib/ubsan.c:282
dbSplit+0x1fd/0x220 fs/jfs/jfs_dmap.c:2630
dbAllocBits+0x4e5/0x9a0 fs/jfs/jfs_dmap.c:2193
dbAllocDmap fs/jfs/jfs_dmap.c:2034 [inline]
dbAllocDmapLev+0x24c/0x490 fs/jfs/jfs_dmap.c:1988
dbAllocCtl+0x113/0x920 fs/jfs/jfs_dmap.c:1825
dbAllocAG+0x28b/0x10b0 fs/jfs/jfs_dmap.c:1364
dbAlloc+0x654/0xc90 fs/jfs/jfs_dmap.c:888
diNewIAG fs/jfs/jfs_imap.c:2510 [inline]
diAllocExt fs/jfs/jfs_imap.c:1905 [inline]
diAllocAG+0xa95/0x1e50 fs/jfs/jfs_imap.c:1669
diAlloc+0x1cf/0x1750 fs/jfs/jfs_imap.c:1590
ialloc+0x8b/0x970 fs/jfs/jfs_inode.c:56
jfs_mkdir+0x1c1/0xbb0 fs/jfs/namei.c:225
vfs_mkdir+0x3b6/0x590 fs/namei.c:4108
do_mkdirat+0x225/0x360 fs/namei.c:4133
__do_sys_mkdirat fs/namei.c:4148 [inline]
__se_sys_mkdirat fs/namei.c:4146 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4146
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7ff27477dff9
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:00007ff275539038 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007ff274936058 RCX: 00007ff27477dff9
RDX: 0000000000000000 RSI: 00000000200005c0 RDI: ffffffffffffff9c
RBP: 00007ff2747f0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007ff274936058 R15: 00007fff3206da18

syzbot

unread,
Nov 19, 2024, 2:32:03 AM11/19/24
syzbot suspects this issue was fixed by commit:

commit 25d2a3ff02f22e215ce53355619df10cc5faa7ab
Author: Edward Adam Davis <[email protected]>
Date: Sat Aug 24 01:25:23 2024 +0000

jfs: check if leafidx greater than num leaves per dmap tree

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=17a7eac0580000
start commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: jfs: check if leafidx greater than num leaves per dmap tree

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Jan 15, 2025, 11:16:13 PMJan 15
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