================================================================== BUG: KASAN: stack-out-of-bounds in __lock_acquire+0x11c/0x7f70 kernel/locking/lockdep.c:5012 Read of size 8 at addr ffffc9000b6c78f8 by task syz-executor.4/29562 CPU: 1 PID: 29562 Comm: syz-executor.4 Not tainted 6.5.0-rc5-syzkaller-00362-ga785fd28d31f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __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+0x175/0x1b0 mm/kasan/report.c:588 __lock_acquire+0x11c/0x7f70 kernel/locking/lockdep.c:5012 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 down+0x39/0xc0 kernel/locking/semaphore.c:59 xfs_buf_lock+0x154/0x4b0 fs/xfs/xfs_buf.c:1119 xfs_buf_delwri_submit_buffers+0x14d/0x8e0 fs/xfs/xfs_buf.c:2164 xfs_buf_delwri_submit+0xba/0x260 fs/xfs/xfs_buf.c:2242 xfs_qm_shrink_scan+0x1ce/0x3e0 fs/xfs/xfs_qm.c:522 do_shrink_slab+0x544/0xdb0 mm/vmscan.c:900 shrink_slab+0x232/0x920 mm/vmscan.c:1060 drop_slab_node mm/vmscan.c:1088 [inline] drop_slab+0x148/0x280 mm/vmscan.c:1106 drop_caches_sysctl_handler+0xb7/0x160 fs/drop_caches.c:66 proc_sys_call_handler+0x546/0x8a0 fs/proc/proc_sysctl.c:598 do_iter_write+0x84f/0xde0 fs/read_write.c:860 iter_file_splice_write+0x86d/0x1010 fs/splice.c:739 do_splice_from fs/splice.c:936 [inline] direct_splice_actor+0xea/0x1c0 fs/splice.c:1145 splice_direct_to_actor+0x376/0x9e0 fs/splice.c:1091 do_splice_direct+0x2ac/0x3f0 fs/splice.c:1197 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1316 [inline] __se_sys_sendfile64+0x100/0x1e0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f523587cae9 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:00007f52365da0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f523599bf80 RCX: 00007f523587cae9 RDX: 0000000020002080 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00007f52358c847a R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000023b R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f523599bf80 R15: 00007fff82017358 The buggy address belongs to the virtual mapping at [ffffc9000b6c0000, ffffc9000b6c9000) created by: copy_process+0x5c8/0x4290 kernel/fork.c:2330 The buggy address belongs to the physical page: page:ffffea00007cd500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f354 memcg:ffff888079212882 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888079212882 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 29513, tgid 29513 (syz-executor.5), ts 1197528172163, free_ts 1196975677361 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x31e8/0x3370 mm/page_alloc.c:3221 __alloc_pages+0x255/0x670 mm/page_alloc.c:4477 vm_area_alloc_pages mm/vmalloc.c:3059 [inline] __vmalloc_area_node mm/vmalloc.c:3135 [inline] __vmalloc_node_range+0x9a3/0x1490 mm/vmalloc.c:3316 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct+0x3e5/0x7d0 kernel/fork.c:1113 copy_process+0x5c8/0x4290 kernel/fork.c:2330 kernel_clone+0x222/0x800 kernel/fork.c:2912 __do_sys_clone3 kernel/fork.c:3213 [inline] __se_sys_clone3+0x2cb/0x340 kernel/fork.c:3197 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 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:1161 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2348 free_unref_page_list+0x596/0x830 mm/page_alloc.c:2489 release_pages+0x2193/0x2470 mm/swap.c:1042 __folio_batch_release+0x84/0x100 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] mapping_try_invalidate+0x515/0x640 mm/truncate.c:536 xfs_free_buftarg+0x7d/0xd0 fs/xfs/xfs_buf.c:1947 xfs_fs_put_super+0x252/0x2d0 fs/xfs/xfs_super.c:1150 generic_shutdown_super+0x134/0x340 fs/super.c:499 kill_block_super+0x68/0xa0 fs/super.c:1417 deactivate_locked_super+0xa4/0x110 fs/super.c:330 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1254 task_work_run+0x24a/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:297 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffffc9000b6c7780: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 ffffc9000b6c7800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000b6c7880: 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 ^ ffffc9000b6c7900: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000b6c7980: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 f3 f3 ==================================================================