[v6.1] possible deadlock in ocfs2_xattr_set_handle

7 views
Skip to first unread message

syzbot

unread,
Nov 23, 2026, 10:06:40 AM (8 days ago) Nov 23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1ca1436ccc68 Linux 6.1.193
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=134312bc580000
kernel config: https://syzkaller.appspot.com/x/.config?x=9adca3eab90ac215
dashboard link: https://syzkaller.appspot.com/bug?extid=7e141c2fa1f396f29443
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/9c4cd50e8650/disk-1ca1436c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cd8cf4bd2f44/vmlinux-1ca1436c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6fb4e30357c8/bzImage-1ca1436c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+7e141c...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.1042/7661 is trying to acquire lock:
ffff8880519b0660 (&oi->ip_alloc_sem/1){+.+.}-{3:3}, at: ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591

but task is already holding lock:
ffff8880543994e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:384

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&journal->j_trans_barrier){.+.+}-{3:3}:
down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:384
ocfs2_mknod+0x1265/0x2500 fs/ocfs2/namei.c:360
ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:675
lookup_open fs/namei.c:3533 [inline]
open_last_lookups fs/namei.c:3601 [inline]
path_openat+0x11b9/0x2f10 fs/namei.c:3835
do_filp_open+0x1ee/0x420 fs/namei.c:3865
do_sys_openat2+0x14b/0x4f0 fs/open.c:1320
do_sys_open fs/open.c:1336 [inline]
__do_sys_openat fs/open.c:1352 [inline]
__se_sys_openat fs/open.c:1347 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1347
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (sb_internal#6){.+.+}-{0:0}:
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1899 [inline]
sb_start_intwrite include/linux/fs.h:2021 [inline]
ocfs2_start_trans+0x2a5/0x6f0 fs/ocfs2/journal.c:382
ocfs2_duplicate_inline_data+0x167/0x560 fs/ocfs2/refcounttree.c:3968
ocfs2_reflink_remap_blocks+0x4a7/0x1ab0 fs/ocfs2/refcounttree.c:4661
ocfs2_remap_file_range+0x4a7/0x740 fs/ocfs2/file.c:2733
vfs_copy_file_range+0xd89/0x1520 fs/read_write.c:1520
__do_sys_copy_file_range fs/read_write.c:1598 [inline]
__se_sys_copy_file_range+0x320/0x470 fs/read_write.c:1561
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&oi->ip_alloc_sem/1){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
down_write_nested+0x39/0x60 kernel/locking/rwsem.c:1689
ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591
ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
ocfs2_init_acl+0x1f7/0x420 fs/ocfs2/acl.c:426
ocfs2_mknod+0x1869/0x2500 fs/ocfs2/namei.c:409
ocfs2_mkdir+0x1b6/0x4b0 fs/ocfs2/namei.c:658
vfs_mkdir+0x386/0x570 fs/namei.c:4161
do_mkdirat+0x1d8/0x440 fs/namei.c:4186
__do_sys_mkdirat fs/namei.c:4201 [inline]
__se_sys_mkdirat fs/namei.c:4199 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4199
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
&oi->ip_alloc_sem/1 --> sb_internal#6 --> &journal->j_trans_barrier

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
rlock(&journal->j_trans_barrier);
lock(sb_internal#6);
lock(&journal->j_trans_barrier);
lock(&oi->ip_alloc_sem/1);

*** DEADLOCK ***

8 locks held by syz.2.1042/7661:
#0: ffff8880736de460 (sb_writers#38){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402
#1: ffff888051abd108 (&type->i_mutex_dir_key#22/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:801 [inline]
#1: ffff888051abd108 (&type->i_mutex_dir_key#22/1){+.+.}-{3:3}, at: filename_create+0x20b/0x450 fs/namei.c:3931
#2: ffff888051b32648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
#2: ffff888051b32648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
#3: ffff888051b31808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
#3: ffff888051b31808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
#4: ffff888051b342c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
#4: ffff888051b342c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0x11e/0x2770 fs/ocfs2/localalloc.c:635
#5: ffff8880736de650 (sb_internal#6){.+.+}-{0:0}, at: ocfs2_mknod+0x1265/0x2500 fs/ocfs2/namei.c:360
#6: ffff8880543994e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:384
#7: ffff888056396990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x2014/0x2240 fs/jbd2/transaction.c:463

stack backtrace:
CPU: 0 PID: 7661 Comm: syz.2.1042 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2215
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
down_write_nested+0x39/0x60 kernel/locking/rwsem.c:1689
ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591
ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
ocfs2_init_acl+0x1f7/0x420 fs/ocfs2/acl.c:426
ocfs2_mknod+0x1869/0x2500 fs/ocfs2/namei.c:409
ocfs2_mkdir+0x1b6/0x4b0 fs/ocfs2/namei.c:658
vfs_mkdir+0x386/0x570 fs/namei.c:4161
do_mkdirat+0x1d8/0x440 fs/namei.c:4186
__do_sys_mkdirat fs/namei.c:4201 [inline]
__se_sys_mkdirat fs/namei.c:4199 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4199
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f130fda8387
Code: 00 66 90 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 db f7 ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 b8 02 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f130dfb3e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f130dfb3ee0 RCX: 00007f130fda8387
RDX: 00000000000001ff RSI: 0000200000000080 RDI: 00000000ffffff9c
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000080
R13: 00007f130dfb3ea0 R14: 0000000000000000 R15: 0000000000000000
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Nov 26, 2026, 4:32:38 AM (6 days ago) Nov 26
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4f2df9a01754 Linux 5.15.226
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15811ab5580000
kernel config: https://syzkaller.appspot.com/x/.config?x=6de5c688de1c5851
dashboard link: https://syzkaller.appspot.com/bug?extid=d360580912476db0159d
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c910535dca8f/disk-4f2df9a0.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/722133bf598a/vmlinux-4f2df9a0.xz
kernel image: https://storage.googleapis.com/syzbot-assets/24af9d5e9bc6/bzImage-4f2df9a0.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d36058...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.52/4621 is trying to acquire lock:
ffff88805b518660 (&oi->ip_alloc_sem/1){+.+.}-{3:3}, at: ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591

but task is already holding lock:
ffff888020be0990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (jbd2_handle){++++}-{0:0}:
jbd2_journal_lock_updates+0xa4/0x390 fs/jbd2/transaction.c:881
__ocfs2_flush_truncate_log+0x2b4/0x1110 fs/ocfs2/alloc.c:6031
ocfs2_flush_truncate_log+0x4b/0x60 fs/ocfs2/alloc.c:6078
ocfs2_sync_fs+0x119/0x330 fs/ocfs2/super.c:404
sync_filesystem+0x1be/0x220 fs/sync.c:66
generic_shutdown_super+0x6b/0x300 fs/super.c:448
kill_block_super+0x7c/0xe0 fs/super.c:1438
deactivate_locked_super+0x93/0xf0 fs/super.c:335
cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217
__syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}:
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:795 [inline]
ocfs2_remove_btree_range+0x64f/0x15e0 fs/ocfs2/alloc.c:5746
ocfs2_commit_truncate+0xb62/0x1d30 fs/ocfs2/alloc.c:7350
ocfs2_truncate_file+0xd89/0x1540 fs/ocfs2/file.c:526
ocfs2_setattr+0x12f8/0x1b50 fs/ocfs2/file.c:1240
notify_change+0xbc6/0xee0 fs/attr.c:505
do_truncate+0x1ac/0x240 fs/open.c:65
do_sys_ftruncate+0x31b/0x3d0 fs/open.c:193
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&new->rf_sem){+.+.}-{3:3}:
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
__ocfs2_lock_refcount_tree fs/ocfs2/refcounttree.c:459 [inline]
ocfs2_lock_refcount_tree+0x15f/0x990 fs/ocfs2/refcounttree.c:492
ocfs2_set_refcount_tree+0x162/0x770 fs/ocfs2/refcounttree.c:735
ocfs2_reflink_remap_blocks+0x6a2/0x1ab0 fs/ocfs2/refcounttree.c:4727
ocfs2_remap_file_range+0x4a7/0x740 fs/ocfs2/file.c:2736
vfs_copy_file_range+0xf5c/0x1520 fs/read_write.c:1512
__do_sys_copy_file_range fs/read_write.c:1590 [inline]
__se_sys_copy_file_range+0x320/0x470 fs/read_write.c:1553
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (
&oi->ip_alloc_sem/1){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3125 [inline]
check_prevs_add kernel/locking/lockdep.c:3244 [inline]
validate_chain kernel/locking/lockdep.c:3860 [inline]
__lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134
lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751
down_write_nested+0x3b/0x60 kernel/locking/rwsem.c:1667
ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591
ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
ocfs2_init_acl+0x3b7/0x420 fs/ocfs2/acl.c:443
ocfs2_mknod+0x151f/0x2460 fs/ocfs2/namei.c:409
ocfs2_create+0x192/0x420 fs/ocfs2/namei.c:675
lookup_open fs/namei.c:3513 [inline]
open_last_lookups fs/namei.c:3583 [inline]
path_openat+0x120a/0x2fb0 fs/namei.c:3790
do_filp_open+0x1df/0x400 fs/namei.c:3820
do_sys_openat2+0x14b/0x500 fs/open.c:1255
do_sys_open fs/open.c:1271 [inline]
__do_sys_openat fs/open.c:1287 [inline]
__se_sys_openat fs/open.c:1282 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1282
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
&oi->ip_alloc_sem/1 --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5 --> jbd2_handle


Possible unsafe locking scenario:

CPU0 CPU1
---- ----
rlock(jbd2_handle);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5);
lock(jbd2_handle);
lock(&oi->ip_alloc_sem/1);

