syzbot


possible deadlock in ocfs2_xattr_set

Status: upstream: reported on 2024/09/25 09:02
Reported-by: syzbot+c0d46b51c54922dc038f@syzkaller.appspotmail.com
First crash: 431d, last: 1h22m
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in ocfs2_xattr_set 4 396 18d 442d 0/3 upstream: reported on 2024/09/14 01:11
upstream possible deadlock in ocfs2_xattr_set ocfs2 4 6281 1h34m 446d 0/29 upstream: reported on 2024/09/10 05:07
linux-6.6 possible deadlock in ocfs2_xattr_set 4 207 12h13m 164d 0/2 upstream: reported on 2025/06/19 18:15

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.1026/9399 is trying to acquire lock:
ffff888052283488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
ffff888052283488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_xattr_set+0xad6/0x11e0 fs/ocfs2/xattr.c:3626

but task is already holding lock:
ffff8880522ea378
 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x40c/0x11e0 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+0x42/0x2d0 kernel/locking/rwsem.c:1520
       ocfs2_init_acl+0x2fb/0x720 fs/ocfs2/acl.c:365
       ocfs2_mknod+0x1463/0x2350 fs/ocfs2/namei.c:410
       ocfs2_mkdir+0x1b6/0x4a0 fs/ocfs2/namei.c:657
       vfs_mkdir+0x387/0x570 fs/namei.c:4114
       do_mkdirat+0x1d0/0x430 fs/namei.c:4139
       __do_sys_mkdirat fs/namei.c:4154 [inline]
       __se_sys_mkdirat fs/namei.c:4152 [inline]
       __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4152
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (jbd2_handle){++++}-{0:0}:
       jbd2_journal_lock_updates+0xa7/0x380 fs/jbd2/transaction.c:880
       __ocfs2_flush_truncate_log+0x2cd/0x11d0 fs/ocfs2/alloc.c:6030
       ocfs2_flush_truncate_log+0x4b/0x60 fs/ocfs2/alloc.c:6077
       ocfs2_sync_fs+0x113/0x310 fs/ocfs2/super.c:402
       sync_filesystem+0x1be/0x220 fs/sync.c:66
       ocfs2_remount+0xf2/0xa40 fs/ocfs2/super.c:611
       reconfigure_super+0x219/0x880 fs/super.c:977
       do_remount fs/namespace.c:2741 [inline]
       path_mount+0xdfd/0x1010 fs/namespace.c:3400
       do_mount fs/namespace.c:3421 [inline]
       __do_sys_mount fs/namespace.c:3629 [inline]
       __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3606
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{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+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
       lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
       down_write+0x36/0x60 kernel/locking/rwsem.c:1573
       inode_lock include/linux/fs.h:758 [inline]
       ocfs2_xattr_set+0xad6/0x11e0 fs/ocfs2/xattr.c:3626
       ocfs2_set_acl+0x4e1/0x590 fs/ocfs2/acl.c:254
       ocfs2_iop_set_acl+0x16f/0x270 fs/ocfs2/acl.c:285
       set_posix_acl fs/posix_acl.c:1160 [inline]
       posix_acl_xattr_set+0x387/0x3f0 fs/posix_acl.c:1189
       __vfs_setxattr+0x3e0/0x420 fs/xattr.c:182
       __vfs_setxattr_noperm+0x129/0x5e0 fs/xattr.c:216
       vfs_setxattr+0x168/0x2f0 fs/xattr.c:309
       do_setxattr fs/xattr.c:594 [inline]
       setxattr+0x2b2/0x2d0 fs/xattr.c:617
       path_setxattr+0x142/0x280 fs/xattr.c:636
       __do_sys_setxattr fs/xattr.c:652 [inline]
       __se_sys_setxattr fs/xattr.c:648 [inline]
       __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:648
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2 --> 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]#2);

 *** DEADLOCK ***

3 locks held by syz.6.1026/9399:
 #0: ffff88807e788460 (sb_writers#37){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402
 #1: ffff8880522ea648 (&type->i_mutex_dir_key#20){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #1: ffff8880522ea648 (&type->i_mutex_dir_key#20){++++}-{3:3}, at: vfs_setxattr+0x141/0x2f0 fs/xattr.c:308
 #2: ffff8880522ea378 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x40c/0x11e0 fs/ocfs2/xattr.c:3587

