syzbot


KASAN: stack-out-of-bounds Read in xfs_buf_lock

Status: auto-obsoleted due to no activity on 2023/10/06 04:59
Reported-by: syzbot+fa135d8e76fe7aa21f30@syzkaller.appspotmail.com
First crash: 311d, last: 311d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: stack-out-of-bounds Read in xfs_buf_lock (2) 1 183d 183d 0/3 auto-obsoleted due to no activity on 2024/02/11 11:29
upstream KASAN: stack-out-of-bounds Read in xfs_buf_lock xfs C error 606 19h06m 509d 0/26 upstream: reported C repro on 2022/12/12 05:50

Sample crash report:
==================================================================
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
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/28 04:58 linux-6.1.y e84a4e368abe 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: stack-out-of-bounds Read in xfs_buf_lock
* Struck through repros no longer work on HEAD.