[v6.1] KASAN: vmalloc-out-of-bounds Read in xfs_buf_lock

0 views
Skip to first unread message

syzbot

unread,
12:42 AM (14 hours ago) 12:42 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cd9b81672742 Linux 6.1.161
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14babbfa580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0605c5af04d7603
dashboard link: https://syzkaller.appspot.com/bug?extid=80c9974e520006157dec
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7c7d6fd2ef9f/disk-cd9b8167.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/544b7fd5d4e0/vmlinux-cd9b8167.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3454f19d3753/bzImage-cd9b8167.xz

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

syz.3.647 (6511): drop_caches: 2
syz.3.647 (6511): drop_caches: 2
syz.3.647 (6511): drop_caches: 2
syz.3.647 (6511): drop_caches: 2
syz.3.647 (6511): drop_caches: 2
==================================================================
BUG: KASAN: vmalloc-out-of-bounds in xfs_buf_lock+0x2a8/0x560 fs/xfs/xfs_buf.c:1118
Read of size 4 at addr ffffc900037f795c by task syz.3.647/6511

CPU: 1 PID: 6511 Comm: syz.3.647 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
xfs_buf_lock+0x2a8/0x560 fs/xfs/xfs_buf.c:1118
xfs_buf_delwri_submit_buffers+0x161/0xa30 fs/xfs/xfs_buf.c:2201
xfs_buf_delwri_submit+0xc1/0x250 fs/xfs/xfs_buf.c:2279
xfs_qm_shrink_scan+0x1a3/0x390 fs/xfs/xfs_qm.c:522
do_shrink_slab+0x504/0xdb0 mm/vmscan.c:853
shrink_slab+0x1dd/0x770 mm/vmscan.c:1013
drop_slab_node mm/vmscan.c:1048 [inline]
drop_slab+0x164/0x290 mm/vmscan.c:1058
drop_caches_sysctl_handler+0xbe/0x160 fs/drop_caches.c:66
proc_sys_call_handler+0x45e/0x6d0 fs/proc/proc_sysctl.c:602
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x642/0xb10 fs/read_write.c:861
iter_file_splice_write+0x699/0xcc0 fs/splice.c:685
do_splice_from fs/splice.c:763 [inline]
direct_splice_actor+0xe1/0x130 fs/splice.c:950
splice_direct_to_actor+0x48b/0xb90 fs/splice.c:896
do_splice_direct+0x1ce/0x2f0 fs/splice.c:1002
do_sendfile+0x5f3/0xea0 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1323 [inline]
__se_sys_sendfile64+0x141/0x1a0 fs/read_write.c:1309
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f2bdb39aeb9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2bdc220028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f2bdb615fa0 RCX: 00007f2bdb39aeb9
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004
RBP: 00007f2bdb408c1f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020fffe82 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2bdb616038 R14: 00007f2bdb615fa0 R15: 00007ffc7c041628
</TASK>

The buggy address belongs to a 8-page vmalloc region starting at 0xffffc900037f0000 allocated at copy_process+0x5fa/0x4030 kernel/fork.c:2186
The buggy address belongs to the physical page:
page:ffffea0000bca2c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2f28b
memcg:ffff888078823482
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888078823482
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 6498, tgid 6498 (syz.4.644), ts 212166810432, free_ts 212076004432
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+0x1a1e/0x1ab0 mm/page_alloc.c:4328
__alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5614
vm_area_alloc_pages mm/vmalloc.c:3002 [inline]
__vmalloc_area_node mm/vmalloc.c:3071 [inline]
__vmalloc_node_range+0x944/0x13b0 mm/vmalloc.c:3243
alloc_thread_stack_node kernel/fork.c:312 [inline]
dup_task_struct+0x3d3/0x6b0 kernel/fork.c:994
copy_process+0x5fa/0x4030 kernel/fork.c:2186
kernel_clone+0x24b/0x900 kernel/fork.c:2762
__do_sys_clone3 kernel/fork.c:3061 [inline]
__se_sys_clone3+0x32d/0x3f0 kernel/fork.c:3045
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
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_list+0xbb/0x8e0 mm/page_alloc.c:3525
release_pages+0x1fa6/0x2220 mm/swap.c:1035
tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
tlb_flush_mmu+0x105/0x220 mm/mmu_gather.c:261
tlb_finish_mmu+0xbd/0x1c0 mm/mmu_gather.c:361
exit_mmap+0x384/0x960 mm/mmap.c:3262
__mmput+0x118/0x3c0 kernel/fork.c:1205
exit_mm+0x1fe/0x2d0 kernel/exit.c:565
do_exit+0x905/0x2480 kernel/exit.c:867
do_group_exit+0x217/0x2d0 kernel/exit.c:1022
__do_sys_exit_group kernel/exit.c:1033 [inline]
__se_sys_exit_group kernel/exit.c:1031 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1031
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
ffffc900037f7800: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f8 f8 f8 f8
ffffc900037f7880: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc900037f7900: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f3 f3 f3 f3
^
ffffc900037f7980: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
ffffc900037f7a00: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 f3 f3
==================================================================


---
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
Reply all
Reply to author
Forward
0 new messages