stack backtrace:
CPU: 0 PID: 9399 Comm: syz.6.1026 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 check_noncircular+0x274/0x310 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+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
 down_write+0x36/0x60 kernel/locking/rwsem.c:1573
 inode_lock include/linux/fs.h:758 [inline]
 ocfs2_xattr_set+0xad6/0x11e0 fs/ocfs2/xattr.c:3626
 ocfs2_set_acl+0x4e1/0x590 fs/ocfs2/acl.c:254
 ocfs2_iop_set_acl+0x16f/0x270 fs/ocfs2/acl.c:285
 set_posix_acl fs/posix_acl.c:1160 [inline]
 posix_acl_xattr_set+0x387/0x3f0 fs/posix_acl.c:1189
 __vfs_setxattr+0x3e0/0x420 fs/xattr.c:182
 __vfs_setxattr_noperm+0x129/0x5e0 fs/xattr.c:216
 vfs_setxattr+0x168/0x2f0 fs/xattr.c:309
 do_setxattr fs/xattr.c:594 [inline]
 setxattr+0x2b2/0x2d0 fs/xattr.c:617
 path_setxattr+0x142/0x280 fs/xattr.c:636
 __do_sys_setxattr fs/xattr.c:652 [inline]
 __se_sys_setxattr fs/xattr.c:648 [inline]
 __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:648
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f2406d8f749
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2407bff038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 00007f2406fe6090 RCX: 00007f2406d8f749
RDX: 0000200000002b40 RSI: 0000200000002a40 RDI: 0000200000002a00
RBP: 00007f2406e13f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000024 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2406fe6128 R14: 00007f2406fe6090 R15: 00007fff28f47978
 </TASK>

Crashes (558):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/30 18:51 linux-6.1.y f6e38ae624cf d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/19 18:44 linux-6.1.y f6e38ae624cf 26ee5237 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/19 11:48 linux-6.1.y f6e38ae624cf 26ee5237 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/17 13:18 linux-6.1.y f6e38ae624cf ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/16 16:55 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/15 19:24 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/14 14:01 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/03 12:23 linux-6.1.y f6e38ae624cf 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/03 08:21 linux-6.1.y f6e38ae624cf 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/10/27 13:14 linux-6.1.y 8e6e2188d949 fd2207e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/10/27 02:23 linux-6.1.y 8e6e2188d949 c0460fcd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/10/26 19:23 linux-6.1.y 8e6e2188d949 c0460fcd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/10/17 23:07 linux-6.1.y c2fda4b3f577 1c8c8cd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/10/15 23:15 linux-6.1.y c2fda4b3f577 19568248 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/10/15 19:00 linux-6.1.y c2fda4b3f577 19568248 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/10/15 12:32 linux-6.1.y c2fda4b3f577 b6605ba8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2024/09/25 09:02 linux-6.1.y e526b12bf916 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set
2025/11/30 09:07 linux-6.1.y f6e38ae624cf d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/30 01:47 linux-6.1.y f6e38ae624cf d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/29 10:12 linux-6.1.y f6e38ae624cf d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/28 21:12 linux-6.1.y f6e38ae624cf d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/28 16:13 linux-6.1.y f6e38ae624cf d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/27 21:42 linux-6.1.y f6e38ae624cf d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/25 01:19 linux-6.1.y f6e38ae624cf 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/24 11:34 linux-6.1.y f6e38ae624cf 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/23 09:54 linux-6.1.y f6e38ae624cf 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/21 12:51 linux-6.1.y f6e38ae624cf 280ea308 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/20 13:13 linux-6.1.y f6e38ae624cf 2cc4c24a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/16 20:48 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/15 17:35 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/13 05:24 linux-6.1.y f6e38ae624cf 07e030de .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/12 17:20 linux-6.1.y f6e38ae624cf 07e030de .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/11 19:46 linux-6.1.y f6e38ae624cf 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/10 08:09 linux-6.1.y f6e38ae624cf 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/09 14:35 linux-6.1.y f6e38ae624cf 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/07 13:57 linux-6.1.y f6e38ae624cf 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/06 20:12 linux-6.1.y f6e38ae624cf 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/03 02:49 linux-6.1.y f6e38ae624cf 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/02 13:53 linux-6.1.y f6e38ae624cf 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/11/01 22:14 linux-6.1.y f6e38ae624cf 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/30 22:36 linux-6.1.y f6e38ae624cf 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/29 06:57 linux-6.1.y 8e6e2188d949 fd2207e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/27 20:48 linux-6.1.y 8e6e2188d949 fd2207e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/27 16:35 linux-6.1.y 8e6e2188d949 fd2207e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/27 08:01 linux-6.1.y 8e6e2188d949 c0460fcd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/25 20:33 linux-6.1.y 8e6e2188d949 c0460fcd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/20 23:43 linux-6.1.y 8e6e2188d949 d422939c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/20 23:43 linux-6.1.y 8e6e2188d949 d422939c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/20 00:54 linux-6.1.y 8e6e2188d949 1c8c8cd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/19 18:12 linux-6.1.y 8e6e2188d949 1c8c8cd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/18 15:36 linux-6.1.y c2fda4b3f577 1c8c8cd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/17 13:02 linux-6.1.y c2fda4b3f577 7adf5298 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/17 11:37 linux-6.1.y c2fda4b3f577 7adf5298 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/17 03:07 linux-6.1.y c2fda4b3f577 19568248 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/16 18:13 linux-6.1.y c2fda4b3f577 19568248 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
2025/10/15 17:03 linux-6.1.y c2fda4b3f577 19568248 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set
* Struck through repros no longer work on HEAD.