*** DEADLOCK ***

8 locks held by syz.0.52/4621:
#0: ffff888076212460 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386
#1: ffff88805b5089c8 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline]
#1: ffff88805b5089c8 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: open_last_lookups fs/namei.c:3580 [inline]
#1: ffff88805b5089c8 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: path_openat+0x821/0x2fb0 fs/namei.c:3790
#2: ffff88805b512648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2
){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline]
){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16d/0x44b0 fs/ocfs2/suballoc.c:804
#3:
ffff88805b511808
(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]
#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline]
#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16d/0x44b0 fs/ocfs2/suballoc.c:804
#4: ffff88805b5142c8
(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]
#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline]
#4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0x11c/0x2630 fs/ocfs2/localalloc.c:635
#5: ffff888076212650 (sb_internal#4
){.+.+}-{0:0}, at: ocfs2_mknod+0xf20/0x2460 fs/ocfs2/namei.c:360
#6: ffff888061d72ce8
(&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:384
#7:
ffff888020be0990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462

stack backtrace:
CPU: 1 PID: 4621 Comm: syz.0.52 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178
check_prev_add kernel/locking/lockdep.c:3125 [inline]
check_prevs_add kernel/locking/lockdep.c:3244 [inline]
validate_chain kernel/locking/lockdep.c:3860 [inline]
__lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134
lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751
down_write_nested+0x3b/0x60 kernel/locking/rwsem.c:1667
ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591
ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
ocfs2_init_acl+0x3b7/0x420 fs/ocfs2/acl.c:443
ocfs2_mknod+0x151f/0x2460 fs/ocfs2/namei.c:409
ocfs2_create+0x192/0x420 fs/ocfs2/namei.c:675
lookup_open fs/namei.c:3513 [inline]
open_last_lookups fs/namei.c:3583 [inline]
path_openat+0x120a/0x2fb0 fs/namei.c:3790
do_filp_open+0x1df/0x400 fs/namei.c:3820
do_sys_openat2+0x14b/0x500 fs/open.c:1255
do_sys_open fs/open.c:1271 [inline]
__do_sys_openat fs/open.c:1287 [inline]
__se_sys_openat fs/open.c:1282 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1282
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fe55528fa99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe5534bb028 EFLAGS: 00000246
ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fe55551c098 RCX: 00007fe55528fa99
RDX: 0000000000000042 RSI: 0000200000004b00 RDI: ffffffffffffff9c
RBP: 00007fe55531f18b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe55551c130 R14: 00007fe55551c098 R15: 00007ffd82698b48
</TASK>
kcov: kcov_task_exit: t = ffff888022f10000, kcov->t = ffff888022f10000

syzbot

unread,
7:30 AM (11 hours ago) 7:30 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e2bb30811e06 Linux 6.6.163
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=131fa1d9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=502dd17ff4371fdc
dashboard link: https://syzkaller.appspot.com/bug?extid=5e2b9e8b9d93a1a0e95a
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2d3c05fbb705/disk-e2bb3081.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a86788aeab5d/vmlinux-e2bb3081.xz
kernel image: https://storage.googleapis.com/syzbot-assets/47d99678acb7/bzImage-e2bb3081.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+5e2b9e...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.478/7251 is trying to acquire lock:
ffff88805c360660 (&oi->ip_alloc_sem/1){+.+.}-{3:3}, at: ocfs2_xattr_set_handle+0x3fd/0x820 fs/ocfs2/xattr.c:3839

but task is already holding lock:
ffff88805d8684e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a8/0x6f0 fs/ocfs2/journal.c:382

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&journal->j_trans_barrier){.+.+}-{3:3}:
down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
ocfs2_start_trans+0x3a8/0x6f0 fs/ocfs2/journal.c:382
ocfs2_mknod+0xef1/0x2250 fs/ocfs2/namei.c:360
ocfs2_create+0x196/0x430 fs/ocfs2/namei.c:675
lookup_open fs/namei.c:3551 [inline]
open_last_lookups fs/namei.c:3619 [inline]
path_openat+0x1705/0x3270 fs/namei.c:3853
do_filp_open+0x1f2/0x430 fs/namei.c:3883
do_sys_openat2+0x134/0x1d0 fs/open.c:1422
do_sys_open fs/open.c:1437 [inline]
__do_sys_open fs/open.c:1445 [inline]
__se_sys_open fs/open.c:1441 [inline]
__x64_sys_open+0x11f/0x140 fs/open.c:1441
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (sb_internal#2){.+.+}-{0:0}:
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1636 [inline]
sb_start_intwrite include/linux/fs.h:1758 [inline]
ocfs2_start_trans+0x2a9/0x6f0 fs/ocfs2/journal.c:380
ocfs2_duplicate_inline_data+0x16b/0x560 fs/ocfs2/refcounttree.c:3969
ocfs2_reflink_remap_blocks+0x4ab/0x1ab0 fs/ocfs2/refcounttree.c:4662
ocfs2_remap_file_range+0x4b1/0x740 fs/ocfs2/file.c:2775
vfs_copy_file_range+0xdc9/0x15a0 fs/read_write.c:1519
__do_sys_copy_file_range fs/read_write.c:1597 [inline]
__se_sys_copy_file_range+0x324/0x470 fs/read_write.c:1560
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&oi->ip_alloc_sem/1){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
down_write_nested+0x9e/0x200 kernel/locking/rwsem.c:1689
ocfs2_xattr_set_handle+0x3fd/0x820 fs/ocfs2/xattr.c:3839
ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
ocfs2_init_acl+0x1fb/0x420 fs/ocfs2/acl.c:427
ocfs2_mknod+0x1373/0x2250 fs/ocfs2/namei.c:409
ocfs2_mkdir+0x196/0x430 fs/ocfs2/namei.c:658
vfs_mkdir+0x2a5/0x470 fs/namei.c:4180
do_mkdirat+0x1dc/0x450 fs/namei.c:4203
__do_sys_mkdirat fs/namei.c:4218 [inline]
__se_sys_mkdirat fs/namei.c:4216 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
&oi->ip_alloc_sem/1 --> sb_internal#2 --> &journal->j_trans_barrier

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
rlock(&journal->j_trans_barrier);
lock(sb_internal#2);
lock(&journal->j_trans_barrier);
lock(&oi->ip_alloc_sem/1);

*** DEADLOCK ***

8 locks held by syz.2.478/7251:
#0: ffff8880330f4418 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
#1: ffff88805f2b1818 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline]
#1: ffff88805f2b1818 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: filename_create+0x20f/0x450 fs/namei.c:3949
#2: ffff88805c35a658 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline]
#2: ffff88805c35a658 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x171/0x44a0 fs/ocfs2/suballoc.c:804
#3: ffff88805c359818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline]
#3: ffff88805c359818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x171/0x44a0 fs/ocfs2/suballoc.c:804
#4: ffff88805c35c2d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline]
#4: ffff88805c35c2d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0x120/0x2620 fs/ocfs2/localalloc.c:635
#5: ffff8880330f4608 (sb_internal#2){.+.+}-{0:0}, at: ocfs2_mknod+0xef1/0x2250 fs/ocfs2/namei.c:360
#6: ffff88805d8684e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a8/0x6f0 fs/ocfs2/journal.c:382
#7: ffff88805e970990 (jbd2_handle#2){.+.+}-{0:0}, at: start_this_handle+0x1f3f/0x2170 fs/jbd2/transaction.c:448

stack backtrace:
CPU: 0 PID: 7251 Comm: syz.2.478 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
down_write_nested+0x9e/0x200 kernel/locking/rwsem.c:1689
ocfs2_xattr_set_handle+0x3fd/0x820 fs/ocfs2/xattr.c:3839
ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
ocfs2_init_acl+0x1fb/0x420 fs/ocfs2/acl.c:427
ocfs2_mknod+0x1373/0x2250 fs/ocfs2/namei.c:409
ocfs2_mkdir+0x196/0x430 fs/ocfs2/namei.c:658
vfs_mkdir+0x2a5/0x470 fs/namei.c:4180
do_mkdirat+0x1dc/0x450 fs/namei.c:4203
__do_sys_mkdirat fs/namei.c:4218 [inline]
__se_sys_mkdirat fs/namei.c:4216 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7ff95eda9c99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff95cff6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007ff95f036098 RCX: 00007ff95eda9c99
RDX: 00000000000001ff RSI: 0000200000004cc0 RDI: ffffffffffffff9c
RBP: 00007ff95ee3b18b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff95f036130 R14: 00007ff95f036098 R15: 00007ffc9b046cd8
</TASK>
Reply all
Reply to author
Forward
0 new messages