[syzbot] [overlayfs?] possible deadlock in ovl_copy_up_start (4)

4 views
Skip to first unread message

syzbot

unread,
Jun 11, 2024, 11:58:22 PMJun 11
to amir...@gmail.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, mik...@szeredi.hu, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 771ed66105de Merge tag 'clk-fixes-for-linus' of git://git...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11d2d41c980000
kernel config: https://syzkaller.appspot.com/x/.config?x=9a6ac4277fffe3ea
dashboard link: https://syzkaller.appspot.com/bug?extid=6d34d0b636fea8b593eb
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/424f71634ac4/disk-771ed661.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5b5e8a406642/vmlinux-771ed661.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ad23424a0851/bzImage-771ed661.xz

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

======================================================
WARNING: possible circular locking dependency detected
6.10.0-rc2-syzkaller-00366-g771ed66105de #0 Not tainted
------------------------------------------------------
syz-executor.2/5264 is trying to acquire lock:
ffff888055db1698 (&ovl_i_lock_key[depth]){+.+.}-{3:3}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:657 [inline]
ffff888055db1698 (&ovl_i_lock_key[depth]){+.+.}-{3:3}, at: ovl_copy_up_start+0x53/0x310 fs/overlayfs/util.c:719

but task is already holding lock:
ffff88802fbb6420 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:409

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (sb_writers#4){.+.+}-{0:0}:
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1655 [inline]
sb_start_write include/linux/fs.h:1791 [inline]
ovl_start_write+0x11d/0x290 fs/overlayfs/util.c:31
ovl_do_copy_up fs/overlayfs/copy_up.c:967 [inline]
ovl_copy_up_one fs/overlayfs/copy_up.c:1168 [inline]
ovl_copy_up_flags+0x1110/0x4470 fs/overlayfs/copy_up.c:1223
ovl_create_object+0x113/0x370 fs/overlayfs/dir.c:638
lookup_open fs/namei.c:3505 [inline]
open_last_lookups fs/namei.c:3574 [inline]
path_openat+0x1425/0x3280 fs/namei.c:3804
do_filp_open+0x235/0x490 fs/namei.c:3834
do_sys_openat2+0x13e/0x1d0 fs/open.c:1405
do_sys_open fs/open.c:1420 [inline]
__do_sys_openat fs/open.c:1436 [inline]
__se_sys_openat fs/open.c:1431 [inline]
__x64_sys_openat+0x247/0x2a0 fs/open.c:1431
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&ovl_i_lock_key[depth]){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869
__lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
__mutex_lock_common kernel/locking/mutex.c:608 [inline]
__mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:657 [inline]
ovl_copy_up_start+0x53/0x310 fs/overlayfs/util.c:719
ovl_copy_up_one fs/overlayfs/copy_up.c:1161 [inline]
ovl_copy_up_flags+0xbc1/0x4470 fs/overlayfs/copy_up.c:1223
ovl_create_tmpfile fs/overlayfs/dir.c:1317 [inline]
ovl_tmpfile+0x262/0x6d0 fs/overlayfs/dir.c:1373
vfs_tmpfile+0x396/0x510 fs/namei.c:3701
do_tmpfile+0x156/0x340 fs/namei.c:3764
path_openat+0x2ab8/0x3280 fs/namei.c:3798
do_filp_open+0x235/0x490 fs/namei.c:3834
do_sys_openat2+0x13e/0x1d0 fs/open.c:1405
do_sys_open fs/open.c:1420 [inline]
__do_sys_open fs/open.c:1428 [inline]
__se_sys_open fs/open.c:1424 [inline]
__x64_sys_open+0x225/0x270 fs/open.c:1424
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
rlock(sb_writers#4);
lock(&ovl_i_lock_key[depth]);
lock(sb_writers#4);
lock(&ovl_i_lock_key[depth]);

*** DEADLOCK ***

2 locks held by syz-executor.2/5264:
#0: ffff888060236420 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:409
#1: ffff88802fbb6420 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:409

stack backtrace:
CPU: 0 PID: 5264 Comm: syz-executor.2 Not tainted 6.10.0-rc2-syzkaller-00366-g771ed66105de #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869
__lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
__mutex_lock_common kernel/locking/mutex.c:608 [inline]
__mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:657 [inline]
ovl_copy_up_start+0x53/0x310 fs/overlayfs/util.c:719
ovl_copy_up_one fs/overlayfs/copy_up.c:1161 [inline]
ovl_copy_up_flags+0xbc1/0x4470 fs/overlayfs/copy_up.c:1223
ovl_create_tmpfile fs/overlayfs/dir.c:1317 [inline]
ovl_tmpfile+0x262/0x6d0 fs/overlayfs/dir.c:1373
vfs_tmpfile+0x396/0x510 fs/namei.c:3701
do_tmpfile+0x156/0x340 fs/namei.c:3764
path_openat+0x2ab8/0x3280 fs/namei.c:3798
do_filp_open+0x235/0x490 fs/namei.c:3834
do_sys_openat2+0x13e/0x1d0 fs/open.c:1405
do_sys_open fs/open.c:1420 [inline]
__do_sys_open fs/open.c:1428 [inline]
__se_sys_open fs/open.c:1424 [inline]
__x64_sys_open+0x225/0x270 fs/open.c:1424
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff91547cf69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff91627e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007ff9155b3f80 RCX: 00007ff91547cf69
RDX: 0000000000000000 RSI: 0000000000591002 RDI: 0000000020000100
RBP: 00007ff9154da6fe R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007ff9155b3f80 R15: 00007ffe78e13ca8
</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
Reply all
Reply to author
Forward
0 new messages