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

9 views
Skip to first unread message

syzbot

unread,
Dec 29, 2024, 1:57:19 AM12/29/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 91786f140358 Linux 5.15.175
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15182818580000
kernel config: https://syzkaller.appspot.com/x/.config?x=1fc30776feb70ea7
dashboard link: https://syzkaller.appspot.com/bug?extid=63c40a3ef45fce944739
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/210b1e4b59b1/disk-91786f14.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1cf8391059a0/vmlinux-91786f14.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1d9077a44b1c/bzImage-91786f14.xz

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

================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:1598:11
index 26 is out of range for type 'struct lv[20]'
CPU: 0 PID: 6194 Comm: syz.8.470 Not tainted 5.15.175-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
dtSplitPage+0x3e56/0x3ec0 fs/jfs/jfs_dtree.c:1598
dtSplitUp fs/jfs/jfs_dtree.c:1089 [inline]
dtInsert+0x14fc/0x6b00 fs/jfs/jfs_dtree.c:868
jfs_rename+0xafa/0x1cb0 fs/jfs/namei.c:1224
vfs_rename+0xd32/0x10f0 fs/namei.c:4832
do_renameat2+0xe0f/0x1700 fs/namei.c:4985
__do_sys_rename fs/namei.c:5031 [inline]
__se_sys_rename fs/namei.c:5029 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:5029
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:0x7fb4e7559d29
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:00007fb4e53ca038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007fb4e7749fa0 RCX: 00007fb4e7559d29
RDX: 0000000000000000 RSI: 0000000020000f40 RDI: 0000000020000300
RBP: 00007fb4e75d5b08 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fb4e7749fa0 R15: 00007ffe83c82b68
</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 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,
Dec 30, 2024, 2:45:21 AM12/30/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 563edd786f0a Linux 6.1.122
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10916818580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b70d05b26edc7515
dashboard link: https://syzkaller.appspot.com/bug?extid=a0acccd8e6068831fd3b
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/9f111015ce9f/disk-563edd78.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/821c260b7642/vmlinux-563edd78.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9fba8f114c58/bzImage-563edd78.xz

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

================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:1600:11
index 26 is out of range for type 'struct lv[20]'
CPU: 0 PID: 16114 Comm: syz.3.2312 Tainted: G W 6.1.122-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
dtSplitPage+0x3e56/0x3ec0 fs/jfs/jfs_dtree.c:1600
dtSplitUp fs/jfs/jfs_dtree.c:1091 [inline]
dtInsert+0x14b9/0x6c00 fs/jfs/jfs_dtree.c:870
jfs_rename+0xafa/0x1cb0 fs/jfs/namei.c:1224
vfs_rename+0xd32/0x10f0 fs/namei.c:4874
do_renameat2+0xde0/0x1440 fs/namei.c:5027
__do_sys_rename fs/namei.c:5073 [inline]
__se_sys_rename fs/namei.c:5071 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:5071
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:0x7f2f94f85d29
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:00007f2f94dff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f2f95175fa0 RCX: 00007f2f94f85d29
RDX: 0000000000000000 RSI: 0000000020000f40 RDI: 0000000020000300
RBP: 00007f2f95001b08 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f2f95175fa0 R15: 00007fffe42c8698

syzbot

unread,
Mar 16, 2025, 6:27:34 AM3/16/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 0c935c049b5c Linux 5.15.179
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17d683b0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=bcb6af887426ce59
dashboard link: https://syzkaller.appspot.com/bug?extid=63c40a3ef45fce944739
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14aebff8580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12aebff8580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/75b060834e1e/disk-0c935c04.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d42b06ae465d/vmlinux-0c935c04.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d5217676cd35/bzImage-0c935c04.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/8232a599f6b7/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=1737b698580000)

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

loop0: detected capacity change from 0 to 32768
================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:1598:11
index 27 is out of range for type 'struct lv[20]'
CPU: 1 PID: 4161 Comm: syz-executor197 Not tainted 5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
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
dtSplitPage+0x3e56/0x3ec0 fs/jfs/jfs_dtree.c:1598
dtSplitUp fs/jfs/jfs_dtree.c:1089 [inline]
dtInsert+0x14fc/0x6b00 fs/jfs/jfs_dtree.c:868
jfs_rename+0xafa/0x1cb0 fs/jfs/namei.c:1224
vfs_rename+0xd32/0x10f0 fs/namei.c:4832
do_renameat2+0xe0f/0x1700 fs/namei.c:4985
__do_sys_rename fs/namei.c:5031 [inline]
__se_sys_rename fs/namei.c:5029 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:5029
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:0x7fd845348f39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffce97f0098 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007ffce97f00a0 RCX: 00007fd845348f39
RDX: 0000000000000000 RSI: 0000400000000f40 RDI: 0000400000000300
RBP: 00007ffce97f00a8 R08: 00007fd845314ea0 R09: 00007fd845314ea0
R10: 00007fd845314ea0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffce97f0308 R14: 0000000000000001 R15: 0000000000000001
</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,
May 12, 2025, 6:04:28 AM5/12/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 02b72ccb5f9d Linux 6.1.138
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=173692f4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=40498c8aeab367b8
dashboard link: https://syzkaller.appspot.com/bug?extid=a0acccd8e6068831fd3b
compiler: Debian clang version 20.1.2 (++20250402124445+58df0ef89dd6-1~exp1~20250402004600.97), Debian LLD 20.1.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14ed4cd4580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12fb7768580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/741917d96f57/disk-02b72ccb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b5e0c69249ae/vmlinux-02b72ccb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/06bfb546fb37/bzImage-02b72ccb.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/2494aee1e1e2/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=10ed4cd4580000)

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

