Hello,
syzbot found the following issue on:
HEAD commit: 75389113731b Linux 6.1.40
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=16dfdfaea80000
kernel config:
https://syzkaller.appspot.com/x/.config?x=19e4c20feaf8572
dashboard link:
https://syzkaller.appspot.com/bug?extid=2f4b985b687de640df5b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/ab09bd46ff23/disk-75389113.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/93c5d059d61a/vmlinux-75389113.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/bee6a3f24d7b/Image-75389113.gz.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+2f4b98...@syzkaller.appspotmail.com
F2FS-fs (loop4): Try to recover 1th superblock, ret: 0
F2FS-fs (loop4): Mounted with checkpoint version = 753bd00b
======================================================
WARNING: possible circular locking dependency detected
6.1.40-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.4/6067 is trying to acquire lock:
ffff00010786c618 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2154 [inline]
ffff00010786c618 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xa4/0x1198 fs/f2fs/xattr.c:531
but task is already holding lock:
ffff00010693c380 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2179 [inline]
ffff00010693c380 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_add_regular_entry+0x6fc/0xe8c fs/f2fs/dir.c:770
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&fi->i_sem){+.+.}-{3:3}:
down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
f2fs_down_write fs/f2fs/f2fs.h:2179 [inline]
f2fs_add_inline_entry+0x350/0x650 fs/f2fs/inline.c:645
f2fs_add_dentry fs/f2fs/dir.c:815 [inline]
f2fs_do_add_link+0x2c4/0x5a4 fs/f2fs/dir.c:858
f2fs_add_link fs/f2fs/f2fs.h:3530 [inline]
f2fs_mkdir+0x2a4/0x4ec fs/f2fs/namei.c:771
vfs_mkdir+0x334/0x4e4 fs/namei.c:4036
do_mkdirat+0x20c/0x610 fs/namei.c:4061
__do_sys_mkdirat fs/namei.c:4076 [inline]
__se_sys_mkdirat fs/namei.c:4074 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4074
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
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:581
-> #0 (&fi->i_xattr_sem){.+.+}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3098 [inline]
check_prevs_add kernel/locking/lockdep.c:3217 [inline]
validate_chain kernel/locking/lockdep.c:3832 [inline]
__lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
down_read+0x64/0x308 kernel/locking/rwsem.c:1520
f2fs_down_read fs/f2fs/f2fs.h:2154 [inline]
f2fs_getxattr+0xa4/0x1198 fs/f2fs/xattr.c:531
__f2fs_get_acl+0x6c/0x5e4 fs/f2fs/acl.c:179
f2fs_acl_create fs/f2fs/acl.c:375 [inline]
f2fs_init_acl+0xe8/0x8e8 fs/f2fs/acl.c:418
f2fs_init_inode_metadata+0x8a8/0x11e8 fs/f2fs/dir.c:587
f2fs_add_regular_entry+0x710/0xe8c fs/f2fs/dir.c:771
f2fs_add_dentry fs/f2fs/dir.c:819 [inline]
f2fs_do_add_link+0x300/0x5a4 fs/f2fs/dir.c:858
f2fs_add_link fs/f2fs/f2fs.h:3530 [inline]
f2fs_create+0x634/0x8b4 fs/f2fs/namei.c:367
lookup_open fs/namei.c:3413 [inline]
open_last_lookups fs/namei.c:3481 [inline]
path_openat+0xeac/0x2548 fs/namei.c:3711
do_filp_open+0x1bc/0x3cc fs/namei.c:3741
do_sys_openat2+0x128/0x3d8 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/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
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:581
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&fi->i_sem);
lock(&fi->i_xattr_sem);
lock(&fi->i_sem);
lock(&fi->i_xattr_sem);
*** DEADLOCK ***
4 locks held by syz-executor.4/6067:
#0: ffff0000d9388460 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393
#1: ffff00010786bfa8 (&type->i_mutex_dir_key#9){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
#1: ffff00010786bfa8 (&type->i_mutex_dir_key#9){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3478 [inline]
#1: ffff00010786bfa8 (&type->i_mutex_dir_key#9){+.+.}-{3:3}, at: path_openat+0x5ec/0x2548 fs/namei.c:3711
#2: ffff00010adc43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2154 [inline]
#2: ffff00010adc43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2197 [inline]
#2: ffff00010adc43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_create+0x598/0x8b4 fs/f2fs/namei.c:366
#3: ffff00010693c380 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2179 [inline]
#3: ffff00010693c380 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_add_regular_entry+0x6fc/0xe8c fs/f2fs/dir.c:770
stack backtrace:
CPU: 1 PID: 6067 Comm: syz-executor.4 Not tainted 6.1.40-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
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/0x58 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2056
check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2178
check_prev_add kernel/locking/lockdep.c:3098 [inline]
check_prevs_add kernel/locking/lockdep.c:3217 [inline]
validate_chain kernel/locking/lockdep.c:3832 [inline]
__lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
down_read+0x64/0x308 kernel/locking/rwsem.c:1520
f2fs_down_read fs/f2fs/f2fs.h:2154 [inline]
f2fs_getxattr+0xa4/0x1198 fs/f2fs/xattr.c:531
__f2fs_get_acl+0x6c/0x5e4 fs/f2fs/acl.c:179
f2fs_acl_create fs/f2fs/acl.c:375 [inline]
f2fs_init_acl+0xe8/0x8e8 fs/f2fs/acl.c:418
f2fs_init_inode_metadata+0x8a8/0x11e8 fs/f2fs/dir.c:587
f2fs_add_regular_entry+0x710/0xe8c fs/f2fs/dir.c:771
f2fs_add_dentry fs/f2fs/dir.c:819 [inline]
f2fs_do_add_link+0x300/0x5a4 fs/f2fs/dir.c:858
f2fs_add_link fs/f2fs/f2fs.h:3530 [inline]
f2fs_create+0x634/0x8b4 fs/f2fs/namei.c:367
lookup_open fs/namei.c:3413 [inline]
open_last_lookups fs/namei.c:3481 [inline]
path_openat+0xeac/0x2548 fs/namei.c:3711
do_filp_open+0x1bc/0x3cc fs/namei.c:3741
do_sys_openat2+0x128/0x3d8 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/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
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:581
---
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 bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup