[moderation] [reiserfs?] KASAN: vmalloc-out-of-bounds Read in reiserfs_choose_packing

2 views
Skip to first unread message

syzbot

unread,
Jan 9, 2024, 1:21:23 PMJan 9
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 610a9b8f49fb Linux 6.7-rc8
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=103e7265e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=655f8abe9fe69b3b
dashboard link: https://syzkaller.appspot.com/bug?extid=19125bc85d41b99d83a6
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [linux-...@vger.kernel.org linux-...@vger.kernel.org reiserf...@vger.kernel.org]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2748f7387702/disk-610a9b8f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d780ebed39cf/vmlinux-610a9b8f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/be33cfa06be2/bzImage-610a9b8f.xz

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

netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'.
==================================================================
BUG: KASAN: vmalloc-out-of-bounds in block_group_used fs/reiserfs/bitmap.c:311 [inline]
BUG: KASAN: vmalloc-out-of-bounds in reiserfs_choose_packing+0x5b9/0x620 fs/reiserfs/bitmap.c:334
Read of size 4 at addr ffffc9000a953004 by task syz-executor.4/7179

CPU: 1 PID: 7179 Comm: syz-executor.4 Not tainted 6.7.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0x163/0x540 mm/kasan/report.c:475
kasan_report+0x142/0x170 mm/kasan/report.c:588
block_group_used fs/reiserfs/bitmap.c:311 [inline]
reiserfs_choose_packing+0x5b9/0x620 fs/reiserfs/bitmap.c:334
reiserfs_new_inode+0x27d/0x1cb0 fs/reiserfs/inode.c:1937
reiserfs_mkdir+0x5b0/0x8f0 fs/reiserfs/namei.c:843
xattr_mkdir fs/reiserfs/xattr.c:77 [inline]
open_xa_root fs/reiserfs/xattr.c:137 [inline]
open_xa_dir+0x2cd/0x610 fs/reiserfs/xattr.c:153
xattr_lookup+0x24/0x280 fs/reiserfs/xattr.c:396
reiserfs_xattr_set_handle+0xfc/0xe20 fs/reiserfs/xattr.c:535
reiserfs_xattr_set+0x452/0x570 fs/reiserfs/xattr.c:635
__vfs_setxattr+0x460/0x4a0 fs/xattr.c:201
__vfs_setxattr_noperm+0x12e/0x5e0 fs/xattr.c:235
vfs_setxattr+0x221/0x420 fs/xattr.c:322
do_setxattr fs/xattr.c:630 [inline]
setxattr+0x25d/0x2f0 fs/xattr.c:653
path_setxattr+0x1c0/0x2a0 fs/xattr.c:672
__do_sys_lsetxattr fs/xattr.c:695 [inline]
__se_sys_lsetxattr fs/xattr.c:691 [inline]
__x64_sys_lsetxattr+0xb8/0xd0 fs/xattr.c:691
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fac9307cce9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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:00007fac93cf40c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fac9319c050 RCX: 00007fac9307cce9
RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000020000080
RBP: 00007fac930c947a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007fac9319c050 R15: 00007ffd91970de8
</TASK>

The buggy address belongs to the virtual mapping at
[ffffc9000a953000, ffffc9000a955000) created by:
reiserfs_init_bitmap_cache+0xd4/0x180 fs/reiserfs/bitmap.c:1459

The buggy address belongs to the physical page:
page:ffffea000072e480 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1cb92
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102cc2(GFP_HIGHUSER|__GFP_NOWARN), pid 7168, tgid 7167 (syz-executor.4), ts 2433922323986, free_ts 2433056957400
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537
prep_new_page mm/page_alloc.c:1544 [inline]
get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3312
__alloc_pages+0x255/0x680 mm/page_alloc.c:4568
__alloc_pages_bulk+0x729/0xd40 mm/page_alloc.c:4516
alloc_pages_bulk_array_mempolicy+0x685/0x840 mm/mempolicy.c:2296
vm_area_alloc_pages mm/vmalloc.c:3028 [inline]
__vmalloc_area_node mm/vmalloc.c:3139 [inline]
__vmalloc_node_range+0x798/0x14a0 mm/vmalloc.c:3320
__vmalloc_node mm/vmalloc.c:3385 [inline]
vmalloc+0x79/0x90 mm/vmalloc.c:3418
reiserfs_init_bitmap_cache+0xd4/0x180 fs/reiserfs/bitmap.c:1459
reiserfs_fill_super+0xd6e/0x2620 fs/reiserfs/super.c:1994
mount_bdev+0x237/0x300 fs/super.c:1650
legacy_get_tree+0xef/0x190 fs/fs_context.c:662
vfs_get_tree+0x8c/0x2a0 fs/super.c:1771
do_new_mount+0x28f/0xae0 fs/namespace.c:3337
do_mount fs/namespace.c:3677 [inline]
__do_sys_mount fs/namespace.c:3886 [inline]
__se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3863
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1137 [inline]
free_unref_page_prepare+0x931/0xa60 mm/page_alloc.c:2347
free_unref_page_list+0x5a0/0x840 mm/page_alloc.c:2533
release_pages+0x2117/0x2400 mm/swap.c:1042
tlb_batch_pages_flush mm/mmu_gather.c:98 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:293 [inline]
tlb_flush_mmu+0x34c/0x4e0 mm/mmu_gather.c:300
tlb_finish_mmu+0xd4/0x1f0 mm/mmu_gather.c:392
exit_mmap+0x4d3/0xc60 mm/mmap.c:3321
__mmput+0x115/0x3c0 kernel/fork.c:1349
exit_mm+0x21f/0x300 kernel/exit.c:567
do_exit+0x9af/0x2740 kernel/exit.c:856
do_group_exit+0x206/0x2c0 kernel/exit.c:1018
get_signal+0x1769/0x1840 kernel/signal.c:2904
arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:309
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x150 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x69/0x2a0 kernel/entry/common.c:296
do_syscall_64+0x52/0x110 arch/x86/entry/common.c:89

Memory state around the buggy address:
ffffc9000a952f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
ffffc9000a952f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc9000a953000: 04 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
^
ffffc9000a953080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
ffffc9000a953100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================


---
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,
Mar 31, 2024, 8:17:15 PMMar 31
to syzkaller-upst...@googlegroups.com
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