Hello,
syzbot found the following issue on:
HEAD commit: c16c81c81336 Linux 5.15.178
git tree: linux-5.15.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=13a94bf8580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=d302c69e93fb6774
dashboard link:
https://syzkaller.appspot.com/bug?extid=aee2d0876b688d945095
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/267e46ee7273/disk-c16c81c8.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/944e289206cf/vmlinux-c16c81c8.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/f8cadf62458e/bzImage-c16c81c8.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+aee2d0...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
5.15.178-syzkaller #0 Not tainted
------------------------------------------------------
syz.7.1640/11645 is trying to acquire lock:
ffff8880753d53b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff8880753d53b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_inode_create fs/ext4/xattr.c:1465 [inline]
ffff8880753d53b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1547 [inline]
ffff8880753d53b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_set_entry+0x3713/0x4130 fs/ext4/xattr.c:1675
but task is already holding lock:
ffff888060a4be48 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_truncate+0x974/0x1130 fs/ext4/inode.c:4244
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&ei->i_data_sem/3){++++}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
ext4_update_i_disksize fs/ext4/ext4.h:3401 [inline]
ext4_xattr_inode_write fs/ext4/xattr.c:1403 [inline]
ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1551 [inline]
ext4_xattr_set_entry+0x35e2/0x4130 fs/ext4/xattr.c:1675
ext4_xattr_block_set+0x69a/0x36a0 fs/ext4/xattr.c:1926
ext4_xattr_set_handle+0xdac/0x1560 fs/ext4/xattr.c:2412
ext4_xattr_set+0x26e/0x3d0 fs/ext4/xattr.c:2513
__vfs_setxattr+0x3e7/0x420 fs/xattr.c:182
__vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:216
vfs_setxattr+0x21d/0x420 fs/xattr.c:303
do_setxattr fs/xattr.c:588 [inline]
setxattr+0x27e/0x2e0 fs/xattr.c:611
path_setxattr+0x1bc/0x2a0 fs/xattr.c:630
__do_sys_lsetxattr fs/xattr.c:653 [inline]
__se_sys_lsetxattr fs/xattr.c:649 [inline]
__x64_sys_lsetxattr+0xb4/0xd0 fs/xattr.c:649
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
-> #0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ext4_xattr_inode_create fs/ext4/xattr.c:1465 [inline]
ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1547 [inline]
ext4_xattr_set_entry+0x3713/0x4130 fs/ext4/xattr.c:1675
ext4_xattr_block_set+0xb10/0x36a0 fs/ext4/xattr.c:1995
ext4_xattr_move_to_block fs/ext4/xattr.c:2623 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2698 [inline]
ext4_expand_extra_isize_ea+0x10d5/0x1bb0 fs/ext4/xattr.c:2790
__ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5857
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5900 [inline]
__ext4_mark_inode_dirty+0x539/0x860 fs/ext4/inode.c:5978
ext4_ext_truncate+0x9a/0x250 fs/ext4/extents.c:4454
ext4_truncate+0x9fd/0x1130 fs/ext4/inode.c:4249
ext4_evict_inode+0xba1/0x1100 fs/ext4/inode.c:289
evict+0x529/0x930 fs/inode.c:622
__dentry_kill+0x436/0x650 fs/dcache.c:586
dentry_kill+0xbb/0x290
dput+0xd8/0x1a0 fs/dcache.c:893
do_renameat2+0xe1c/0x1700 fs/namei.c:4987
__do_sys_rename fs/namei.c:5031 [inline]
__se_sys_rename fs/namei.c:5029 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:5029
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ei->i_data_sem/3);
lock(&sb->s_type->i_mutex_key#9/1);
lock(&ei->i_data_sem/3);
lock(&sb->s_type->i_mutex_key#9/1);
*** DEADLOCK ***
7 locks held by syz.7.1640/11645:
#0: ffff888056444460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
#1: ffff888056444748 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: lock_rename fs/namei.c:3016 [inline]
#1: ffff888056444748 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: do_renameat2+0x5b7/0x1700 fs/namei.c:4924
#2: ffff888056e183f0 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3017 [inline]
#2: ffff888056e183f0 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at: do_renameat2+0x644/0x1700 fs/namei.c:4924
#3: ffff888060a4abd0 (&type->i_mutex_dir_key#4/5){+.+.}-{3:3}, at: do_renameat2+0x67e/0x1700 fs/namei.c:4924
#4: ffff888056444650 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1813 [inline]
#4: ffff888056444650 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1930 [inline]
#4: ffff888056444650 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x375/0x1100 fs/ext4/inode.c:243
#5: ffff888060a4be48 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_truncate+0x974/0x1130 fs/ext4/inode.c:4244
#6: ffff888060a4bc98 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline]
#6: ffff888060a4bc98 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5897 [inline]
#6: ffff888060a4bc98 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x4a0/0x860 fs/ext4/inode.c:5978
stack backtrace:
CPU: 0 PID: 11645 Comm: syz.7.1640 Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ext4_xattr_inode_create fs/ext4/xattr.c:1465 [inline]
ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1547 [inline]
ext4_xattr_set_entry+0x3713/0x4130 fs/ext4/xattr.c:1675
ext4_xattr_block_set+0xb10/0x36a0 fs/ext4/xattr.c:1995
ext4_xattr_move_to_block fs/ext4/xattr.c:2623 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2698 [inline]
ext4_expand_extra_isize_ea+0x10d5/0x1bb0 fs/ext4/xattr.c:2790
__ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5857
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5900 [inline]
__ext4_mark_inode_dirty+0x539/0x860 fs/ext4/inode.c:5978
ext4_ext_truncate+0x9a/0x250 fs/ext4/extents.c:4454
ext4_truncate+0x9fd/0x1130 fs/ext4/inode.c:4249
ext4_evict_inode+0xba1/0x1100 fs/ext4/inode.c:289
evict+0x529/0x930 fs/inode.c:622
__dentry_kill+0x436/0x650 fs/dcache.c:586
dentry_kill+0xbb/0x290
dput+0xd8/0x1a0 fs/dcache.c:893
do_renameat2+0xe1c/0x1700 fs/namei.c:4987
__do_sys_rename fs/namei.c:5031 [inline]
__se_sys_rename fs/namei.c:5029 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:5029
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f698dd74de9
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:00007f698bbbd038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f698df8e080 RCX: 00007f698dd74de9
RDX: 0000000000000000 RSI: 00004000000000c0 RDI: 0000400000000000
RBP: 00007f698ddf62a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f698df8e080 R15: 00007fff71adfb28
</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