possible deadlock in path_openat (5)

Status: upstream: reported C repro on 2026/07/29 03:36
Subsystems: fs
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+4c9318af45f0bf2af153@syzkaller.appspotmail.com
First crash: 5d18h, last: 2h18m
✨ AI Jobs (1)
ID Workflow Result Correct Bug Created Started Finished Revision Error
eed44204 assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ possible deadlock in path_openat (5) 2026/07/27 01:47 2026/07/27 01:47 2026/07/27 02:24 492bab15

			
		
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] usb: gadget: f_mass_storage: reject relative paths to fix sb_writers deadlock 3 (3) 2026/07/30 09:27
[syzbot] [fs?] possible deadlock in path_openat (5) 0 (2) 2026/07/29 04:26
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in path_openat fs 4 syz, C done unreliable 349 2310d 2864d 0/29 auto-obsoleted due to no activity on 2022/09/16 21:43
upstream possible deadlock in path_openat (3) fs 4 1 333d 333d 29/29 fixed on 2025/10/29 21:02
android-49 possible deadlock in path_openat 4 5 2439d 2454d 0/3 auto-closed as invalid on 2020/03/24 08:43
linux-6.1 possible deadlock in path_openat origin:upstream missing-backport 4 syz, C done 206 73d 1235d 0/3 upstream: reported C repro on 2023/03/13 16:18
upstream possible deadlock in path_openat (2) fs 4 syz, C error done 305 912d 1388d 0/29 auto-obsoleted due to no activity on 2024/06/02 07:09
linux-4.14 possible deadlock in path_openat reiserfs 4 syz, C error 327 1246d 2654d 0/1 upstream: reported C repro on 2019/04/24 01:40
linux-6.6 possible deadlock in path_openat origin:lts-only 4 syz, C inconclusive 4 101d 117d 0/2 upstream: reported C repro on 2026/04/04 09:21
linux-5.15 possible deadlock in path_openat missing-backport origin:upstream 4 syz, C done 188 21d 1231d 0/3 upstream: reported C repro on 2023/03/17 13:15
upstream possible deadlock in path_openat (4) fs 4 1 226d 213d 0/29 auto-obsoleted due to no activity on 2026/03/26 17:57
linux-4.19 possible deadlock in path_openat 4 syz, C error 859 1242d 2602d 0/1 upstream: reported C repro on 2019/06/15 07:08

Sample crash report:
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.17/5931 is trying to acquire lock:
ffff888022ef8450 (sb_writers#13){.+.+}-{0:0}, at: open_last_lookups fs/namei.c:4597 [inline]
ffff888022ef8450 (sb_writers#13){.+.+}-{0:0}, at: path_openat+0xad9/0x4280 fs/namei.c:4860

but task is already holding lock:
ffff888022ef8450 (sb_writers#13){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:739

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

       CPU0
       ----
  lock(sb_writers#13);
  lock(sb_writers#13);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by syz.0.17/5931:
 #0: ffff888022ef8450 (sb_writers#13){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:739
 #1: ffff88803c6e8480 (&buffer->mutex){+.+.}-{4:4}, at: configfs_write_iter+0x76/0x4e0 fs/configfs/file.c:226
 #2: ffff888022ac4670 (&p->frag_sem){.+.+}-{4:4}, at: flush_write_buffer fs/configfs/file.c:205 [inline]
 #2: ffff888022ac4670 (&p->frag_sem){.+.+}-{4:4}, at: configfs_write_iter+0x218/0x4e0 fs/configfs/file.c:229
 #3: ffff888026567120 (&common->filesem){+.+.}-{4:4}, at: fsg_store_file+0x193/0x450 drivers/usb/gadget/function/storage_common.c:452

stack backtrace:
CPU: 2 UID: 0 PID: 5931 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 print_deadlock_bug.cold+0xbd/0xca kernel/locking/lockdep.c:3041
 check_deadlock kernel/locking/lockdep.c:3093 [inline]
 validate_chain kernel/locking/lockdep.c:3895 [inline]
 __lock_acquire+0x1256/0x1a40 kernel/locking/lockdep.c:5237
 lock_acquire kernel/locking/lockdep.c:5868 [inline]
 lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline]
 percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline]
 __sb_start_write include/linux/fs/super.h:19 [inline]
 sb_start_write include/linux/fs/super.h:125 [inline]
 mnt_want_write+0x6f/0x410 fs/namespace.c:494
 open_last_lookups fs/namei.c:4597 [inline]
 path_openat+0xad9/0x4280 fs/namei.c:4860
 do_file_open+0x20e/0x430 fs/namei.c:4892
 file_open_name+0x1c3/0x3e0 fs/open.c:1326
 filp_open+0x2e/0x50 fs/open.c:1343
 fsg_lun_open+0x6b/0x7b0 drivers/usb/gadget/function/storage_common.c:194
 fsg_store_file+0x1e7/0x450 drivers/usb/gadget/function/storage_common.c:455
 flush_write_buffer fs/configfs/file.c:207 [inline]
 configfs_write_iter+0x302/0x4e0 fs/configfs/file.c:229
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6ac/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f4dab39de99
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:00007ffcc2fe5d18 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f4dab625fa0 RCX: 00007f4dab39de99
RDX: 0000000000000002 RSI: 0000200000000f00 RDI: 0000000000000003
RBP: 00007f4dab433eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f4dab625fac R14: 00007f4dab625fa0 R15: 00007f4dab625fa0
 </TASK>
mass_storage.usb0/lun.0: unable to open backing file: fi

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/29 04:26 upstream 3b5f4b83c4ab 4a865b71 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in path_openat
2026/07/25 20:25 upstream 0ce37745d4bf 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in path_openat
2026/07/25 19:26 upstream 0ce37745d4bf 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in path_openat
2026/07/25 21:45 upstream 3dab139d4795 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in path_openat
2026/07/25 21:45 upstream 3dab139d4795 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in path_openat
2026/07/25 03:25 upstream 48a5a7ab8d6a 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in path_openat
2026/07/30 19:56 upstream 11028ab62899 abc81b93 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in path_openat
2026/07/27 21:50 upstream f5098b6bae76 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in path_openat
2026/07/26 08:31 upstream 3dab139d4795 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in path_openat
2026/07/25 16:12 upstream 0ce37745d4bf 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in path_openat
* Struck through repros no longer work on HEAD.