syzbot


KASAN: stack-out-of-bounds Read in xfs_buf_lock (2)

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

Sample crash report:
BTRFS info (device loop2): enabling ssd optimizations
==================================================================
BUG: KASAN: stack-out-of-bounds in __lock_acquire+0x77/0x1f80 kernel/locking/lockdep.c:4918
Read of size 8 at addr ffffc900038bf8f8 by task syz-executor.2/21051

CPU: 1 PID: 21051 Comm: syz-executor.2 Not tainted 6.1.61-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/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:4918
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5661
 __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:0x7fec8c27cae9
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:00007fec8cf8d0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007fec8c39bf80 RCX: 00007fec8c27cae9
RDX: 0000000020002080 RSI: 0000000000000006 RDI: 0000000000000007
RBP: 00007fec8c2c847a R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000023b R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fec8c39bf80 R15: 00007fff6071ab18
 </TASK>

The buggy address belongs to the virtual mapping at
 [ffffc900038b8000, ffffc900038c1000) created by:
 copy_process+0x637/0x4060 kernel/fork.c:2098

The buggy address belongs to the physical page:
page:ffffea0001f7af80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7debe
memcg:ffff88807e152082
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88807e152082
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 2, tgid 2 (kthreadd), ts 879108248300, free_ts 872647159538
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
 prep_new_page mm/page_alloc.c:2520 [inline]
 get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
 vm_area_alloc_pages mm/vmalloc.c:2983 [inline]
 __vmalloc_area_node mm/vmalloc.c:3051 [inline]
 __vmalloc_node_range+0x96c/0x1460 mm/vmalloc.c:3223
 alloc_thread_stack_node kernel/fork.c:311 [inline]
 dup_task_struct+0x3e5/0x6d0 kernel/fork.c:988
 copy_process+0x637/0x4060 kernel/fork.c:2098
 kernel_clone+0x222/0x920 kernel/fork.c:2682
 kernel_thread+0x152/0x1d0 kernel/fork.c:2742
 create_kthread kernel/kthread.c:399 [inline]
 kthreadd+0x596/0x760 kernel/kthread.c:746
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1440 [inline]
 free_pcp_prepare mm/page_alloc.c:1490 [inline]
 free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358
 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453
 kasan_depopulate_vmalloc_pte+0x66/0x80 mm/kasan/shadow.c:375
 apply_to_pte_range mm/memory.c:2645 [inline]
 apply_to_pmd_range mm/memory.c:2689 [inline]
 apply_to_pud_range mm/memory.c:2725 [inline]
 apply_to_p4d_range mm/memory.c:2761 [inline]
 __apply_to_page_range+0x9c5/0xcc0 mm/memory.c:2795
 kasan_release_vmalloc+0x96/0xb0 mm/kasan/shadow.c:492
 __purge_vmap_area_lazy+0x157c/0x1720 mm/vmalloc.c:1774
 drain_vmap_area_work+0x3c/0xd0 mm/vmalloc.c:1803
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

Memory state around the buggy address:
 ffffc900038bf780: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
 ffffc900038bf800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc900038bf880: 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3
                                                                ^
 ffffc900038bf900: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc900038bf980: 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/11/03 11:28 linux-6.1.y 4a61839152cc c4ac074c .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.