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

0 views
Skip to first unread message

syzbot

unread,
Jun 28, 2023, 1:00:04 AM6/28/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e84a4e368abe Linux 6.1.35
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14e19cd7280000
kernel config: https://syzkaller.appspot.com/x/.config?x=a69b5c9de715622a
dashboard link: https://syzkaller.appspot.com/bug?extid=fa135d8e76fe7aa21f30
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3c7fedd1a86d/disk-e84a4e36.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8b34c6296ed7/vmlinux-e84a4e36.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a88164798cc2/bzImage-e84a4e36.xz

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

==================================================================
BUG: KASAN: stack-out-of-bounds in __lock_acquire+0x77/0x1f80 kernel/locking/lockdep.c:4926
Read of size 8 at addr ffffc90014d1f8f8 by task syz-executor.1/23012

CPU: 1 PID: 23012 Comm: syz-executor.1 Not tainted 6.1.35-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report+0x136/0x160 mm/kasan/report.c:495
__lock_acquire+0x77/0x1f80 kernel/locking/lockdep.c:4926
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
down+0x35/0xb0 kernel/locking/semaphore.c:59
xfs_buf_lock+0x171/0x5b0 fs/xfs/xfs_buf.c:1120
xfs_buf_delwri_submit_buffers+0x154/0x9a0 fs/xfs/xfs_buf.c:2164
xfs_buf_delwri_submit+0xb6/0x260 fs/xfs/xfs_buf.c:2242
xfs_qm_shrink_scan+0x1ca/0x3d0 fs/xfs/xfs_qm.c:514
do_shrink_slab+0x597/0xed0 mm/vmscan.c:846
shrink_slab+0x237/0x8b0 mm/vmscan.c:1006
drop_slab_node mm/vmscan.c:1041 [inline]
drop_slab+0x163/0x290 mm/vmscan.c:1051
drop_caches_sysctl_handler+0xb3/0x160 fs/drop_caches.c:66
proc_sys_call_handler+0x541/0x8a0 fs/proc/proc_sysctl.c:604
do_iter_write+0x6e6/0xc50 fs/read_write.c:861
iter_file_splice_write+0x806/0xfa0 fs/splice.c:686
do_splice_from fs/splice.c:764 [inline]
direct_splice_actor+0xe3/0x1c0 fs/splice.c:931
splice_direct_to_actor+0x4c0/0xbd0 fs/splice.c:886
do_splice_direct+0x27f/0x3c0 fs/splice.c:974
do_sendfile+0x61c/0xff0 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1317 [inline]
__se_sys_sendfile64+0xfc/0x1e0 fs/read_write.c:1309
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f4d65c8c389
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f4d66ad7168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f4d65dabf80 RCX: 00007f4d65c8c389
RDX: 0000000020002080 RSI: 0000000000000004 RDI: 0000000000000005
RBP: 00007f4d65cd7493 R08: 0000000000000000 R09: 0000000000000000
R10: 0100000000000875 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc22f302df R14: 00007f4d66ad7300 R15: 0000000000022000
</TASK>

The buggy address belongs to the virtual mapping at
[ffffc90014d18000, ffffc90014d21000) created by:
copy_process+0x637/0x4020 kernel/fork.c:2090

The buggy address belongs to the physical page:
page:ffffea0000968b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25a2d
memcg:ffff88807cba1102
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88807cba1102
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 23006, tgid 23006 (syz-executor.5), ts 1051898415569, free_ts 1051878194436
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
prep_new_page mm/page_alloc.c:2540 [inline]
get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
vm_area_alloc_pages mm/vmalloc.c:2979 [inline]
__vmalloc_area_node mm/vmalloc.c:3047 [inline]
__vmalloc_node_range+0x96c/0x1460 mm/vmalloc.c:3219
alloc_thread_stack_node kernel/fork.c:311 [inline]
dup_task_struct+0x3e5/0x6d0 kernel/fork.c:980
copy_process+0x637/0x4020 kernel/fork.c:2090
kernel_clone+0x222/0x920 kernel/fork.c:2679
__do_sys_clone kernel/fork.c:2820 [inline]
__se_sys_clone kernel/fork.c:2804 [inline]
__x64_sys_clone+0x231/0x280 kernel/fork.c:2804
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1460 [inline]
free_pcp_prepare mm/page_alloc.c:1510 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388
free_unref_page+0x98/0x570 mm/page_alloc.c:3484
pipe_buf_release include/linux/pipe_fs_i.h:183 [inline]
pipe_read+0x6e1/0x12a0 fs/pipe.c:324
call_read_iter include/linux/fs.h:2199 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x7de/0xbe0 fs/read_write.c:470
ksys_read+0x19c/0x2c0 fs/read_write.c:613
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
ffffc90014d1f780: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
ffffc90014d1f800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90014d1f880: 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3
^
ffffc90014d1f900: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90014d1f980: 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 bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Oct 6, 2023, 12:59:42 AM10/6/23
to syzkaller...@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