====================================================== WARNING: possible circular locking dependency detected 6.1.118-syzkaller #0 Not tainted ------------------------------------------------------ syz.2.238/5197 is trying to acquire lock: ffff0000df6e89c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff0000df6e89c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: ocfs2_xattr_set+0xb80/0x1478 fs/ocfs2/xattr.c:3626 but task is already holding lock: ffff0000e11f2378 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x4e4/0x1478 fs/ocfs2/xattr.c:3587 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&oi->ip_xattr_sem){++++}-{3:3}: down_read+0x64/0x308 kernel/locking/rwsem.c:1520 ocfs2_init_acl+0x2c8/0x764 fs/ocfs2/acl.c:365 ocfs2_mknod+0x1574/0x2560 fs/ocfs2/namei.c:408 ocfs2_create+0x1a8/0x560 fs/ocfs2/namei.c:672 lookup_open fs/namei.c:3482 [inline] open_last_lookups fs/namei.c:3550 [inline] path_openat+0xeac/0x2548 fs/namei.c:3780 do_filp_open+0x1bc/0x3cc fs/namei.c:3810 do_sys_openat2+0x128/0x3e0 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1345 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #1 (jbd2_handle){++++}-{0:0}: jbd2_journal_lock_updates+0xbc/0x324 fs/jbd2/transaction.c:880 __ocfs2_flush_truncate_log+0x2a0/0x1260 fs/ocfs2/alloc.c:6022 ocfs2_flush_truncate_log+0x4c/0x6c fs/ocfs2/alloc.c:6069 ocfs2_sync_fs+0x110/0x31c fs/ocfs2/super.c:402 sync_filesystem+0x1a0/0x218 fs/sync.c:66 generic_shutdown_super+0x70/0x328 fs/super.c:474 kill_block_super+0x70/0xdc fs/super.c:1470 deactivate_locked_super+0xac/0x124 fs/super.c:332 deactivate_super+0xf0/0x110 fs/super.c:363 cleanup_mnt+0x394/0x41c fs/namespace.c:1186 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193 task_work_run+0x240/0x2f0 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2080/0x2cb8 arch/arm64/kernel/signal.c:1132 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x3338/0x7680 kernel/locking/lockdep.c:5049 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_xattr_set+0xb80/0x1478 fs/ocfs2/xattr.c:3626 ocfs2_xattr_user_set+0xc0/0xe8 fs/ocfs2/xattr.c:7385 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277 vfs_setxattr+0x1a8/0x344 fs/xattr.c:309 ovl_do_setxattr fs/overlayfs/overlayfs.h:252 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:264 [inline] ovl_make_workdir fs/overlayfs/super.c:1435 [inline] ovl_get_workdir+0xc00/0x13d4 fs/overlayfs/super.c:1539 ovl_fill_super+0x15b4/0x2254 fs/overlayfs/super.c:2095 mount_nodev+0x68/0x104 fs/super.c:1489 ovl_mount+0x3c/0x50 fs/overlayfs/super.c:2186 legacy_get_tree+0xd4/0x16c fs/fs_context.c:632 vfs_get_tree+0x90/0x274 fs/super.c:1573 do_new_mount+0x278/0x8fc fs/namespace.c:3056 path_mount+0x590/0xe5c fs/namespace.c:3386 do_mount fs/namespace.c:3399 [inline] __do_sys_mount fs/namespace.c:3607 [inline] __se_sys_mount fs/namespace.c:3584 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3584 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5 --> jbd2_handle --> &oi->ip_xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_xattr_sem); lock(jbd2_handle); lock(&oi->ip_xattr_sem); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5); *** DEADLOCK *** 4 locks held by syz.2.238/5197: #0: ffff0000f937a0e0 (&type->s_umount_key#64/1){+.+.}-{3:3}, at: alloc_super+0x1b4/0x824 fs/super.c:228 #1: ffff0000df006460 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #2: ffff0000e11f2648 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff0000e11f2648 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: vfs_setxattr+0x17c/0x344 fs/xattr.c:308 #3: ffff0000e11f2378 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x4e4/0x1478 fs/ocfs2/xattr.c:3587 stack backtrace: CPU: 0 PID: 5197 Comm: syz.2.238 Not tainted 6.1.118-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2048 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x3338/0x7680 kernel/locking/lockdep.c:5049 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_xattr_set+0xb80/0x1478 fs/ocfs2/xattr.c:3626 ocfs2_xattr_user_set+0xc0/0xe8 fs/ocfs2/xattr.c:7385 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277 vfs_setxattr+0x1a8/0x344 fs/xattr.c:309 ovl_do_setxattr fs/overlayfs/overlayfs.h:252 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:264 [inline] ovl_make_workdir fs/overlayfs/super.c:1435 [inline] ovl_get_workdir+0xc00/0x13d4 fs/overlayfs/super.c:1539 ovl_fill_super+0x15b4/0x2254 fs/overlayfs/super.c:2095 mount_nodev+0x68/0x104 fs/super.c:1489 ovl_mount+0x3c/0x50 fs/overlayfs/super.c:2186 legacy_get_tree+0xd4/0x16c fs/fs_context.c:632 vfs_get_tree+0x90/0x274 fs/super.c:1573 do_new_mount+0x278/0x8fc fs/namespace.c:3056 path_mount+0x590/0xe5c fs/namespace.c:3386 do_mount fs/namespace.c:3399 [inline] __do_sys_mount fs/namespace.c:3607 [inline] __se_sys_mount fs/namespace.c:3584 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3584 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 OCFS2: ERROR (device loop2): int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *, handle_t *, u32, u32, struct ocfs2_suballoc_result *): Chain allocator dinode 23 has 4294967295 used bits but only 16777215 total On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted. OCFS2: Returning error to the calling process. (syz.2.238,5197,0):ocfs2_claim_suballoc_bits:1983 ERROR: status = -5 (syz.2.238,5197,0):__ocfs2_claim_clusters:2355 ERROR: status = -5 (syz.2.238,5197,0):__ocfs2_claim_clusters:2363 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_block_group_alloc_contig:433 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_block_group_alloc:705 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_block_group_alloc:758 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_reserve_suballoc_bits:833 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_reserve_suballoc_bits:850 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_reserve_new_metadata_blocks:990 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_reserve_new_metadata_blocks:1013 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_init_xattr_set_ctxt:3284 ERROR: status = -5 (syz.2.238,5197,0):ocfs2_xattr_set:3641 ERROR: status = -5 overlayfs: failed to set xattr on upper overlayfs: ...falling back to index=off,metacopy=off. overlayfs: upper fs missing required features.