================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x114/0x7620 kernel/locking/lockdep.c:4881 Read of size 8 at addr ffff0000d97a4958 by task kworker/1:1H/149 CPU: 1 PID: 149 Comm: kworker/1:1H Not tainted 5.15.117-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Workqueue: xfs-log/loop5 xlog_ioend_work Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309 __lock_acquire+0x114/0x7620 kernel/locking/lockdep.c:4881 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0xb0/0x10c kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:363 [inline] xlog_force_shutdown+0x128/0x208 fs/xfs/xfs_log.c:3890 xfs_do_force_shutdown+0x118/0x5e8 fs/xfs/xfs_fsops.c:529 xlog_ioend_work+0xc0/0x114 fs/xfs/xfs_log.c:1364 process_one_work+0x790/0x11b8 kernel/workqueue.c:2307 worker_thread+0x910/0x1034 kernel/workqueue.c:2454 kthread+0x37c/0x45c kernel/kthread.c:319 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 8211: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x29c/0x4c8 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] kmem_alloc+0x214/0x53c fs/xfs/kmem.c:21 kmem_zalloc fs/xfs/kmem.h:69 [inline] xlog_cil_init+0x2c/0x3b0 fs/xfs/xfs_log_cil.c:1454 xlog_alloc_log+0xd8c/0xf64 fs/xfs/xfs_log.c:1625 xfs_log_mount+0xc8/0x6c8 fs/xfs/xfs_log.c:633 xfs_mountfs+0x93c/0x1778 fs/xfs/xfs_mount.c:764 xfs_fs_fill_super+0xd64/0xf60 fs/xfs/xfs_super.c:1658 get_tree_bdev+0x360/0x54c fs/super.c:1303 xfs_fs_get_tree+0x28/0x38 fs/xfs/xfs_super.c:1705 vfs_get_tree+0x90/0x274 fs/super.c:1508 do_new_mount+0x25c/0x8c4 fs/namespace.c:2994 path_mount+0x590/0x104c fs/namespace.c:3324 do_mount fs/namespace.c:3337 [inline] __do_sys_mount fs/namespace.c:3545 [inline] __se_sys_mount fs/namespace.c:3522 [inline] __arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 3999: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x178/0x410 mm/slub.c:4559 kvfree+0x40/0x50 mm/util.c:654 kmem_free fs/xfs/kmem.h:62 [inline] xlog_cil_destroy+0x10c/0x140 fs/xfs/xfs_log_cil.c:1500 xlog_dealloc_log+0x34/0x224 fs/xfs/xfs_log.c:2064 xfs_log_unmount+0xa4/0xbc fs/xfs/xfs_log.c:1082 xfs_unmountfs+0x128/0x1c8 fs/xfs/xfs_mount.c:1040 xfs_fs_put_super+0x70/0x250 fs/xfs/xfs_super.c:1090 generic_shutdown_super+0x130/0x29c fs/super.c:475 kill_block_super+0x70/0xdc fs/super.c:1405 deactivate_locked_super+0xb8/0x13c fs/super.c:335 deactivate_super+0x108/0x128 fs/super.c:366 cleanup_mnt+0x3c0/0x474 fs/namespace.c:1143 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150 task_work_run+0x130/0x1e4 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:597 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The buggy address belongs to the object at ffff0000d97a4800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 344 bytes inside of 1024-byte region [ffff0000d97a4800, ffff0000d97a4c00) The buggy address belongs to the page: page:00000000dfd42be7 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1197a0 head:00000000dfd42be7 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002780 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d97a4800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d97a4880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000d97a4900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d97a4980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d97a4a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Unable to handle kernel paging request at virtual address fe978046e00001c8 Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 [fe978046e00001c8] address between user and kernel address ranges Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 149 Comm: kworker/1:1H Tainted: G B 5.15.117-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Workqueue: xfs-log/loop5 xlog_ioend_work pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] pc : do_raw_spin_lock+0x80/0x35c kernel/locking/spinlock_debug.c:114 lr : __raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline] lr : _raw_spin_lock+0xb8/0x10c kernel/locking/spinlock.c:154 sp : ffff80001a4573a0 x29: ffff80001a457430 x28: ffff80001a4573c0 x27: ffff00011215f200 x26: dead000000000100 x25: ffff0000dcbf3800 x24: f4c0023700000e01 x23: dfff800000000000 x22: 0000000100000080 x21: f4c0023700000e41 x20: f4c0023700000e41 x19: f4c0023700000e45 x18: 0000000000000003 x17: ff80800008335ea8 x16: ffff80000830309c x15: ffff800008335ea8 x14: 1ffff0000291e06a x13: ffffffffffffffff x12: 0000000000000000 x11: ffff80000830309c x10: 1ffff0000348ae78 x9 : 1e980046e00001c8 x8 : f3f3f304f1f1f1f1 x7 : 0000000000000000 x6 : ffff800009b4790c x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000000 x1 : ffff800011f508c0 x0 : f4c0023700000e41 Call trace: do_raw_spin_lock+0x80/0x35c kernel/locking/spinlock_debug.c:114 __raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline] _raw_spin_lock+0xb8/0x10c kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:363 [inline] xfs_trans_committed_bulk+0xe4/0x70c fs/xfs/xfs_trans.c:747 xlog_cil_committed+0x22c/0xc20 fs/xfs/xfs_log_cil.c:631 xlog_cil_process_committed+0x11c/0x174 fs/xfs/xfs_log_cil.c:659 xlog_state_shutdown_callbacks+0x23c/0x324 fs/xfs/xfs_log.c:516 xlog_force_shutdown+0x1a8/0x208 fs/xfs/xfs_log.c:3896 xfs_do_force_shutdown+0x118/0x5e8 fs/xfs/xfs_fsops.c:529 xlog_ioend_work+0xc0/0x114 fs/xfs/xfs_log.c:1364 process_one_work+0x790/0x11b8 kernel/workqueue.c:2307 worker_thread+0x910/0x1034 kernel/workqueue.c:2454 kthread+0x37c/0x45c kernel/kthread.c:319 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Code: d343fe69 f9001beb f8376948 aa0003f4 (38f76928) ---[ end trace daa74d2a26fa4f2c ]--- ---------------- Code disassembly (best guess): 0: d343fe69 lsr x9, x19, #3 4: f9001beb str x11, [sp, #48] 8: f8376948 str x8, [x10, x23] c: aa0003f4 mov x20, x0 * 10: 38f76928 ldrsb w8, [x9, x23] <-- trapping instruction