XFS (loop0): log I/O error -5 XFS (loop0): Filesystem has been shut down due to log error (0x2). XFS (loop0): Please unmount the filesystem and rectify the problem(s). ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x8d/0xb70 kernel/locking/lockdep.c:4922 Read of size 8 at addr ffff88806d6a7860 by task kworker/0:1H/349 CPU: 0 PID: 349 Comm: kworker/0:1H Not tainted 6.1.61-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Workqueue: xfs-log/loop0 xlog_ioend_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xf4/0x251 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+0x8d/0xb70 kernel/locking/lockdep.c:4922 lock_acquire+0x1a2/0x390 kernel/locking/lockdep.c:5661 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] xfs_trans_committed_bulk+0xcf/0x670 fs/xfs/xfs_trans.c:773 xlog_cil_committed+0x24a/0xb90 fs/xfs/xfs_log_cil.c:795 xlog_cil_process_committed+0x144/0x180 fs/xfs/xfs_log_cil.c:823 xlog_state_shutdown_callbacks+0x29f/0x390 fs/xfs/xfs_log.c:538 xlog_force_shutdown+0x282/0x2d0 fs/xfs/xfs_log.c:3821 xlog_ioend_work+0x92/0xe0 fs/xfs/xfs_log.c:1402 process_one_work+0x745/0xe90 kernel/workqueue.c:2292 worker_thread+0x806/0xe60 kernel/workqueue.c:2439 kthread+0x1e8/0x240 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3793: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0xa6/0x1c0 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] kmem_alloc+0xbf/0x300 fs/xfs/kmem.c:20 kmem_zalloc fs/xfs/kmem.h:69 [inline] xfs_trans_ail_init+0x1c/0x230 fs/xfs/xfs_trans_ail.c:902 xfs_log_mount+0x229/0x550 fs/xfs/xfs_log.c:721 xfs_mountfs+0x990/0x16b0 fs/xfs/xfs_mount.c:805 xfs_fs_fill_super+0xb3e/0xe70 fs/xfs/xfs_super.c:1669 get_tree_bdev+0x3c7/0x5f0 fs/super.c:1355 vfs_get_tree+0x7a/0x170 fs/super.c:1562 do_new_mount+0x1e1/0x8f0 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x23e/0x2d0 fs/namespace.c:3568 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 Freed by task 2269: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x122/0x1e0 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x2b4/0x470 mm/slub.c:3674 xfs_log_unmount+0x49/0xc0 fs/xfs/xfs_log.c:1116 xfs_unmountfs+0x10b/0x1c0 fs/xfs/xfs_mount.c:1081 xfs_fs_put_super+0x67/0x2a0 fs/xfs/xfs_super.c:1118 generic_shutdown_super+0x107/0x2c0 fs/super.c:501 kill_block_super+0x75/0xb0 fs/super.c:1459 deactivate_locked_super+0x71/0xd0 fs/super.c:332 cleanup_mnt+0x2bd/0x330 fs/namespace.c:1186 task_work_run+0x206/0x280 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xa9/0xc0 kernel/entry/common.c:171 exit_to_user_mode_prepare+0x6c/0xc0 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x27/0x1c0 kernel/entry/common.c:297 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88806d6a7800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 96 bytes inside of 256-byte region [ffff88806d6a7800, ffff88806d6a7900) The buggy address belongs to the physical page: page:ffffea0001b5a980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6d6a6 head:ffffea0001b5a980 order:1 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88800ac41b40 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2, tgid 2 (kthreadd), ts 78131747398, free_ts 78006763794 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x286/0x2b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x2fdd/0x3170 mm/page_alloc.c:4279 __alloc_pages+0x251/0x640 mm/page_alloc.c:5545 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x70/0x250 mm/slub.c:1992 ___slab_alloc+0x9df/0xe70 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x195/0x250 mm/slub.c:3437 kmalloc_trace+0x26/0xc0 mm/slab_common.c:1045 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] set_kthread_struct+0x76/0x170 kernel/kthread.c:117 copy_process+0xfba/0x36a0 kernel/fork.c:2194 kernel_clone+0x190/0x680 kernel/fork.c:2682 kernel_thread+0x14d/0x1d0 kernel/fork.c:2742 create_kthread kernel/kthread.c:399 [inline] kthreadd+0x460/0x5d0 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+0xd4b/0xee0 mm/page_alloc.c:3358 free_unref_page+0x33/0x390 mm/page_alloc.c:3453 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x54/0x3e0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x10c/0x290 mm/slub.c:3422 getname_flags+0x9c/0x430 fs/namei.c:139 user_path_at_empty+0x1b/0x50 fs/namei.c:2876 user_path_at include/linux/namei.h:57 [inline] inotify_find_inode fs/notify/inotify/inotify_user.c:378 [inline] __do_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:777 [inline] __se_sys_inotify_add_watch+0x13f/0xcc0 fs/notify/inotify/inotify_user.c:730 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: ffff88806d6a7700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806d6a7780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88806d6a7800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806d6a7880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806d6a7900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================