syzbot


WARNING: lock held when returning to user space in ns_ioctl

Status: fixed on 2024/08/14 03:44
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+dd73570cf9918519e789@syzkaller.appspotmail.com
Fix commit: 280e36f0d5b9 nsfs: use cleanup guard
First crash: 141d, last: 129d
Cause bisection: introduced by (bisect log) :
commit ca567df74a28a9fb368c6b2d93e864113f73f5c2
Author: Christian Brauner <brauner@kernel.org>
Date: Sun Jun 7 20:47:08 2020 +0000

  nsfs: add pid translation ioctls

Crash: WARNING: lock held when returning to user space in ns_ioctl (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [fs?] WARNING: lock held when returning to user space in ns_ioctl 2 (5) 2024/07/26 09:16
Last patch testing requests (2)
Created Duration User Patch Repo Result
2024/07/18 11:03 24m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 51835949dda3 OK log
2024/07/18 04:18 1h40m djahchankoike@gmail.com patch upstream OK log

Sample crash report:
================================================
WARNING: lock held when returning to user space!
6.10.0-syzkaller-04472-g51835949dda3 #0 Not tainted
------------------------------------------------
syz-executor608/5094 is leaving the kernel with locks still held!
1 lock held by syz-executor608/5094:
 #0: ffffffff8e335fe0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:327 [inline]
 #0: ffffffff8e335fe0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:839 [inline]
 #0: ffffffff8e335fe0 (rcu_read_lock){....}-{1:2}, at: ns_ioctl+0x3e0/0x740 fs/nsfs.c:184
BUG: sleeping function called from invalid context at include/linux/sched/mm.h:337
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5094, name: syz-executor608
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
INFO: lockdep is turned off.
CPU: 0 PID: 5094 Comm: syz-executor608 Not tainted 6.10.0-syzkaller-04472-g51835949dda3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 __might_resched+0x5d4/0x780 kernel/sched/core.c:8437
 might_alloc include/linux/sched/mm.h:337 [inline]
 prepare_alloc_pages+0x1c9/0x5d0 mm/page_alloc.c:4454
 __alloc_pages_noprof+0x166/0x6c0 mm/page_alloc.c:4672
 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
 vma_alloc_folio_noprof+0xf3/0x1f0 mm/mempolicy.c:2304
 folio_prealloc+0x31/0x170
 wp_page_copy mm/memory.c:3285 [inline]
 do_wp_page+0x11cc/0x52f0 mm/memory.c:3677
 handle_pte_fault+0x117e/0x7090 mm/memory.c:5397
 __handle_mm_fault mm/memory.c:5524 [inline]
 handle_mm_fault+0x10df/0x1ba0 mm/memory.c:5689
 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x459/0x8c0 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f7bc90efde0
Code: 41 54 55 48 89 f5 53 89 fb 48 83 ec 18 48 83 3d 0d 02 0a 00 00 89 54 24 0c 74 08 84 c9 0f 85 09 02 00 00 31 c0 ba 01 00 00 00 <f0> 0f b1 15 e0 2e 0a 00 0f 85 0f 02 00 00 4c 8d 25 d3 2e 0a 00 4c
RSP: 002b:00007fff01e59e90 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 00007f7bc9190110 RDI: 0000000000000000
RBP: 00007f7bc9190110 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (147):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/17 13:30 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:20 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:00 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 15:09 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 14:19 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 14:12 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:33 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:11 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:01 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:58 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:51 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:27 net 51835949dda3 215bec2d .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:40 net-next 51835949dda3 215bec2d .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:09 net-next 51835949dda3 215bec2d .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/18 21:24 upstream b1bc554e009e 7403ec00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/18 02:28 upstream 51835949dda3 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/18 01:17 upstream 51835949dda3 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 23:59 upstream 51835949dda3 0f902625 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 16:25 upstream 51835949dda3 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:51 upstream 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:51 upstream 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:51 upstream 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:51 upstream 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:49 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:48 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:48 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:47 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:43 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:43 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:42 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:42 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:42 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:37 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: lock held when returning to user space in ns_ioctl
2024/07/25 22:03 bpf fa5ef655615a 32fcf98f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/24 05:18 bpf 13c9b702e6cb 57b2edb1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/19 06:06 net a1b7dbca1490 ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:37 net 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:37 net 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:37 net 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/29 10:44 bpf-next 7d30b8aa4fc3 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/28 16:23 bpf-next 7d30b8aa4fc3 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/27 23:01 bpf-next 7d30b8aa4fc3 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/27 14:27 bpf-next 7d30b8aa4fc3 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/27 09:54 bpf-next 7d30b8aa4fc3 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/27 09:54 bpf-next 7d30b8aa4fc3 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/26 18:56 bpf-next 7d30b8aa4fc3 3f86dfed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/26 14:01 bpf-next 7d30b8aa4fc3 3f86dfed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/25 10:28 bpf-next 7244100e0389 b24754ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/24 19:49 bpf-next 1689ac04bc7b b24754ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/24 16:17 bpf-next 1689ac04bc7b b24754ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/24 07:34 bpf-next ba1cf16ae34e 57b2edb1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/20 00:02 net-next 51835949dda3 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/19 18:41 net-next 51835949dda3 ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/18 13:02 net-next 51835949dda3 7403ec00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 13:16 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:42 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:41 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:41 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:41 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:40 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:40 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:40 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 12:40 net-next 51835949dda3 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: lock held when returning to user space in ns_ioctl
2024/07/21 01:51 linux-next 41c196e567fb b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/20 20:17 linux-next 41c196e567fb b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/20 19:59 linux-next 41c196e567fb b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/20 07:20 linux-next 41c196e567fb b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/20 02:20 linux-next 41c196e567fb b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 18:01 linux-next 797012914d2d 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: lock held when returning to user space in ns_ioctl
2024/07/17 17:56 linux-next 797012914d2d 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: lock held when returning to user space in ns_ioctl
* Struck through repros no longer work on HEAD.