==================================================================
BUG: KASAN: use-after-free in dtMoveEntry fs/jfs/jfs_dtree.c:3922 [inline]
BUG: KASAN: use-after-free in dtSplitPage+0x1aba/0x31d0 fs/jfs/jfs_dtree.c:1561
Write of size 1 at addr ffff88807a274000 by task syz-executor170/4259

CPU: 1 PID: 4259 Comm: syz-executor170 Not tainted 6.1.138-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x220 mm/kasan/report.c:427
kasan_report+0x10b/0x140 mm/kasan/report.c:531
dtMoveEntry fs/jfs/jfs_dtree.c:3922 [inline]
dtSplitPage+0x1aba/0x31d0 fs/jfs/jfs_dtree.c:1561
dtSplitUp fs/jfs/jfs_dtree.c:1092 [inline]
dtInsert+0xfbd/0x58a0 fs/jfs/jfs_dtree.c:871
jfs_create+0x69d/0xa50 fs/jfs/namei.c:137
lookup_open fs/namei.c:3482 [inline]
open_last_lookups fs/namei.c:3550 [inline]
path_openat+0x1187/0x2e70 fs/namei.c:3780
do_filp_open+0x1c1/0x3c0 fs/namei.c:3810
do_sys_openat2+0x142/0x490 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_creat fs/open.c:1412 [inline]
__se_sys_creat fs/open.c:1406 [inline]
__x64_sys_creat+0x8c/0xb0 fs/open.c:1406
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f95a28a9929
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 1d 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:00007f95a203b218 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f95a2930638 RCX: 00007f95a28a9929
RDX: 00007f95a28a9929 RSI: 0000000000000000 RDI: 00002000000006c0
RBP: 00007f95a2930630 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f95a28fc45c
R13: 0000200000000080 R14: 00002000000008c0 R15: 00002000000006c0
</TASK>

The buggy address belongs to the physical page:
page:ffffea0001e89d00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a274
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00009dd088 ffffea0001e89d88 0000000000000000
raw: 0000000000000000 0000000000100000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3962, tgid 3962 (dhcpcd-run-hook), ts 57205764727, free_ts 86539493011
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
__alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5606
alloc_slab_page+0x5d/0x160 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1992
___slab_alloc+0xbc6/0x1220 mm/slub.c:3180
kmem_cache_alloc_bulk+0x1a3/0x4e0 mm/slub.c:3830
mt_alloc_bulk lib/maple_tree.c:157 [inline]
mas_alloc_nodes+0x449/0x890 lib/maple_tree.c:1299
mas_node_count_gfp lib/maple_tree.c:1359 [inline]
mas_preallocate+0x11e/0x340 lib/maple_tree.c:5805
__vma_adjust+0x2e2/0x1bd0 mm/mmap.c:723
vma_adjust include/linux/mm.h:2742 [inline]
__split_vma+0x3a7/0x500 mm/mmap.c:-1
do_mas_align_munmap+0x351/0x1220 mm/mmap.c:2468
do_mas_munmap+0x240/0x2b0 mm/mmap.c:2638
__mmap_region mm/mmap.c:2686 [inline]
mmap_region+0x713/0x1d30 mm/mmap.c:2904
do_mmap+0x894/0xf30 mm/mmap.c:1424
vm_mmap_pgoff+0x1b2/0x2b0 mm/util.c:520
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
__kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3437
kmalloc_node_trace+0x22/0xe0 mm/slab_common.c:1039
kmalloc_node include/linux/slab.h:585 [inline]
kzalloc_node include/linux/slab.h:710 [inline]
alloc_worker kernel/workqueue.c:1843 [inline]
create_worker+0x10f/0x630 kernel/workqueue.c:1940
maybe_create_worker kernel/workqueue.c:2110 [inline]
manage_workers kernel/workqueue.c:2162 [inline]
worker_thread+0x4de/0x1250 kernel/workqueue.c:2411
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
ffff88807a273f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88807a273f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88807a274000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88807a274080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88807a274100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Reply all
Reply to author
Forward
0 new messages