[v6.1] UBSAN: array-index-out-of-bounds in diNewExt

0 views
Skip to first unread message

syzbot

unread,
Jan 23, 2024, 4:16:24 AMJan 23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8fd7f4462453 Linux 6.1.74
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=100732bfe80000
kernel config: https://syzkaller.appspot.com/x/.config?x=fceadb7fe787588e
dashboard link: https://syzkaller.appspot.com/bug?extid=f6d9772f9ef0ecdbdf6a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7d530794d5f0/disk-8fd7f446.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/726c2ca0a8d1/vmlinux-8fd7f446.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7e93a6f1ef14/Image-8fd7f446.gz.xz

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

================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_imap.c:2360:2
index 134217728 is out of range for type 'struct iagctl[128]'
CPU: 0 PID: 26472 Comm: syz-executor.2 Not tainted 6.1.74-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_out_of_bounds+0xfc/0x148 lib/ubsan.c:282
diNewExt+0x280c/0x2b44 fs/jfs/jfs_imap.c:2360
diAllocExt fs/jfs/jfs_imap.c:1949 [inline]
diAllocAG+0xa68/0x1b8c fs/jfs/jfs_imap.c:1666
diAlloc+0x17c/0x15c4 fs/jfs/jfs_imap.c:1587
ialloc+0x84/0x7c0 fs/jfs/jfs_inode.c:56
jfs_mkdir+0x190/0xa0c fs/jfs/namei.c:225
vfs_mkdir+0x334/0x4e4 fs/namei.c:4114
do_mkdirat+0x220/0x510 fs/namei.c:4139
__do_sys_mkdirat fs/namei.c:4154 [inline]
__se_sys_mkdirat fs/namei.c:4152 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4152
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 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
================================================================================
================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_imap.c:2361:2
index 134217728 is out of range for type 'struct iagctl[128]'
CPU: 0 PID: 26472 Comm: syz-executor.2 Not tainted 6.1.74-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_out_of_bounds+0xfc/0x148 lib/ubsan.c:282
diNewExt+0x2840/0x2b44 fs/jfs/jfs_imap.c:2361
diAllocExt fs/jfs/jfs_imap.c:1949 [inline]
diAllocAG+0xa68/0x1b8c fs/jfs/jfs_imap.c:1666
diAlloc+0x17c/0x15c4 fs/jfs/jfs_imap.c:1587
ialloc+0x84/0x7c0 fs/jfs/jfs_inode.c:56
jfs_mkdir+0x190/0xa0c fs/jfs/namei.c:225
vfs_mkdir+0x334/0x4e4 fs/namei.c:4114
do_mkdirat+0x220/0x510 fs/namei.c:4139
__do_sys_mkdirat fs/namei.c:4154 [inline]
__se_sys_mkdirat fs/namei.c:4152 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4152
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 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,
Jan 23, 2024, 5:07:24 AMJan 23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 8fd7f4462453 Linux 6.1.74
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14be066fe80000
kernel config: https://syzkaller.appspot.com/x/.config?x=fceadb7fe787588e
dashboard link: https://syzkaller.appspot.com/bug?extid=f6d9772f9ef0ecdbdf6a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11519c6fe80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1489dc9be80000
mounted in repro: https://storage.googleapis.com/syzbot-assets/ef0f3589493c/mount_0.gz

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

loop0: detected capacity change from 0 to 32768
================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_imap.c:2360:2
index 134217728 is out of range for type 'struct iagctl[128]'
CPU: 1 PID: 4221 Comm: syz-executor958 Not tainted 6.1.74-syzkaller #0
BUG: KASAN: use-after-free in diNewExt+0x2af0/0x2b44 fs/jfs/jfs_imap.c:2360
Read of size 4 at addr ffff000157e7802c by task syz-executor958/4221

CPU: 1 PID: 4221 Comm: syz-executor958 Not tainted 6.1.74-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x174/0x4c0 mm/kasan/report.c:395
kasan_report+0xd4/0x130 mm/kasan/report.c:495
__asan_report_load4_noabort+0x2c/0x38 mm/kasan/report_generic.c:350
diNewExt+0x2af0/0x2b44 fs/jfs/jfs_imap.c:2360
diAllocExt fs/jfs/jfs_imap.c:1949 [inline]
diAllocAG+0xa68/0x1b8c fs/jfs/jfs_imap.c:1666
diAlloc+0x17c/0x15c4 fs/jfs/jfs_imap.c:1587
ialloc+0x84/0x7c0 fs/jfs/jfs_inode.c:56
jfs_mkdir+0x190/0xa0c fs/jfs/namei.c:225
vfs_mkdir+0x334/0x4e4 fs/namei.c:4114
do_mkdirat+0x220/0x510 fs/namei.c:4139
__do_sys_mkdirat fs/namei.c:4154 [inline]
__se_sys_mkdirat fs/namei.c:4152 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4152
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 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:000000009e7d2aa3 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x197e78
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc00055f9e08 fffffc00055f9e08 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff000157e77f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff000157e77f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff000157e78000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff000157e78080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff000157e78100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_imap.c:2361:2
index 134217728 is out of range for type 'struct iagctl[128]'
CPU: 1 PID: 4221 Comm: syz-executor958 Tainted: G B 6.1.74-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,
Mar 2, 2024, 1:29:03 PMMar 2
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit efdd665ce1a1634b8c1dad5e7f6baaef3e131d0a
Author: Srinivasan Shanmugam <srinivasan...@amd.com>
Date: Wed Feb 7 04:50:57 2024 +0000

drm/amd/display: Implement bounds check for stream encoder creation in DCN301

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=111f6374180000
start commit: 8fd7f4462453 Linux 6.1.74
git tree: linux-6.1.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: drm/amd/display: Implement bounds check for stream encoder creation in DCN301

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages