syzbot


possible deadlock in put_mnt_ns

Status: upstream: reported C repro on 2026/01/15 09:50
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+55fd613012e606d75d45@syzkaller.appspotmail.com
First crash: 7d22h, last: 7d04h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [fs?] possible deadlock in put_mnt_ns 2 (4) 2026/01/16 13:44
Last patch testing requests (1)
Created Duration User Patch Repo Result
2026/01/16 10:52 2h27m brauner@kernel.org https://github.com/brauner/linux.git vfs-7.0.namespace OK log

Sample crash report:
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fca229e5fa0 R14: 00007fca229e5fa0 R15: 0000000000000003
 </TASK>
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.23/6026 is trying to acquire lock:
ffffffff8e49efd0 (namespace_sem){++++}-{4:4}, at: namespace_lock fs/namespace.c:1730 [inline]
ffffffff8e49efd0 (namespace_sem){++++}-{4:4}, at: class_namespace_excl_constructor fs/namespace.c:101 [inline]
ffffffff8e49efd0 (namespace_sem){++++}-{4:4}, at: put_mnt_ns+0x170/0x2f0 fs/namespace.c:6241

but task is already holding lock:
ffffffff8e49efd0 (namespace_sem){++++}-{4:4}, at: namespace_lock fs/namespace.c:1730 [inline]
ffffffff8e49efd0 (namespace_sem){++++}-{4:4}, at: lock_mount_exact+0x89/0x630 fs/namespace.c:3852

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(namespace_sem);
  lock(namespace_sem);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by syz.0.23/6026:
 #0: ffff888149040148 (&sb->s_type->i_mutex_key){++++}-{4:4}, at: inode_lock include/linux/fs.h:1028 [inline]
 #0: ffff888149040148 (&sb->s_type->i_mutex_key){++++}-{4:4}, at: lock_mount_exact+0x7d/0x630 fs/namespace.c:3851
 #1: ffffffff8e49efd0 (namespace_sem){++++}-{4:4}, at: namespace_lock fs/namespace.c:1730 [inline]
 #1: ffffffff8e49efd0 (namespace_sem){++++}-{4:4}, at: lock_mount_exact+0x89/0x630 fs/namespace.c:3852

stack backtrace:
CPU: 1 UID: 0 PID: 6026 Comm: syz.0.23 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_deadlock_bug+0x279/0x290 kernel/locking/lockdep.c:3041
 check_deadlock kernel/locking/lockdep.c:3093 [inline]
 validate_chain kernel/locking/lockdep.c:3895 [inline]
 __lock_acquire+0x2540/0x2cf0 kernel/locking/lockdep.c:5237
 lock_acquire+0x107/0x340 kernel/locking/lockdep.c:5868
 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1590
 namespace_lock fs/namespace.c:1730 [inline]
 class_namespace_excl_constructor fs/namespace.c:101 [inline]
 put_mnt_ns+0x170/0x2f0 fs/namespace.c:6241
 prepare_anon_dentry fs/libfs.c:2167 [inline]
 path_from_stashed+0x40a/0x5c0 fs/libfs.c:2252
 open_namespace_file+0x8f/0x130 fs/nsfs.c:108
 open_new_namespace fs/namespace.c:3174 [inline]
 vfs_open_tree+0xa9d/0xf50 fs/namespace.c:3220
 __do_sys_open_tree fs/namespace.c:3230 [inline]
 __se_sys_open_tree fs/namespace.c:3228 [inline]
 __x64_sys_open_tree+0x96/0x110 fs/namespace.c:3228
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fca2278f749
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:00007ffc7a04e728 EFLAGS: 00000246 ORIG_RAX: 00000000000001ac
RAX: ffffffffffffffda RBX: 00007fca229e5fa0 RCX: 00007fca2278f749
RDX: 0000000000001802 RSI: 0000200000000000 RDI: ffffffffffffffff
RBP: 00007ffc7a04e780 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fca229e5fa0 R14: 00007fca229e5fa0 R15: 0000000000000003
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/14 03:01 linux-next 0f853ca2a798 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce possible deadlock in put_mnt_ns
2026/01/14 02:26 linux-next 0f853ca2a798 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce possible deadlock in put_mnt_ns
2026/01/14 19:02 linux-next b775e489bec7 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in put_mnt_ns
2026/01/14 01:47 linux-next 0f853ca2a798 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce possible deadlock in put_mnt_ns
* Struck through repros no longer work on HEAD.