| 0/0 |
2026/05/24 08:24 |
flow |
assessment-security |
49m
Results: map[DenialOfService:true Explanation:Based on the analysis of the bug report and the kernel source code, here is the
assessment of the security impact:
### Bug Mechanism
The bug is a deadlock caused by calling `request_module()` while holding global
locks.
1. The task `syz.0.496/8229` processes a generic netlink message and enters
`nfsd_nl_listener_set_doit()`. At this point, it holds the genetlink `cb_lock`
(acquired for reading in `genl_rcv()`).
2. `nfsd_nl_listener_set_doit()` acquires the global `nfsd_mutex`.
3. It then calls `svc_xprt_create_from_sa()`, which attempts to load a transport
module based on the user-provided name by calling `request_module("svc%s",
xcl_name)`.
4. `request_module()` spawns a user-mode helper (`modprobe`) and waits for it to
finish.
5. If the user-mode helper hangs (e.g., if it is intercepted/ptraced by a
malicious root user, or if it attempts to load a module that calls
`genl_register_family()` which blocks waiting for `cb_lock` for writing), the
kernel thread will hang indefinitely.
6. This results in a deadlock, holding both `cb_lock` and `nfsd_mutex`, which
blocks all subsequent genetlink operations and nfsd operations (as seen in the
bug report where other tasks are blocked on `nfsd_mutex`).
### Privilege Requirements
While this is a valid Denial of Service (deadlock), it is **not accessible to
unprivileged users**:
1. **Genetlink Path**: The `NFSD_CMD_LISTENER_SET` command is registered in
`nfsd_nl_ops` with the `GENL_ADMIN_PERM` flag. The genetlink core checks this
flag using `netlink_capable(skb, CAP_NET_ADMIN)`, which strictly requires
`CAP_NET_ADMIN` in the **initial user namespace**.
2. **Procfs Path**: The alternative way to reach this code is by writing to
`/proc/fs/nfsd/portlist`. This file is created with `0644` permissions and is
owned by root. Furthermore, the `nfsd` filesystem lacks the `FS_USERNS_MOUNT`
flag, meaning it cannot be mounted inside an unprivileged user namespace.
3. **NFS Mounts**: Other indirect paths (like mounting NFS or NFSv4) require
`CAP_SYS_ADMIN` in the initial user namespace.
### Conclusion
The bug results in a Denial of Service (deadlock) but is strictly limited to the
root user (or a user with `CAP_NET_ADMIN` in the initial user namespace). Since
an attacker must already possess root privileges to trigger the vulnerability,
it does not cross any security boundaries and is not considered a security
vulnerability. Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 1/1 |
2026/05/24 08:24 |
action |
syz-repro-to-c-repro |
0m
Results:
|
| 2/1 |
2026/05/24 08:24 |
action |
kernel-checkouter |
0m
Results: map[KernelSrc:/app/workdir/cache/src/f5e97ae237b8b3175839de50e49b92a72b9dac60]
|
| 3/1 |
2026/05/24 08:24 |
action |
kernel-builder |
24m
Results: map[KernelObj:/app/workdir/cache/build/03504b707fb1675f1177d383def9c6b3835e1f04]
|
| 4/1 |
2026/05/24 08:49 |
action |
codesearch-prepare |
16m
Results: map[Index:codesearch-index]
|
| 5/1 |
2026/05/24 09:06 |
agent |
expert |
7m
Model:
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
Instruction:
You are an experienced Linux kernel security engineer. Your task is to analyze given kernel bug report
and determine its security impact based on the following dimensions.
Use the provided tools to examine the source code, check for capability checks (e.g., capable(), ns_capable()),
and understand the nature of the bug. Analyze the given kernel build and configuration.
You can check the kernel config by grepping ".config" file; you can check kernel cmdline by greeping
".config" file for "CONFIG_CMDLINE=". Assume sysctl parameters have default values.
But analyze for the corresponding production build w/o debugging tools enabled (like KASAN, KMSAN, UBSAN).
Try different strategies when analyzing the bug:
- think of ways in which the vulnerable code is unreachable
- or the other way around: try to come up with different ideas of how an unprivileged user can reach the bug
If still unsure err on the side of the bug being non-exploitable/not-accessible.
In the final reply, provide a reasoning for your assessment.
Analysis dimensions:
* Exploitable:
Determine if the bug can result in memory corruption or elevated privileges.
Memory safety issues are almost always exploitable (KASAN or UBSAN reports for use-after-free, out-of-bounds;
refcounting issues, corrupted lists, etc). When kernel is crashing on a completly wild pointer access
(e.g. user-space address, or non-canonical address, but not on NULL or address corresponding to KASAN shadow
for NULL address), including both data accesses and control tranfers, that's also usually implies possibility
of exploitation. Such reports usually say "unable to handle kernel paging request".
Uses of uninitialized values detected by KMSAN may be exploitable b/c attacker frequently can affect uninit
values with spraying techniques. However, for these exploitabability depends on how exactly the uninit value
is used in the code, and what it affects.
Think of what happens after the bug is triggered. Some bugs cause kernel panic and halt execution,
they are harder to exploit. For example, BUG reports halts the kernel. However, WARNING reports don't halt
execution in production builds. Debug bug detection tools (like KASAN, KMSAN, KCSAN, UBSAN) are also not enabled
in production builds, so attacker can freely exploit these bugs w/o being detected by these tools.
If you see an integer overflow, think how the overflowed value used later (if it's used as allocation size,
or an array index). If you see an out-of-bounds read, think if it's followed by an out-of-bounds write as well.
Some KCSAN data-races may be exploitable by skilled attackers as well. Think what data structures got corrupted
as the result of data races and how. However, note that kernel has lots of "benign" data races that don't lead
to any runtime misbehavior at all.
* Denial Of Service:
Determine if the bug can result in denial-of-service. Most bugs can, since they cause system crash,
hangs, deadlocks, or resource leaks. This is mostly applicable to WARNING bugs that won't cause system crash
in production. For these think what will be consequences of the violation of the kernel assumptions flagged
by the WARNING. In some cases the unexpected condition is also properly handled by the normal control flow
(e.g. with "if (WARN_ON(...))"), these won't cause denial-of-service. If the condition is not handled,
then it may or may not cause denial-of-service.
* Accessible From Unprivileged Processes:
Determine if the bug can be reached from a typical (non-root) user process that does NOT have any special capabilities
(like CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON) or access to device nodes restricted to root.
Assume that unprivileged_bpf_disabled=1, that is eBPF loading is not accessible. However, cBPF (classical BPF)
is still accessible to non-root processes.
Assume that user namespaces are not accessible, that is, the process cannot get the mentioned capabilities even
within a new user namespace (checked by ns_capable() function in the kernel sources).
* Accessible From User Namespaces:
Determine if the bug can be reached within a user-namespace where the process has all capabilities
(including CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON). Such capabilities are checked with ns_capable()
function in the kernel sources.
* VM Guest Trigger:
Determine if the bug can be triggered from the context of a typical KVM guest (e.g., set up by a QEMU VMM).
Consider accesses to standard Linux host paravirtualized features (virtio-blk, virtio-net, etc.),
and handling of VM exits in the KVM code.
* VM Host Trigger in The Confidetial Computing Context:
Determine if the bug can be triggered in a confidential computing guest kernel from the context of a KVM host.
Consider access to standard Linux guest paravirtualized features (virtio-blk, virtio-net, etc.).
* Ethernet Network Trigger:
Determine if the bug can be triggered by processing ingress network Ethernet traffic, either directly (network stack)
or via drivers exposed to network data.
* Other Remote Trigger:
Determine if the bug can be triggered by processing remote traffic other than Ethernet (Wifi, Bluetooth, NFC, etc).
* Peripheral Trigger:
Determine if the bug can be triggered via an untrusted peripheral device that can be physically plugged
into a system, such as a USB device or a niche hardware driver handling external hardware inputs.
This is particularly important for mobile and desktop environments where users can plug in unknown devices.
* Malicious Filesystem Trigger:
Determine if the bug can be triggered by the kernel mounting and parsing a malicious filesystem image.
This is highly critical for Desktop and Mobile environments where external media or downloaded images
might be auto-mounted.
Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt:
The kernel bug report is:
INFO: task syz.1.554:8579 blocked for more than 143 seconds.
Tainted: G U L syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.1.554 state:D stack:27800 pid:8579 tgid:8577 ppid:5627 task_flags:0x400140 flags:0x00080002
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5388 [inline]
__schedule+0x1295/0x67a0 kernel/sched/core.c:7189
__schedule_loop kernel/sched/core.c:7268 [inline]
schedule+0xdd/0x390 kernel/sched/core.c:7283
schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:7340
__mutex_lock_common kernel/locking/mutex.c:726 [inline]
__mutex_lock+0xced/0x1b10 kernel/locking/mutex.c:820
expkey_flush+0x18/0x90 fs/nfsd/export.c:261
write_flush.isra.0+0x2af/0x3d0 net/sunrpc/cache.c:1536
pde_write fs/proc/inode.c:330 [inline]
proc_reg_write+0x240/0x330 fs/proc/inode.c:342
do_loop_readv_writev fs/read_write.c:852 [inline]
do_loop_readv_writev fs/read_write.c:837 [inline]
vfs_writev+0x5ea/0xe10 fs/read_write.c:1061
do_writev+0x13e/0x340 fs/read_write.c:1105
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd95f79ce59
RSP: 002b:00007fd960680028 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007fd95fa16090 RCX: 00007fd95f79ce59
RDX: 000000000000000a RSI: 0000200000000240 RDI: 0000000000000003
RBP: 00007fd95f832d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd95fa16128 R14: 00007fd95fa16090 R15: 00007ffe5c3a52f8
</TASK>
Showing all locks held in the system:
1 lock held by khungtaskd/31:
#0: ffffffff8e7e5420 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:300 [inline]
#0: ffffffff8e7e5420 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:838 [inline]
#0: ffffffff8e7e5420 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x3d/0x184 kernel/locking/lockdep.c:6775
2 locks held by getty/5382:
#0: ffff8880337ac0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x24/0x80 drivers/tty/tty_ldisc.c:243
#1: ffffc9000322b2e8 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x419/0x14f0 drivers/tty/n_tty.c:2211
1 lock held by syz.2.143/6447:
5 locks held by kworker/u11:26/7849:
#0: ffff88801c6ae140 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x12d6/0x1980 kernel/workqueue.c:3289
#1: ffffc90003587d08 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x973/0x1980 kernel/workqueue.c:3290
#2: ffffffff905f7688 (pernet_ops_rwsem){++++}-{4:4}, at: cleanup_net+0xb8/0x920 net/core/net_namespace.c:673
#3: ffffffff906103e0 (rtnl_mutex){+.+.}-{4:4}, at: ops_exit_rtnl_list net/core/net_namespace.c:173 [inline]
#3: ffffffff906103e0 (rtnl_mutex){+.+.}-{4:4}, at: ops_undo_list+0x7ec/0xab0 net/core/net_namespace.c:248
#4: ffffffff8e7f0f68 (rcu_state.exp_mutex){+.+.}-{4:4}, at: exp_funnel_lock+0x19e/0x3c0 kernel/rcu/tree_exp.h:343
2 locks held by syz.0.496/8229:
#0: ffffffff906be8c8 (cb_lock){++++}-{4:4}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1217
#1: ffffffff8ec61c60 (nfsd_mutex){+.+.}-{4:4}, at: nfsd_nl_listener_set_doit+0xd5/0x1a80 fs/nfsd/nfsctl.c:1938
2 locks held by syz-executor/8265:
#0: ffff8880312180d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: __super_lock fs/super.c:58 [inline]
#0: ffff8880312180d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: __super_lock_excl fs/super.c:73 [inline]
#0: ffff8880312180d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: deactivate_super fs/super.c:508 [inline]
#0: ffff8880312180d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: deactivate_super+0xdf/0x110 fs/super.c:505
#1: ffffffff8ec61c60 (nfsd_mutex){+.+.}-{4:4}, at: nfsd_shutdown_threads+0x5b/0xf0 fs/nfsd/nfssvc.c:576
3 locks held by syz.1.554/8579:
#0: ffff88806ad43b30 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2aa/0x380 fs/file.c:1261
#1: ffff8880236f2410 (sb_writers#3){.+.+}-{0:0}, at: do_writev+0x13e/0x340 fs/read_write.c:1105
#2: ffffffff8ec61c60 (nfsd_mutex){+.+.}-{4:4}, at: expkey_flush+0x18/0x90 fs/nfsd/export.c:261
2 locks held by syz-executor/8799:
#0: ffff88802c9040d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: __super_lock fs/super.c:58 [inline]
#0: ffff88802c9040d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: __super_lock_excl fs/super.c:73 [inline]
#0: ffff88802c9040d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: deactivate_super fs/super.c:508 [inline]
#0: ffff88802c9040d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: deactivate_super+0xdf/0x110 fs/super.c:505
#1: ffffffff8ec61c60 (nfsd_mutex){+.+.}-{4:4}, at: nfsd_shutdown_threads+0x5b/0xf0 fs/nfsd/nfssvc.c:576
2 locks held by syz.3.708/9354:
#0: ffff88803c05a0d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: __super_lock fs/super.c:58 [inline]
#0: ffff88803c05a0d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: __super_lock_excl fs/super.c:73 [inline]
#0: ffff88803c05a0d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: deactivate_super fs/super.c:508 [inline]
#0: ffff88803c05a0d8 (&type->s_umount_key#52){+.+.}-{4:4}, at: deactivate_super+0xdf/0x110 fs/super.c:505
#1: ffffffff8ec61c60 (nfsd_mutex){+.+.}-{4:4}, at: nfsd_shutdown_threads+0x5b/0xf0 fs/nfsd/nfssvc.c:576
3 locks held by syz-executor/9431:
#0: ffff8880779c4ea0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_do_close+0x26/0xb0 net/bluetooth/hci_core.c:500
#1: ffff8880779c40b8 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x35c/0x1240 net/bluetooth/hci_sync.c:5356
#2: ffffffff90897060 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:2151 [inline]
#2: ffffffff90897060 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xbb/0x280 net/bluetooth/hci_conn.c:2734
3 locks held by kworker/0:2/10450:
1 lock held by syz.6.960/10565:
#0: ffff8880784ddc40 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1029 [inline]
#0: ffff8880784ddc40 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: __sock_release+0x86/0x260 net/socket.c:721
4 locks held by syz.8.958/10561:
#0: ffff8880788e8ea0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_do_close+0x26/0xb0 net/bluetooth/hci_core.c:500
#1: ffff8880788e80b8 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x35c/0x1240 net/bluetooth/hci_sync.c:5356
#2: ffffffff90897060 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:2151 [inline]
#2: ffffffff90897060 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xbb/0x280 net/bluetooth/hci_conn.c:2734
#3: ffff888038b88af8 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x95/0x710 net/bluetooth/l2cap_core.c:1777
=============================================
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 31 Comm: khungtaskd Tainted: G U L syzkaller #0 PREEMPT(full)
Tainted: [U]=USER, [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
nmi_cpu_backtrace.cold+0x12d/0x151 lib/nmi_backtrace.c:113
nmi_trigger_cpumask_backtrace+0x1d7/0x230 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline]
__sys_info lib/sys_info.c:157 [inline]
sys_info+0x141/0x190 lib/sys_info.c:165
check_hung_uninterruptible_tasks kernel/hung_task.c:353 [inline]
watchdog+0xcb1/0x1030 kernel/hung_task.c:561
kthread+0x370/0x450 kernel/kthread.c:436
ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G U L syzkaller #0 PREEMPT(full)
Tainted: [U]=USER, [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
RIP: 0010:pv_native_safe_halt+0xf/0x20 arch/x86/kernel/paravirt.c:63
Code: a6 94 02 e9 c3 42 03 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 0f 00 2d 03 30 23 00 fb f4 <c3> cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
RSP: 0018:ffffc90000197df0 EFLAGS: 00000246
RAX: 0000000000140835 RBX: ffff88801e680000 RCX: ffffffff8b886095
RDX: 0000000000000000 RSI: ffffffff8df1e707 RDI: ffffffff8c1c3a00
RBP: 0000000000000000 R08: 0000000000000001 R09: ffffed10170a67b5
R10: ffff8880b8533dab R11: 0000000000000000 R12: 0000000000000001
R13: ffffed1003cd0000 R14: 0000000000000001 R15: ffffffff90d7fb50
FS: 0000000000000000(0000) GS:ffff888124474000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b33eb3ff8 CR3: 000000007da52000 CR4: 00000000003526f0
Call Trace:
<TASK>
arch_safe_halt arch/x86/include/asm/paravirt.h:62 [inline]
default_idle+0x9/0x10 arch/x86/kernel/process.c:767
default_idle_call+0x6c/0xb0 kernel/sched/idle.c:122
cpuidle_idle_call kernel/sched/idle.c:199 [inline]
do_idle+0x464/0x590 kernel/sched/idle.c:352
cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:451
start_secondary+0x21d/0x2d0 arch/x86/kernel/smpboot.c:312
common_startup_64+0x13e/0x148
</TASK>
Reply: Based on the analysis of the bug report and the kernel source code, here is the assessment of the security impact:
### Bug Mechanism
The bug is a deadlock caused by calling `request_module()` while holding global locks.
1. The task `syz.0.496/8229` processes a generic netlink message and enters `nfsd_nl_listener_set_doit()`. At this point, it holds the genetlink `cb_lock` (acquired for reading in `genl_rcv()`).
2. `nfsd_nl_listener_set_doit()` acquires the global `nfsd_mutex`.
3. It then calls `svc_xprt_create_from_sa()`, which attempts to load a transport module based on the user-provided name by calling `request_module("svc%s", xcl_name)`.
4. `request_module()` spawns a user-mode helper (`modprobe`) and waits for it to finish.
5. If the user-mode helper hangs (e.g., if it is intercepted/ptraced by a malicious root user, or if it attempts to load a module that calls `genl_register_family()` which blocks waiting for `cb_lock` for writing), the kernel thread will hang indefinitely.
6. This results in a deadlock, holding both `cb_lock` and `nfsd_mutex`, which blocks all subsequent genetlink operations and nfsd operations (as seen in the bug report where other tasks are blocked on `nfsd_mutex`).
### Privilege Requirements
While this is a valid Denial of Service (deadlock), it is **not accessible to unprivileged users**:
1. **Genetlink Path**: The `NFSD_CMD_LISTENER_SET` command is registered in `nfsd_nl_ops` with the `GENL_ADMIN_PERM` flag. The genetlink core checks this flag using `netlink_capable(skb, CAP_NET_ADMIN)`, which strictly requires `CAP_NET_ADMIN` in the **initial user namespace**.
2. **Procfs Path**: The alternative way to reach this code is by writing to `/proc/fs/nfsd/portlist`. This file is created with `0644` permissions and is owned by root. Furthermore, the `nfsd` filesystem lacks the `FS_USERNS_MOUNT` flag, meaning it cannot be mounted inside an unprivileged user namespace.
3. **NFS Mounts**: Other indirect paths (like mounting NFS or NFSv4) require `CAP_SYS_ADMIN` in the initial user namespace.
### Conclusion
The bug results in a Denial of Service (deadlock) but is strictly limited to the root user (or a user with `CAP_NET_ADMIN` in the initial user namespace). Since an attacker must already possess root privileges to trigger the vulnerability, it does not cross any security boundaries and is not considered a security vulnerability.
|
| 6/2 |
2026/05/24 09:06 |
llm |
expert |
0m
Model:
Tokens:
input: 10592
output: 47
thoughts: 1283
Thoughts: **Analyzing a Hung NFS Task**
Okay, here's what I'm seeing: A task, `syz.1.554`, has been blocked for quite a while – over 143 seconds. The call trace points directly to a context switch issue, which is pretty standard. Digging deeper, the trace shows it's stuck within `expkey_flush` in `fs/nfsd/export.c`. That function, as I recall, likely interacts with NFS export keys, and more specifically it is holding `nfsd_mutex`.
Now, the lockdep output is crucial here. It should tell me who's holding that mutex. And, there it is...it looks like several tasks, namely `syz.0.496`, `syz-executor/8265`, `syz-executor/8799` and `syz.3.708`, are *also* showing `nfsd_mutex` in their lock lists, along with a secondary `s_umount_key`. This seems problematic, as only one task should be holding a mutex at a time. However, this lockdep output seems suspect, because these are showing the locks *held*. Perhaps I'm misinterpreting the output, and lockdep is showing the mutex that they are blocked on.
But wait a minute, tasks that are blocked *don't* actually hold the mutex – they're waiting for it. The lockdep output confirms that multiple tasks are holding the mutex.
Let's look more closely at `nfsd_shutdown_threads` in `fs/nfsd/nfssvc.c`. It's a key function in NFS server shutdown, and it's likely where the `nfsd_mutex` is being acquired or held. This points to an issue during the shutdown of the NFS server process. It's likely that something is holding the `nfsd_mutex` and preventing `expkey_flush` from continuing.
|
| 7/2 |
2026/05/24 09:06 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/nfssvc.c IncludeLines:true Name:nfsd_shutdown_threads]
Results: map[SourceCode: 571: void nfsd_shutdown_threads(struct net *net)
572: {
573: struct nfsd_net *nn = net_generic(net, nfsd_net_id);
574: struct svc_serv *serv;
575:
576: mutex_lock(&nfsd_mutex);
577: serv = nn->nfsd_serv;
578: if (serv == NULL) {
579: mutex_unlock(&nfsd_mutex);
580: return;
581: }
582:
583: /* Kill outstanding nfsd threads */
584: svc_set_num_threads(serv, 0, 0);
585: nfsd_destroy_serv(net);
586: mutex_unlock(&nfsd_mutex);
587: }
SourceFile:fs/nfsd/nfssvc.c]
|
| 8/2 |
2026/05/24 09:06 |
llm |
expert |
0m
Model:
Tokens:
input: 12641
output: 52
thoughts: 52
Thoughts: Here's my thought process, as if I were analyzing this code:
**NFSd Shutdown and Netlink Listener Concerns**
Okay, so `nfsd_shutdown_threads` is holding the `nfsd_mutex`... that's a key observation. Now, I need to understand the implications of this locking behavior, especially during shutdown. I'm wondering if there are any potential conflicts or ordering issues. Let's dig into `fs/nfsd/nfsctl.c` and specifically examine `nfsd_nl_listener_set_doit`. I need to see how the Netlink listener interacts with the mutex and, by extension, the shutdown process. I'm looking for any possible contention or scenarios where the listener might block the shutdown, or vice-versa. Understanding their interactions will be critical to determine any potential problems.
|
| 9/2 |
2026/05/24 09:06 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:nfsd_nl_listener_set_doit]
Results: map[SourceCode:1920: /**
1921: * nfsd_nl_listener_set_doit - set the nfs running sockets
1922: * @skb: reply buffer
1923: * @info: netlink metadata and command arguments
1924: *
1925: * Return 0 on success or a negative errno.
1926: */
1927: int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info)
1928: {
1929: struct net *net = genl_info_net(info);
1930: struct svc_xprt *xprt, *tmp;
1931: const struct nlattr *attr;
1932: struct svc_serv *serv;
1933: LIST_HEAD(permsocks);
1934: struct nfsd_net *nn;
1935: bool delete = false;
1936: int err, rem;
1937:
1938: mutex_lock(&nfsd_mutex);
1939:
1940: err = nfsd_create_serv(net);
1941: if (err) {
1942: mutex_unlock(&nfsd_mutex);
1943: return err;
1944: }
1945:
1946: nn = net_generic(net, nfsd_net_id);
1947: serv = nn->nfsd_serv;
1948:
1949: spin_lock_bh(&serv->sv_lock);
1950:
1951: /* Move all of the old listener sockets to a temp list */
1952: list_splice_init(&serv->sv_permsocks, &permsocks);
1953:
1954: /*
1955: * Walk the list of server_socks from userland and move any that match
1956: * back to sv_permsocks
1957: */
1958: nlmsg_for_each_attr_type(attr, NFSD_A_SERVER_SOCK_ADDR, info->nlhdr,
1959: GENL_HDRLEN, rem) {
1960: struct nlattr *tb[NFSD_A_SOCK_MAX + 1];
1961: const char *xcl_name;
1962: struct sockaddr *sa;
1963:
1964: if (nla_parse_nested(tb, NFSD_A_SOCK_MAX, attr,
1965: nfsd_sock_nl_policy, info->extack) < 0)
1966: continue;
1967:
1968: if (!tb[NFSD_A_SOCK_ADDR] || !tb[NFSD_A_SOCK_TRANSPORT_NAME])
1969: continue;
1970:
1971: if (nla_len(tb[NFSD_A_SOCK_ADDR]) < sizeof(*sa))
1972: continue;
1973:
1974: xcl_name = nla_data(tb[NFSD_A_SOCK_TRANSPORT_NAME]);
1975: sa = nla_data(tb[NFSD_A_SOCK_ADDR]);
1976:
1977: /* Put back any matching sockets */
1978: list_for_each_entry_safe(xprt, tmp, &permsocks, xpt_list) {
1979: /* This shouldn't be possible */
1980: if (WARN_ON_ONCE(xprt->xpt_net != net)) {
1981: list_move(&xprt->xpt_list, &serv->sv_permsocks);
1982: continue;
1983: }
1984:
1985: /* If everything matches, put it back */
1986: if (!strcmp(xprt->xpt_class->xcl_name, xcl_name) &&
1987: rpc_cmp_addr_port(sa, (struct sockaddr *)&xprt->xpt_local)) {
1988: list_move(&xprt->xpt_list, &serv->sv_permsocks);
1989: break;
1990: }
1991: }
1992: }
1993:
1994: /*
1995: * If there are listener transports remaining on the permsocks list,
1996: * it means we were asked to remove a listener.
1997: */
1998: if (!list_empty(&permsocks)) {
1999: list_splice_init(&permsocks, &serv->sv_permsocks);
2000: delete = true;
2001: }
2002: spin_unlock_bh(&serv->sv_lock);
2003:
2004: /* Do not remove listeners while there are active threads. */
2005: if (serv->sv_nrthreads) {
2006: err = -EBUSY;
2007: goto out_unlock_mtx;
2008: }
2009:
2010: /*
2011: * Since we can't delete an arbitrary llist entry, destroy the
2012: * remaining listeners and recreate the list.
2013: */
2014: if (delete)
2015: svc_xprt_destroy_all(serv, net, false);
2016:
2017: /* walk list of addrs again, open any that still don't exist */
2018: nlmsg_for_each_attr_type(attr, NFSD_A_SERVER_SOCK_ADDR, info->nlhdr,
2019: GENL_HDRLEN, rem) {
2020: struct nlattr *tb[NFSD_A_SOCK_MAX + 1];
2021: const char *xcl_name;
2022: struct sockaddr *sa;
2023: int ret;
2024:
2025: if (nla_parse_nested(tb, NFSD_A_SOCK_MAX, attr,
2026: nfsd_sock_nl_policy, info->extack) < 0)
2027: continue;
2028:
2029: if (!tb[NFSD_A_SOCK_ADDR] || !tb[NFSD_A_SOCK_TRANSPORT_NAME])
2030: continue;
2031:
2032: if (nla_len(tb[NFSD_A_SOCK_ADDR]) < sizeof(*sa))
2033: continue;
2034:
2035: xcl_name = nla_data(tb[NFSD_A_SOCK_TRANSPORT_NAME]);
2036: sa = nla_data(tb[NFSD_A_SOCK_ADDR]);
2037:
2038: xprt = svc_find_listener(serv, xcl_name, net, sa);
2039: if (xprt) {
2040: if (delete)
2041: WARN_ONCE(1, "Transport type=%s already exists\n",
2042: xcl_name);
2043: svc_xprt_put(xprt);
2044: continue;
2045: }
2046:
2047: ret = svc_xprt_create_from_sa(serv, xcl_name, net, sa, 0,
2048: current_cred());
2049: /* always save the latest error */
2050: if (ret < 0)
2051: err = ret;
2052: }
2053:
2054: if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks))
2055: nfsd_destroy_serv(net);
2056:
2057: out_unlock_mtx:
2058: mutex_unlock(&nfsd_mutex);
2059:
2060: return err;
2061: }
SourceFile:fs/nfsd/nfsctl.c]
|
| 10/2 |
2026/05/24 09:06 |
llm |
expert |
0m
Model:
Tokens:
input: 15180
output: 52
thoughts: 408
Thoughts: **Analyzing a Potential NFSd Deadlock**
Okay, so I'm looking at this trace, and my initial thought is, "Wait, `nfsd_nl_listener_set_doit` is grabbing `nfsd_mutex` and then potentially calling either `svc_xprt_create_from_sa` or `svc_xprt_destroy_all`." I need to determine if there's a real deadlock here or if something is just hanging. I need to figure out where the hang is.
Okay, now I see that `nfsd_nl_listener_set_doit` is actually being called from `genl_rcv`, which is a key piece of information. That makes me think, "Could `nfsd_nl_listener_set_doit` itself be blocked somewhere within its execution path?" Time to revisit the lockdep trace.
Alright, the trace shows that process `syz.0.496/8229` is holding two locks: `cb_lock` and then `nfsd_mutex`. The report says that `cb_lock` is held at `genl_rcv`. This is important. But the question is where is it blocked?
It appears that `syz.0.496/8229` holds `nfsd_mutex`. The critical part, I need to see the stack trace for this process, but it's not present in this report. Damn.
But since `nfsd_nl_listener_set_doit` calls `svc_xprt_create_from_sa`, I'm guessing that might be the source of the potential block. Let's dig into `svc_xprt_create_from_sa` now and see if there's anything obvious there.
|
| 11/2 |
2026/05/24 09:06 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/sunrpc/svc_xprt.c IncludeLines:true Name:svc_xprt_create_from_sa]
Results: map[SourceCode: 289: /**
290: * svc_xprt_create_from_sa - Add a new listener to @serv from socket address
291: * @serv: target RPC service
292: * @xprt_name: transport class name
293: * @net: network namespace
294: * @sap: socket address pointer
295: * @flags: SVC_SOCK flags
296: * @cred: credential to bind to this transport
297: *
298: * Return local xprt port on success or %-EPROTONOSUPPORT on failure
299: */
300: int svc_xprt_create_from_sa(struct svc_serv *serv, const char *xprt_name,
301: struct net *net, struct sockaddr *sap,
302: int flags, const struct cred *cred)
303: {
304: size_t len;
305: int err;
306:
307: switch (sap->sa_family) {
308: case AF_INET:
309: len = sizeof(struct sockaddr_in);
310: break;
311: #if IS_ENABLED(CONFIG_IPV6)
312: case AF_INET6:
313: len = sizeof(struct sockaddr_in6);
314: break;
315: #endif
316: default:
317: return -EAFNOSUPPORT;
318: }
319:
320: err = _svc_xprt_create(serv, xprt_name, net, sap, len, flags, cred);
321: if (err == -EPROTONOSUPPORT) {
322: request_module("svc%s", xprt_name);
323: err = _svc_xprt_create(serv, xprt_name, net, sap, len, flags,
324: cred);
325: }
326:
327: return err;
328: }
SourceFile:net/sunrpc/svc_xprt.c]
|
| 12/2 |
2026/05/24 09:06 |
llm |
expert |
0m
Model:
Tokens:
input: 16660
output: 21
thoughts: 400
Thoughts: **Potential Deadlock and Arbitrary Module Loading in NFSd**
Okay, so I'm looking at this `request_module("svc%s", xprt_name)` call and immediately, a red flag goes up. If this is called while holding `nfsd_mutex` and `cb_lock`, it could potentially block. And the issue is `request_module` calls `call_usermodehelper`, which *itself* can block waiting for userspace. Now, if userspace is tied up with something else, or if loading that module triggers something that also wants either `nfsd_mutex` or `cb_lock`, we're staring down the barrel of a deadlock.
Wait a second, wasn't `request_module` called while `nfsd_mutex` is held? If the module initialization, *after* it loads, then tries to acquire `nfsd_mutex` again, that's a classic deadlock scenario. Also, it’s called with `cb_lock` already held (in `genl_rcv`)! If the module tries to register a genetlink family, it will absolutely need `cb_lock`. We need to verify which `svc%s` modules even attempt to register genetlink families.
And here's where it gets interesting: the `xcl_name` used for this is derived from user input via `svc_xprt_create_from_sa`! It's pulled directly from the Netlink attribute, `xcl_name = nla_data(tb[NFSD_A_SOCK_TRANSPORT_NAME]);`. That means `xcl_name` can be virtually anything. If the user specifies "rdma", it requests "svcrdma". If the transport name is anything else, it requests `svc<something>`.
So now, a major question: since `xcl_name` is user-controlled, could we potentially trigger the loading of arbitrary modules if they follow the `svc*` naming convention? Or are we only worried about blocking if the module loading sequence tries to acquire `cb_lock`? I really need to dig into the source of `request_module` in `kernel/kmod.c` to understand exactly what's happening. The potential for arbitrary module loading combined with a deadlock risk here is a serious issue.
|
| 13/2 |
2026/05/24 09:06 |
tool |
codesearch-find-references |
0m
Error:
Args:
Results: map[References:<nil> TruncatedOutput:false]
|
| 14/2 |
2026/05/24 09:06 |
llm |
expert |
0m
Model:
Tokens:
input: 17601
output: 39
thoughts: 13
Thoughts: Here's my take on those thoughts:
**Analyzing the `request_module` Component**
Okay, so I'm looking at this `request_module` thing, and my immediate thought is, "Is this a macro or a function?" I need to figure out its type right away because that drastically changes how I approach understanding it. The nuances of macro expansion versus function execution are critical to deciphering the underlying behavior. It's a fundamental distinction that informs everything else about its purpose and potential pitfalls. Getting this right is the cornerstone of understanding its impact.
|
| 15/2 |
2026/05/24 09:06 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:kernel/kmod.c IncludeLines:true Name:__request_module]
Results: map[SourceCode: 116: /**
117: * __request_module - try to load a kernel module
118: * @wait: wait (or not) for the operation to complete
119: * @fmt: printf style format string for the name of the module
120: * @...: arguments as specified in the format string
121: *
122: * Load a module using the user mode module loader. The function returns
123: * zero on success or a negative errno code or positive exit code from
124: * "modprobe" on failure. Note that a successful module load does not mean
125: * the module did not then unload and exit on an error of its own. Callers
126: * must check that the service they requested is now available not blindly
127: * invoke it.
128: *
129: * If module auto-loading support is disabled then this function
130: * simply returns -ENOENT.
131: */
132: int __request_module(bool wait, const char *fmt, ...)
133: {
134: va_list args;
135: char module_name[MODULE_NAME_LEN];
136: int ret, dup_ret;
137:
138: /*
139: * We don't allow synchronous module loading from async. Module
140: * init may invoke async_synchronize_full() which will end up
141: * waiting for this task which already is waiting for the module
142: * loading to complete, leading to a deadlock.
143: */
144: WARN_ON_ONCE(wait && current_is_async());
145:
146: if (!modprobe_path[0])
147: return -ENOENT;
148:
149: va_start(args, fmt);
150: ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
151: va_end(args);
152: if (ret >= MODULE_NAME_LEN)
153: return -ENAMETOOLONG;
154:
155: ret = security_kernel_module_request(module_name);
156: if (ret)
157: return ret;
158:
159: ret = down_timeout(&kmod_concurrent_max, MAX_KMOD_ALL_BUSY_TIMEOUT * HZ);
160: if (ret) {
161: pr_warn_ratelimited("request_module: modprobe %s cannot be processed, kmod busy with %d threads for more than %d seconds now",
162: module_name, MAX_KMOD_CONCURRENT, MAX_KMOD_ALL_BUSY_TIMEOUT);
163: return ret;
164: }
165:
166: trace_module_request(module_name, wait, _RET_IP_);
167:
168: if (kmod_dup_request_exists_wait(module_name, wait, &dup_ret)) {
169: ret = dup_ret;
170: goto out;
171: }
172:
173: ret = call_modprobe(module_name, wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC);
174:
175: out:
176: up(&kmod_concurrent_max);
177:
178: return ret;
179: }
SourceFile:kernel/module/kmod.c]
|
| 16/2 |
2026/05/24 09:06 |
llm |
expert |
0m
Model:
Tokens:
input: 18788
output: 44
thoughts: 27
Thoughts: Here's a summary of my thought process, as if I were analyzing that code snippet:
**Diving into the `genl_rcv` Function and its Concurrency Implications**
Okay, the first thing that jumps out at me is that `genl_rcv` is holding `cb_lock`. That's a critical piece of information. I need to understand the implications of that lock being held during the execution of this function. Let's dig into the details of `genl_rcv`. I need to recall what it does, the context of its calls, and more importantly, where that lock comes into play and how long it's held. This is the starting point for understanding potential concurrency issues or bottlenecks. I'll need to trace the lock acquisition and release points and figure out which other parts of the code might be contending for it. Is this a read-write lock, or a mutex? How critical is the section protected by `cb_lock`? Knowing these details will help me evaluate whether we have a performance problem, or perhaps, a potential deadlock.
|
| 17/2 |
2026/05/24 09:06 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/netlink/genetlink.c IncludeLines:true Name:genl_rcv]
Results: map[SourceCode:1215: static void genl_rcv(struct sk_buff *skb)
1216: {
1217: down_read(&cb_lock);
1218: netlink_rcv_skb(skb, &genl_rcv_msg);
1219: up_read(&cb_lock);
1220: }
SourceFile:net/netlink/genetlink.c]
|
| 18/2 |
2026/05/24 09:06 |
llm |
expert |
0m
Model:
Tokens:
input: 19216
output: 20
thoughts: 486
Thoughts: **Deadlock! A Deep Dive into Genetlink and Module Loading**
Okay, so I'm dealing with a nasty potential deadlock situation here. I've got this `cb_lock`, which is an rwsem, and I'm currently holding a read lock (`down_read(&cb_lock)`). The problem is, if `request_module` gets called while I have the read lock, it spawns `modprobe`, which is basically a user-mode helper, to load the requested module.
Here's where it gets dicey: if the module `modprobe` is trying to load registers a genetlink family, it will inevitably call `genl_register_family`. And guess what? `genl_register_family` calls `down_write(&cb_lock)`. Uh oh. `modprobe` is now blocked waiting for the write lock on `cb_lock`.
But here's the kicker: `genl_rcv`, which I'm assuming is the genetlink receive function, is waiting for `request_module` to finish. By default, `request_module` *does* wait for the module loading to complete (because `wait` is true by default). So, `genl_rcv` (which is holding the read lock on `cb_lock`) is waiting for `request_module`, and `request_module` is blocked waiting for `modprobe`. `modprobe` is blocked waiting for `cb_lock`. Deadlock! Classic circular dependency.
So, the critical path is: `request_module` -> `modprobe` -> module's `init` -> `genl_register_family` -> `down_write(&cb_lock)`. And since I'm holding a read lock, `genl_register_family` blocks on `cb_lock`. The thread calling `request_module` blocks waiting for modprobe to finish. Deadlock confirmed!
Now, how can I trigger this? Let me think... Could I simply request a module starting with "svc" that registers a genetlink family? Or perhaps just request a non-existent module? Nope, that wouldn't work. If the module doesn't exist, `modprobe` will fail and return quickly, and there's no deadlock. But if it *does* exist? What if it's designed to trigger this behavior?
The user controls the `xcl_name`. The module requested is `"svc%s", xcl_name`. Can I exploit that somehow to make it load an arbitrary module that registers a genetlink family? If `xcl_name` is `../something`, it might lead to `svc../something`. But module names usually don't have `/`. The question then is, is there any module that aliases to `svc*` and registers a genetlink family? I need to search for something like `MODULE_ALIAS("svc*")` to find out. I'm going to have to check if there are any modules that alias to something like `svc*` and register a genetlink family. That's the real weak point here. I need to know where I can manipulate the behavior of `request_module` to load a module that I know will cause this `down_write` to block.
|
| 19/2 |
2026/05/24 09:06 |
tool |
grepper |
0m
Args: map[Expression:MODULE_ALIAS\("svc]
Results: map[Output:net/sunrpc/xprtrdma/module.c=25=MODULE_LICENSE("Dual BSD/GPL");
net/sunrpc/xprtrdma/module.c:26:MODULE_ALIAS("svcrdma");
net/sunrpc/xprtrdma/module.c-27-MODULE_ALIAS("xprtrdma");
]
|
| 20/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 20517
output: 26
thoughts: 44
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience:
**Investigating the `svcrdma`/`rpcrdma`/`xprtrdma` Module Relationships**
Right, so `svcrdma`… that's really just an alias, or a more user-friendly name, for `rpcrdma` – or is it `xprtrdma`? I need to clarify that connection. The naming conventions have always been slightly inconsistent in this area. My immediate concern is whether or not the underlying module, probably `xprtrdma` in this context, actually registers a genetlink family. That's crucial for any interaction with user space tools and management. Gotta confirm if we can interact with it via the standard netlink mechanisms, or if we need to fall back on another method. I really need to verify if the module sets up the necessary infrastructure for control and monitoring. Time to dive into the kernel code and check those registration calls… gotta ensure proper namespace management.
|
| 21/2 |
2026/05/24 09:07 |
tool |
grepper |
0m
Error:
Args: map[Expression:genl_register_family.*xprtrdma]
Results:
|
| 22/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 20814
output: 20
thoughts: 35
Thoughts: Okay, here's my interpretation of those thoughts, framed as my own, given my expertise:
**Checking Genetlink Family Registration in `xprtrdma`**
Alright, I need to get to the bottom of this. My immediate question is: does the `xprtrdma` module itself take responsibility for registering *any* Genetlink family? Or, is it relying on another module to handle that crucial registration, perhaps a dependency it pulls in? I need to analyze its structure and dependencies to be certain. Knowing this is fundamental to understanding its interaction within the Genetlink framework, and ultimately, its functionality. I'll need to dig into the code and quickly confirm the registration point.
|
| 23/2 |
2026/05/24 09:07 |
tool |
grepper |
0m
Args: map[Expression:genl_register_family]
Results: map[Output:drivers/acpi/event.c=148=static int __init acpi_event_genetlink_init(void)
drivers/acpi/event.c-149-{
drivers/acpi/event.c:150: return genl_register_family(&acpi_event_genl_family);
drivers/acpi/event.c-151-}
--
drivers/android/binder.c=7091=static int __init binder_init(void)
--
drivers/android/binder.c-7138-
drivers/android/binder.c:7139: ret = genl_register_family(&binder_nl_family);
drivers/android/binder.c-7140- if (ret)
--
drivers/block/nbd.c=2643=static int __init nbd_init(void)
--
drivers/block/nbd.c-2683-
drivers/block/nbd.c:2684: if (genl_register_family(&nbd_genl_family)) {
drivers/block/nbd.c-2685- destroy_workqueue(nbd_del_wq);
--
drivers/dpll/dpll_core.c=1132=static int __init dpll_init(void)
--
drivers/dpll/dpll_core.c-1135-
drivers/dpll/dpll_core.c:1136: ret = genl_register_family(&dpll_nl_family);
drivers/dpll/dpll_core.c-1137- if (ret)
--
drivers/gpu/drm/drm_ras_genl_family.c=17=int drm_ras_genl_family_register(void)
--
drivers/gpu/drm/drm_ras_genl_family.c-22-
drivers/gpu/drm/drm_ras_genl_family.c:23: ret = genl_register_family(&drm_ras_nl_family);
drivers/gpu/drm/drm_ras_genl_family.c-24- if (ret)
--
drivers/net/gtp.c=2500=static int __init gtp_init(void)
--
drivers/net/gtp.c-2513-
drivers/net/gtp.c:2514: err = genl_register_family(>p_genl_family);
drivers/net/gtp.c-2515- if (err < 0)
--
drivers/net/ieee802154/mac802154_hwsim.c=1056=static __init int hwsim_init_module(void)
--
drivers/net/ieee802154/mac802154_hwsim.c-1059-
drivers/net/ieee802154/mac802154_hwsim.c:1060: rc = genl_register_family(&hwsim_genl_family);
drivers/net/ieee802154/mac802154_hwsim.c-1061- if (rc)
--
drivers/net/macsec.c=4510=static int __init macsec_init(void)
--
drivers/net/macsec.c-4526-
drivers/net/macsec.c:4527: err = genl_register_family(&macsec_fam);
drivers/net/macsec.c-4528- if (err)
--
drivers/net/ovpn/netlink.c=1367=int __init ovpn_nl_register(void)
drivers/net/ovpn/netlink.c-1368-{
drivers/net/ovpn/netlink.c:1369: int ret = genl_register_family(&ovpn_nl_family);
drivers/net/ovpn/netlink.c-1370-
drivers/net/ovpn/netlink.c-1371- if (ret) {
drivers/net/ovpn/netlink.c:1372: pr_err("ovpn: genl_register_family failed: %d\n", ret);
drivers/net/ovpn/netlink.c-1373- return ret;
--
drivers/net/team/team_core.c=3030=static int __init team_nl_init(void)
drivers/net/team/team_core.c-3031-{
drivers/net/team/team_core.c:3032: return genl_register_family(&team_nl_family);
drivers/net/team/team_core.c-3033-}
--
drivers/net/wireguard/netlink.c=596=int __init wg_genetlink_init(void)
--
drivers/net/wireguard/netlink.c-600-
drivers/net/wireguard/netlink.c:601: return genl_register_family(&genl_family);
drivers/net/wireguard/netlink.c-602-}
--
drivers/net/wireless/virtual/mac80211_hwsim.c=6978=static int __init hwsim_init_netlink(void)
--
drivers/net/wireless/virtual/mac80211_hwsim.c-6983-
drivers/net/wireless/virtual/mac80211_hwsim.c:6984: rc = genl_register_family(&hwsim_genl_family);
drivers/net/wireless/virtual/mac80211_hwsim.c-6985- if (rc)
--
drivers/regulator/event.c=74=static int __init reg_event_genetlink_init(void)
drivers/regulator/event.c-75-{
drivers/regulator/event.c:76: return genl_register_family(®_event_genl_family);
drivers/regulator/event.c-77-}
--
drivers/scsi/pmcraid.c=1358=static int __init pmcraid_netlink_init(void)
--
drivers/scsi/pmcraid.c-1361-
drivers/scsi/pmcraid.c:1362: result = genl_register_family(&pmcraid_event_family);
drivers/scsi/pmcraid.c-1363-
--
drivers/target/target_core_user.c=3321=static int __init tcmu_module_init(void)
--
drivers/target/target_core_user.c-3341-
drivers/target/target_core_user.c:3342: ret = genl_register_family(&tcmu_genl_family);
drivers/target/target_core_user.c-3343- if (ret < 0) {
--
drivers/thermal/thermal_netlink.c=929=int __init thermal_netlink_init(void)
drivers/thermal/thermal_netlink.c-930-{
drivers/thermal/thermal_netlink.c:931: return genl_register_family(&thermal_genl_family);
drivers/thermal/thermal_netlink.c-932-}
--
drivers/vdpa/vdpa.c=1558=static int vdpa_init(void)
--
drivers/vdpa/vdpa.c-1564- return err;
drivers/vdpa/vdpa.c:1565: err = genl_register_family(&vdpa_nl_family);
drivers/vdpa/vdpa.c-1566- if (err)
--
fs/lockd/svc.c=592=static int __init init_nlm(void)
--
fs/lockd/svc.c-605-
fs/lockd/svc.c:606: err = genl_register_family(&lockd_nl_family);
fs/lockd/svc.c-607- if (err)
--
fs/nfsd/nfsctl.c=2297=static int __init init_nfsd(void)
--
fs/nfsd/nfsctl.c-2327- goto out_free_nfsd4;
fs/nfsd/nfsctl.c:2328: retval = genl_register_family(&nfsd_nl_family);
fs/nfsd/nfsctl.c-2329- if (retval)
--
fs/quota/netlink.c=96=static int __init quota_init(void)
fs/quota/netlink.c-97-{
fs/quota/netlink.c:98: if (genl_register_family("a_genl_family) != 0)
fs/quota/netlink.c-99- printk(KERN_ERR
--
fs/smb/client/netlink.c=64=int cifs_genl_init(void)
--
fs/smb/client/netlink.c-67-
fs/smb/client/netlink.c:68: ret = genl_register_family(&cifs_genl_family);
fs/smb/client/netlink.c-69- if (ret < 0) {
--
fs/smb/server/transport_ipc.c=990=int ksmbd_ipc_init(void)
--
fs/smb/server/transport_ipc.c-996-
fs/smb/server/transport_ipc.c:997: ret = genl_register_family(&ksmbd_genl_family);
fs/smb/server/transport_ipc.c-998- if (ret) {
--
include/linux/drbd_genl.h-70- * and static register/unregister functions to
include/linux/drbd_genl.h:71: * genl_register_family().
include/linux/drbd_genl.h-72- *
--
include/linux/genl_magic_func.h=308=int CONCATENATE(GENL_MAGIC_FAMILY, _genl_register)(void)
include/linux/genl_magic_func.h-309-{
include/linux/genl_magic_func.h:310: return genl_register_family(&ZZZ_genl_family);
include/linux/genl_magic_func.h-311-}
--
include/net/genetlink.h=330=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk);
include/net/genetlink.h:331:int genl_register_family(struct genl_family *family);
include/net/genetlink.h-332-int genl_unregister_family(const struct genl_family *family);
--
kernel/power/em_netlink.c=373=static int __init em_netlink_init(void)
kernel/power/em_netlink.c-374-{
kernel/power/em_netlink.c:375: return genl_register_family(&dev_energymodel_nl_family);
kernel/power/em_netlink.c-376-}
--
kernel/taskstats.c=701=static int __init taskstats_init(void)
--
kernel/taskstats.c-704-
kernel/taskstats.c:705: rc = genl_register_family(&family);
kernel/taskstats.c-706- if (rc)
--
net/batman-adv/netlink.c=1544=void __init batadv_netlink_register(void)
--
net/batman-adv/netlink.c-1547-
net/batman-adv/netlink.c:1548: ret = genl_register_family(&batadv_netlink_family);
net/batman-adv/netlink.c-1549- if (ret)
--
net/core/drop_monitor.c=1725=static int __init init_net_drop_monitor(void)
--
net/core/drop_monitor.c-1746-
net/core/drop_monitor.c:1747: rc = genl_register_family(&net_drop_monitor_family);
net/core/drop_monitor.c-1748- if (rc) {
--
net/core/netdev-genl.c=1427=static int __init netdev_genl_init(void)
--
net/core/netdev-genl.c-1434-
net/core/netdev-genl.c:1435: err = genl_register_family(&netdev_nl_family);
net/core/netdev-genl.c-1436- if (err)
--
net/devlink/core.c=577=static int __init devlink_init(void)
--
net/devlink/core.c-583- goto out;
net/devlink/core.c:584: err = genl_register_family(&devlink_nl_family);
net/devlink/core.c-585- if (err)
--
net/ethtool/netlink.c=1571=static int __init ethnl_init(void)
--
net/ethtool/netlink.c-1574-
net/ethtool/netlink.c:1575: ret = genl_register_family(ðtool_genl_family);
net/ethtool/netlink.c-1576- if (WARN(ret < 0, "ethtool: genetlink family registration failed"))
--
net/handshake/netlink.c=244=static int __init handshake_init(void)
--
net/handshake/netlink.c-253-
net/handshake/netlink.c:254: ret = genl_register_family(&handshake_nl_family);
net/handshake/netlink.c-255- if (ret) {
--
net/hsr/hsr_netlink.c=566=int __init hsr_netlink_init(void)
--
net/hsr/hsr_netlink.c-573-
net/hsr/hsr_netlink.c:574: rc = genl_register_family(&hsr_genl_family);
net/hsr/hsr_netlink.c-575- if (rc)
net/hsr/hsr_netlink.c:576: goto fail_genl_register_family;
net/hsr/hsr_netlink.c-577-
--
net/hsr/hsr_netlink.c-580-
net/hsr/hsr_netlink.c:581:fail_genl_register_family:
net/hsr/hsr_netlink.c-582- rtnl_link_unregister(&hsr_link_ops);
--
net/ieee802154/netlink.c=140=int __init ieee802154_nl_init(void)
net/ieee802154/netlink.c-141-{
net/ieee802154/netlink.c:142: return genl_register_family(&nl802154_family);
net/ieee802154/netlink.c-143-}
--
net/ieee802154/nl802154.c=3100=int __init nl802154_init(void)
net/ieee802154/nl802154.c-3101-{
net/ieee802154/nl802154.c:3102: return genl_register_family(&nl802154_fam);
net/ieee802154/nl802154.c-3103-}
--
net/ipv4/fou_core.c=1244=static int __init fou_init(void)
--
net/ipv4/fou_core.c-1251-
net/ipv4/fou_core.c:1252: ret = genl_register_family(&fou_nl_family);
net/ipv4/fou_core.c-1253- if (ret < 0)
--
net/ipv4/tcp_metrics.c=1046=void __init tcp_metrics_init(void)
--
net/ipv4/tcp_metrics.c-1055-
net/ipv4/tcp_metrics.c:1056: ret = genl_register_family(&tcp_metrics_nl_family);
net/ipv4/tcp_metrics.c-1057- if (ret < 0)
--
net/ipv6/ila/ila_main.c=92=static int __init ila_init(void)
--
net/ipv6/ila/ila_main.c-99-
net/ipv6/ila/ila_main.c:100: ret = genl_register_family(&ila_nl_family);
net/ipv6/ila/ila_main.c-101- if (ret)
--
net/ipv6/ioam6.c=1027=int __init ioam6_init(void)
--
net/ipv6/ioam6.c-1032-
net/ipv6/ioam6.c:1033: err = genl_register_family(&ioam6_genl_family);
net/ipv6/ioam6.c-1034- if (err)
--
net/ipv6/seg6.c=505=int __init seg6_init(void)
--
net/ipv6/seg6.c-512-
net/ipv6/seg6.c:513: err = genl_register_family(&seg6_genl_family);
net/ipv6/seg6.c-514- if (err)
--
net/l2tp/l2tp_netlink.c=1042=static int __init l2tp_nl_init(void)
--
net/l2tp/l2tp_netlink.c-1044- pr_info("L2TP netlink interface\n");
net/l2tp/l2tp_netlink.c:1045: return genl_register_family(&l2tp_nl_family);
net/l2tp/l2tp_netlink.c-1046-}
--
net/mptcp/pm_netlink.c=642=void __init mptcp_pm_nl_init(void)
net/mptcp/pm_netlink.c-643-{
net/mptcp/pm_netlink.c:644: if (genl_register_family(&mptcp_genl_family))
net/mptcp/pm_netlink.c-645- panic("Failed to register MPTCP PM netlink family\n");
--
net/ncsi/ncsi-netlink.c=774=static int __init ncsi_init_netlink(void)
net/ncsi/ncsi-netlink.c-775-{
net/ncsi/ncsi-netlink.c:776: return genl_register_family(&ncsi_genl_family);
net/ncsi/ncsi-netlink.c-777-}
--
net/netfilter/ipvs/ip_vs_ctl.c=4875=static int __init ip_vs_genl_register(void)
net/netfilter/ipvs/ip_vs_ctl.c-4876-{
net/netfilter/ipvs/ip_vs_ctl.c:4877: return genl_register_family(&ip_vs_genl_family);
net/netfilter/ipvs/ip_vs_ctl.c-4878-}
--
net/netlabel/netlabel_calipso.c=386=int __init netlbl_calipso_genl_init(void)
net/netlabel/netlabel_calipso.c-387-{
net/netlabel/netlabel_calipso.c:388: return genl_register_family(&netlbl_calipso_gnl_family);
net/netlabel/netlabel_calipso.c-389-}
--
net/netlabel/netlabel_cipso_v4.c=785=int __init netlbl_cipsov4_genl_init(void)
net/netlabel/netlabel_cipso_v4.c-786-{
net/netlabel/netlabel_cipso_v4.c:787: return genl_register_family(&netlbl_cipsov4_gnl_family);
net/netlabel/netlabel_cipso_v4.c-788-}
--
net/netlabel/netlabel_mgmt.c=839=int __init netlbl_mgmt_genl_init(void)
net/netlabel/netlabel_mgmt.c-840-{
net/netlabel/netlabel_mgmt.c:841: return genl_register_family(&netlbl_mgmt_gnl_family);
net/netlabel/netlabel_mgmt.c-842-}
--
net/netlabel/netlabel_unlabeled.c=1384=int __init netlbl_unlabel_genl_init(void)
net/netlabel/netlabel_unlabeled.c-1385-{
net/netlabel/netlabel_unlabeled.c:1386: return genl_register_family(&netlbl_unlabel_gnl_family);
net/netlabel/netlabel_unlabeled.c-1387-}
--
net/netlink/genetlink.c=737=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk)
--
net/netlink/genetlink.c-763-/**
net/netlink/genetlink.c:764: * genl_register_family - register a generic netlink family
net/netlink/genetlink.c-765- * @family: generic netlink family
--
net/netlink/genetlink.c-774- */
net/netlink/genetlink.c:775:int genl_register_family(struct genl_family *family)
net/netlink/genetlink.c-776-{
--
net/netlink/genetlink.c-839-}
net/netlink/genetlink.c:840:EXPORT_SYMBOL(genl_register_family);
net/netlink/genetlink.c-841-
--
net/netlink/genetlink.c=1910=static int __init genl_init(void)
--
net/netlink/genetlink.c-1913-
net/netlink/genetlink.c:1914: err = genl_register_family(&genl_ctrl);
net/netlink/genetlink.c-1915- if (err < 0)
--
net/nfc/netlink.c=1909=int __init nfc_genl_init(void)
--
net/nfc/netlink.c-1912-
net/nfc/netlink.c:1913: rc = genl_register_family(&nfc_genl_family);
net/nfc/netlink.c-1914- if (rc)
--
net/openvswitch/datapath.c=2672=static int __init dp_register_genl(void)
--
net/openvswitch/datapath.c-2678-
net/openvswitch/datapath.c:2679: err = genl_register_family(dp_genl_families[i]);
net/openvswitch/datapath.c-2680- if (err)
--
net/psample/psample.c=518=static int __init psample_module_init(void)
net/psample/psample.c-519-{
net/psample/psample.c:520: return genl_register_family(&psample_nl_family);
net/psample/psample.c-521-}
--
net/psp/psp_main.c=373=static int __init psp_init(void)
--
net/psp/psp_main.c-376-
net/psp/psp_main.c:377: return genl_register_family(&psp_nl_family);
net/psp/psp_main.c-378-}
--
net/shaper/shaper.c=1529=static int __init shaper_init(void)
net/shaper/shaper.c-1530-{
net/shaper/shaper.c:1531: return genl_register_family(&net_shaper_nl_family);
net/shaper/shaper.c-1532-}
--
net/smc/smc_netlink.c=149=int __init smc_nl_init(void)
net/smc/smc_netlink.c-150-{
net/smc/smc_netlink.c:151: return genl_register_family(&smc_gen_nl_family);
net/smc/smc_netlink.c-152-}
--
net/smc/smc_pnet.c=893=int __init smc_pnet_init(void)
--
net/smc/smc_pnet.c-896-
net/smc/smc_pnet.c:897: rc = genl_register_family(&smc_pnet_nl_family);
net/smc/smc_pnet.c-898- if (rc)
--
net/tipc/netlink.c=300=int __init tipc_netlink_start(void)
--
net/tipc/netlink.c-303-
net/tipc/netlink.c:304: res = genl_register_family(&tipc_genl_family);
net/tipc/netlink.c-305- if (res) {
--
net/tipc/netlink_compat.c=1357=int __init tipc_netlink_compat_start(void)
--
net/tipc/netlink_compat.c-1360-
net/tipc/netlink_compat.c:1361: res = genl_register_family(&tipc_genl_compat_family);
net/tipc/netlink_compat.c-1362- if (res) {
--
net/wireless/nl80211.c=23018=int __init nl80211_init(void)
--
net/wireless/nl80211.c-23021-
net/wireless/nl80211.c:23022: err = genl_register_family(&nl80211_fam);
net/wireless/nl80211.c-23023- if (err)
--
tools/lib/thermal/commands.c=490=thermal_error_t thermal_cmd_init(struct thermal_handler *th)
--
tools/lib/thermal/commands.c-497-
tools/lib/thermal/commands.c:498: ret = genl_register_family(&thermal_cmd_ops);
tools/lib/thermal/commands.c-499- if (ret)
]
|
| 24/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 28076
output: 23
thoughts: 275
Thoughts: **My Line of Reasoning**
Okay, so I'm thinking about how this `xcl_name` variable works. It's user-controlled, that's the key. If the user sets `xcl_name` to something like "rdma," then we're going to try to load the module `svcrdma`, which is actually an alias for `rpcrdma`. Now, does `rpcrdma` even register a genetlink family? Let me check... Hmm, doesn't look like it.
But hold on, what if the user sets `xcl_name` to something *else*? The module request is formed as `svc%s`. Can they inject something malicious there, perhaps? Could the user set `xcl_name` to something like `../net/ipv4/tcp_metrics`? Let me see... no, the `request_module` call uses `vsnprintf` to build the module name, so it'll be `svc../net/ipv4/tcp_metrics`. That path traversal attempt will be blocked.
Alright, so the module name will *always* begin with `svc`. The question now becomes: is there *any* module that starts with "svc" that *does* register a genetlink family? If so, that could be a potential attack vector. I need to make sure there are no modules that would cause an issue if imported in that way.
What if the user gives `xcl_name` as `...`? Let me make sure that isn't able to cause a problem.
Okay, I need to check for any module aliases that match `svc*` and also register a genetlink family, to make sure there are no modules matching that pattern. Let me search the code again for anything like `MODULE_ALIAS("svc*")`.
|
| 25/2 |
2026/05/24 09:07 |
tool |
grepper |
0m
Args: map[Expression:MODULE_ALIAS\("svc.*"\)]
Results: map[Output:net/sunrpc/xprtrdma/module.c=25=MODULE_LICENSE("Dual BSD/GPL");
net/sunrpc/xprtrdma/module.c:26:MODULE_ALIAS("svcrdma");
net/sunrpc/xprtrdma/module.c-27-MODULE_ALIAS("xprtrdma");
]
|
| 26/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 28859
output: 47
thoughts: 1112
Thoughts: **Analyzing a Kernel Hang in `request_module`**
Okay, so I'm thinking about this kernel hang, specifically how `request_module` might be involved. My initial thought was that only `svcrdma` is an alias, but maybe if the user-supplied `xcl_name` triggers a bad `request_module` call, where it loads a non-existent module, that's what's triggering the issue. I know `request_module` calls `call_modprobe`. If `modprobe` is invoked, it could load other modules or simply fail. If it fails, `request_module` should return, right? But what if `xcl_name` is just a garbage string? Then, `request_module` runs `modprobe svc<xcl_name>`. Does `modprobe` do anything locking-related? No, it's userspace. It will read `modules.dep`, fail to load the module, and exit.
So, why would it hang? Let me revisit the lockdep output... Aha, it shows a task holding `cb_lock` and `nfsd_mutex`. The task isn't marked as blocked *in the lockdep output* but it holds these locks. If it's holding these locks and *another task* is blocked on `nfsd_mutex`, that's a problem. Why isn't `syz.0.496/8229` releasing `nfsd_mutex`? What's it blocked on?
Let's focus on `request_module`. Does it block indefinitely? If `modprobe` is invoked, it runs in userspace. If the userspace process is blocked, then `request_module` will also block. Why would `modprobe` block? Perhaps it tries to write to a file or do something that requires a lock held by another process. Maybe the Syzkaller environment has a bad `modprobe` or a blocked `modprobe`. Wait, `request_module` is called with `UMH_WAIT_PROC`, which means it will block if `modprobe` blocks.
Is this known? Can `request_module` block if userspace is malicious or hung? Yeah, it's known, but it's *usually* not a bug *unless* it's holding a global lock like `nfsd_mutex` or `cb_lock`. That's the key. Wait, looking at the lock output, `genl_rcv` holds `cb_lock` (which is a global rwsem for genetlink) and `nfsd_nl_listener_set_doit` holds `nfsd_mutex` (which is a global mutex for NFSd). If `request_module` is called *while* holding these locks, it's a bug! It allows an unprivileged user to block those global locks indefinitely if they can stall `modprobe` (by using a FUSE filesystem for `/sbin/modprobe`, by ptrace-ing it, or maybe `modprobe` is just slow).
Can an unprivileged user even reach `nfsd_nl_listener_set_doit`? Let me check the genetlink policy for `nfsd_nl_family`.
|
| 27/2 |
2026/05/24 09:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:nfsd_nl_family]
Results: map[SourceCode: 108: struct genl_family nfsd_nl_family __ro_after_init = {
109: .name = NFSD_FAMILY_NAME,
110: .version = NFSD_FAMILY_VERSION,
111: .netnsok = true,
112: .parallel_ops = true,
113: .module = THIS_MODULE,
114: .split_ops = nfsd_nl_ops,
115: .n_split_ops = ARRAY_SIZE(nfsd_nl_ops),
116: };
SourceFile:fs/nfsd/netlink.c]
|
| 28/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 30914
output: 46
thoughts: 13
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience and written in the first person:
**Diving into `nfsd_nl_ops`**
Okay, time to dig into this. Let's see... the code's got me thinking about network file system daemon netlink operations. Specifically, I'm wanting to refresh my memory and pinpoint this area. Let's start by drilling into that `nfsd_nl_ops` structure. I need to understand how it's defined and used within the kernel's NFS subsystem. I'm imagining it holds the function pointers that handle the netlink interactions for the NFS server. Knowing the functions here will help me understand the flow, the available commands, and the relevant data structures. What's it looking like? Let's trace it and get a sense of the architecture.
|
| 29/2 |
2026/05/24 09:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/netlink.c IncludeLines:true Name:nfsd_nl_ops]
Results: map[SourceCode: 51: /* Ops table for nfsd */
52: static const struct genl_split_ops nfsd_nl_ops[] = {
53: {
54: .cmd = NFSD_CMD_RPC_STATUS_GET,
55: .dumpit = nfsd_nl_rpc_status_get_dumpit,
56: .flags = GENL_CMD_CAP_DUMP,
57: },
58: {
59: .cmd = NFSD_CMD_THREADS_SET,
60: .doit = nfsd_nl_threads_set_doit,
61: .policy = nfsd_threads_set_nl_policy,
62: .maxattr = NFSD_A_SERVER_FH_KEY,
63: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
64: },
65: {
66: .cmd = NFSD_CMD_THREADS_GET,
67: .doit = nfsd_nl_threads_get_doit,
68: .flags = GENL_CMD_CAP_DO,
69: },
70: {
71: .cmd = NFSD_CMD_VERSION_SET,
72: .doit = nfsd_nl_version_set_doit,
73: .policy = nfsd_version_set_nl_policy,
74: .maxattr = NFSD_A_SERVER_PROTO_VERSION,
75: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
76: },
77: {
78: .cmd = NFSD_CMD_VERSION_GET,
79: .doit = nfsd_nl_version_get_doit,
80: .flags = GENL_CMD_CAP_DO,
81: },
82: {
83: .cmd = NFSD_CMD_LISTENER_SET,
84: .doit = nfsd_nl_listener_set_doit,
85: .policy = nfsd_listener_set_nl_policy,
86: .maxattr = NFSD_A_SERVER_SOCK_ADDR,
87: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
88: },
89: {
90: .cmd = NFSD_CMD_LISTENER_GET,
91: .doit = nfsd_nl_listener_get_doit,
92: .flags = GENL_CMD_CAP_DO,
93: },
94: {
95: .cmd = NFSD_CMD_POOL_MODE_SET,
96: .doit = nfsd_nl_pool_mode_set_doit,
97: .policy = nfsd_pool_mode_set_nl_policy,
98: .maxattr = NFSD_A_POOL_MODE_MODE,
99: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
100: },
101: {
102: .cmd = NFSD_CMD_POOL_MODE_GET,
103: .doit = nfsd_nl_pool_mode_get_doit,
104: .flags = GENL_CMD_CAP_DO,
105: },
106: };
SourceFile:fs/nfsd/netlink.c]
|
| 30/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 32151
output: 51
thoughts: 171
Thoughts: **Analyzing NFSD_CMD_LISTENER_SET Capability Requirements**
Okay, let's break this down. My initial thought is that `NFSD_CMD_LISTENER_SET` is flagged with `GENL_ADMIN_PERM`. This immediately tells me we're looking at a capability requirement of `CAP_NET_ADMIN`. Standard procedure. However, the wrinkle here is the `nfsd_nl_family` family's `.netnsok = true` attribute. This is the key. Since it's network namespace aware, this command might be callable from within a user namespace! That's interesting and significantly broadens the potential attack surface if misconfigured.
The critical question now is whether `GENL_ADMIN_PERM`, when applied to a `netnsok` family, actually enforces the `CAP_NET_ADMIN` check *within* the user namespace. We have to confirm that `genl_family` handles it correctly.
Alright, checking the code confirms it. Yes, for `genl_family` with `netnsok = true`, `GENL_ADMIN_PERM` appropriately uses `netlink_net_capable(skb, CAP_NET_ADMIN)`. This is good, it means the check is happening within the relevant namespace. So, it *is* allowed in a network namespace if CAP_NET_ADMIN is present.
|
| 31/2 |
2026/05/24 09:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/netlink/genetlink.c IncludeLines:true Name:genl_family_rcv_msg_doit]
Results: map[SourceCode:1081: static int genl_family_rcv_msg_doit(const struct genl_family *family,
1082: struct sk_buff *skb,
1083: struct nlmsghdr *nlh,
1084: struct netlink_ext_ack *extack,
1085: const struct genl_split_ops *ops,
1086: int hdrlen, struct net *net)
1087: {
1088: struct nlattr **attrbuf;
1089: struct genl_info info;
1090: int err;
1091:
1092: attrbuf = genl_family_rcv_msg_attrs_parse(family, nlh, extack,
1093: ops, hdrlen,
1094: GENL_DONT_VALIDATE_STRICT);
1095: if (IS_ERR(attrbuf))
1096: return PTR_ERR(attrbuf);
1097:
1098: info.snd_seq = nlh->nlmsg_seq;
1099: info.snd_portid = NETLINK_CB(skb).portid;
1100: info.family = family;
1101: info.nlhdr = nlh;
1102: info.genlhdr = nlmsg_data(nlh);
1103: info.attrs = attrbuf;
1104: info.extack = extack;
1105: genl_info_net_set(&info, net);
1106: memset(&info.ctx, 0, sizeof(info.ctx));
1107:
1108: if (ops->pre_doit) {
1109: err = ops->pre_doit(ops, skb, &info);
1110: if (err)
1111: goto out;
1112: }
1113:
1114: err = ops->doit(skb, &info);
1115:
1116: if (ops->post_doit)
1117: ops->post_doit(ops, skb, &info);
1118:
1119: out:
1120: genl_family_rcv_msg_attrs_free(attrbuf);
1121:
1122: return err;
1123: }
SourceFile:net/netlink/genetlink.c]
|
| 32/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 33354
output: 48
thoughts: 15
Thoughts: Okay, let's see. My mind's buzzing... I need to figure this out.
**Investigating the `GENL_ADMIN_PERM` Check**
Alright, hang on. I'm focusing on this `GENL_ADMIN_PERM` thing. I remember seeing that somewhere, but my mind is blanking. Where exactly did I see that check in the codebase? I need to track down all the instances of where that is being used. Is it in the authentication layer? Authorization? Some utility function? I have a feeling it is important, but I need a quick refresher. I need to trace this back. This is key. Let me start with a quick search of the files...
|
| 33/2 |
2026/05/24 09:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/netlink/genetlink.c IncludeLines:true Name:genl_family_rcv_msg]
Results: map[SourceCode:1155: static int genl_family_rcv_msg(const struct genl_family *family,
1156: struct sk_buff *skb,
1157: struct nlmsghdr *nlh,
1158: struct netlink_ext_ack *extack)
1159: {
1160: struct net *net = sock_net(skb->sk);
1161: struct genlmsghdr *hdr = nlmsg_data(nlh);
1162: struct genl_split_ops op;
1163: int hdrlen;
1164: u8 flags;
1165:
1166: /* this family doesn't exist in this netns */
1167: if (!family->netnsok && !net_eq(net, &init_net))
1168: return -ENOENT;
1169:
1170: hdrlen = GENL_HDRLEN + family->hdrsize;
1171: if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
1172: return -EINVAL;
1173:
1174: if (genl_header_check(family, nlh, hdr, extack))
1175: return -EINVAL;
1176:
1177: flags = (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP ?
1178: GENL_CMD_CAP_DUMP : GENL_CMD_CAP_DO;
1179: if (genl_get_cmd(hdr->cmd, flags, family, &op))
1180: return -EOPNOTSUPP;
1181:
1182: if ((op.flags & GENL_ADMIN_PERM) &&
1183: !netlink_capable(skb, CAP_NET_ADMIN))
1184: return -EPERM;
1185:
1186: if ((op.flags & GENL_UNS_ADMIN_PERM) &&
1187: !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN))
1188: return -EPERM;
1189:
1190: if (flags & GENL_CMD_CAP_DUMP)
1191: return genl_family_rcv_msg_dumpit(family, skb, nlh, extack,
1192: &op, hdrlen, net);
1193: else
1194: return genl_family_rcv_msg_doit(family, skb, nlh, extack,
1195: &op, hdrlen, net);
1196: }
SourceFile:net/netlink/genetlink.c]
|
| 34/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 34337
output: 44
thoughts: 77
Thoughts: Okay, here's my interpretation of those thoughts, considering my expertise:
**Examining Netlink Capability Checks**
Right, let me see... It looks like the `GENL_ADMIN_PERM` check is using `netlink_capable(skb, CAP_NET_ADMIN)`. That's standard fare for checking if a socket buffer `skb` has the necessary capability, specifically `CAP_NET_ADMIN`. Seems straightforward.
However, `GENL_UNS_ADMIN_PERM` is doing something a bit more interesting; it’s using `netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)`. Ah, I see! This implies that it’s checking the capability against a specific user namespace, `net->user_ns`. This is a crucial distinction. It's not just a blanket check; it's enforcing the capability check *within* the context of that particular user namespace. This confirms the security implications of this. Now, let me just quickly refresh my mental model of how `netlink_capable` works... I'll just double-check that, just to make sure I'm fully aware of the implications.
|
| 35/2 |
2026/05/24 09:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/netlink/af_netlink.c IncludeLines:true Name:netlink_capable]
Results: map[SourceCode: 873: /**
874: * netlink_capable - Netlink global message capability test
875: * @skb: socket buffer holding a netlink command from userspace
876: * @cap: The capability to use
877: *
878: * Test to see if the opener of the socket we received the message
879: * from had when the netlink socket was created and the sender of the
880: * message has the capability @cap in all user namespaces.
881: */
882: bool netlink_capable(const struct sk_buff *skb, int cap)
883: {
884: return netlink_ns_capable(skb, &init_user_ns, cap);
885: }
SourceFile:net/netlink/af_netlink.c]
|
| 36/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 34958
output: 23
thoughts: 343
Thoughts: **My Analysis of the `nfsd_nl_listener_set_doit` Security Implications**
Okay, so I'm digging into this code and it's pretty clear that `GENL_ADMIN_PERM` directly calls for `CAP_NET_ADMIN` in `init_user_ns`. Right, and `nfsd_nl_ops` is using `GENL_ADMIN_PERM`, meaning the `nfsd_nl_listener_set_doit` function inherits this requirement. Therefore, any call to it demands `CAP_NET_ADMIN` in the initial user namespace. Which means it is explicitly NOT accessible to unprivileged processes, and *definitely* not from user namespaces!
Let me just double-check, though. Quick look at the `nfsd_nl_ops` definition:
```c
{
.cmd = NFSD_CMD_LISTENER_SET,
.doit = nfsd_nl_listener_set_doit,
.policy = nfsd_listener_set_nl_policy,
.maxattr = NFSD_A_SERVER_SOCK_ADDR,
.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
},
```
Yep, `GENL_ADMIN_PERM` calls `netlink_capable(skb, CAP_NET_ADMIN)`, and that checks against `init_user_ns`. So, you absolutely need to be root, or have `CAP_NET_ADMIN` in the initial user namespace, to trigger this particular bug.
Now, the question is, are there any other paths to get to `svc_xprt_create_from_sa` or `request_module` while holding `nfsd_mutex`? I need to look deeper. Let's start by mapping `nfsd_mutex` usage.
|
| 37/2 |
2026/05/24 09:07 |
tool |
codesearch-find-references |
0m
Args:
Results: map[References:<nil> TruncatedOutput:false]
|
| 38/2 |
2026/05/24 09:07 |
llm |
expert |
0m
Model:
Tokens:
input: 35760
output: 23
thoughts: 15
Thoughts: Okay, here's my summary, taking the perspective of someone deeply familiar with kernel-level systems and mutexes:
**Checking `nfsd_mutex` References**
Right, let me just pause here. Before I get too deep into this particular issue, I need to take a step back and make absolutely sure I'm not missing something fundamental. Specifically, I should probably do a quick sanity check of all the places within the kernel code where `nfsd_mutex` is actually being referenced. This is crucial. I need to ensure there are no obvious conflicting or redundant operations occurring that I'm overlooking.
A good, quick scan could reveal other areas that are dependent on the mutex and might be relevant to the issue at hand, and might be an avenue for investigation. It's a fundamental part of the debugging process.
|
| 39/2 |
2026/05/24 09:08 |
tool |
codesearch-find-references |
0m
Args:
Results: map[References:<nil> TruncatedOutput:false]
|
| 40/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 35989
output: 25
thoughts: 14
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Global Mutex Aha!**
Okay, wait a second... thinking through this `nfsd` code. That `nfsd_mutex`... that's a *global* variable, isn't it? Right, it's defined at file scope, so it's not thread-local or even per-instance. That's a crucial piece of the puzzle. It means any synchronization on that object is going to impact *all* NFS operations within this process. So any blocking on it becomes a potential bottleneck, impacting all connected clients to the server. Right, global variable. Got it. This changes my mental model of its impact significantly. Let's see how its being used and then how it can be refactored to achieve better concurrency.
|
| 41/2 |
2026/05/24 09:08 |
tool |
grepper |
0m
Args: map[Expression:mutex_lock\(&nfsd_mutex\)]
Results: map[Output:fs/nfsd/export.c=255=static void expkey_flush(void)
--
fs/nfsd/export.c-260- */
fs/nfsd/export.c:261: mutex_lock(&nfsd_mutex);
fs/nfsd/export.c-262- nfsd_file_cache_purge(current->nsproxy->net_ns);
--
fs/nfsd/filecache.c=1384=int nfsd_file_cache_stats_show(struct seq_file *m, void *v)
--
fs/nfsd/filecache.c-1391- /* Serialize with server shutdown */
fs/nfsd/filecache.c:1392: mutex_lock(&nfsd_mutex);
fs/nfsd/filecache.c-1393- if (test_bit(NFSD_FILE_CACHE_UP, &nfsd_file_flags) == 1) {
--
fs/nfsd/nfsctl.c=267=static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-299- error = nlmsvc_unlock_all_by_sb(path.dentry->d_sb);
fs/nfsd/nfsctl.c:300: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-301- nn = net_generic(netns(file), nfsd_net_id);
--
fs/nfsd/nfsctl.c=417=static ssize_t write_threads(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-430- trace_nfsd_ctl_threads(net, newthreads);
fs/nfsd/nfsctl.c:431: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-432- rv = nfsd_svc(1, &newthreads, net, file->f_cred, NULL);
--
fs/nfsd/nfsctl.c=464=static ssize_t write_pool_threads(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-476-
fs/nfsd/nfsctl.c:477: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-478- npools = nfsd_nrpools(net);
--
fs/nfsd/nfsctl.c=696=static ssize_t write_versions(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-699-
fs/nfsd/nfsctl.c:700: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-701- rv = __write_versions(file, buf, size);
--
fs/nfsd/nfsctl.c=855=static ssize_t write_ports(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-858-
fs/nfsd/nfsctl.c:859: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-860- rv = __write_ports(file, buf, size, netns(file));
--
fs/nfsd/nfsctl.c=889=static ssize_t write_maxblksize(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-906- bsize &= ~(1024-1);
fs/nfsd/nfsctl.c:907: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-908- if (nn->nfsd_serv) {
--
fs/nfsd/nfsctl.c=957=static ssize_t nfsd4_write_time(struct file *file, char *buf, size_t size,
--
fs/nfsd/nfsctl.c-961-
fs/nfsd/nfsctl.c:962: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-963- rv = __nfsd4_write_time(file, buf, size, time, nn);
--
fs/nfsd/nfsctl.c=1062=static ssize_t write_recoverydir(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-1066-
fs/nfsd/nfsctl.c:1067: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-1068- rv = __write_recoverydir(file, buf, size, nn);
--
fs/nfsd/nfsctl.c=1488=int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
--
fs/nfsd/nfsctl.c-1493-
fs/nfsd/nfsctl.c:1494: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-1495-
--
fs/nfsd/nfsctl.c=1617=int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info)
--
fs/nfsd/nfsctl.c-1632-
fs/nfsd/nfsctl.c:1633: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-1634-
--
fs/nfsd/nfsctl.c=1711=int nfsd_nl_threads_get_doit(struct sk_buff *skb, struct genl_info *info)
--
fs/nfsd/nfsctl.c-1727-
fs/nfsd/nfsctl.c:1728: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-1729-
--
fs/nfsd/nfsctl.c=1779=int nfsd_nl_version_set_doit(struct sk_buff *skb, struct genl_info *info)
--
fs/nfsd/nfsctl.c-1787-
fs/nfsd/nfsctl.c:1788: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-1789-
--
fs/nfsd/nfsctl.c=1847=int nfsd_nl_version_get_doit(struct sk_buff *skb, struct genl_info *info)
--
fs/nfsd/nfsctl.c-1862-
fs/nfsd/nfsctl.c:1863: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-1864- nn = net_generic(genl_info_net(info), nfsd_net_id);
--
fs/nfsd/nfsctl.c=1927=int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info)
--
fs/nfsd/nfsctl.c-1937-
fs/nfsd/nfsctl.c:1938: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-1939-
--
fs/nfsd/nfsctl.c=2070=int nfsd_nl_listener_get_doit(struct sk_buff *skb, struct genl_info *info)
--
fs/nfsd/nfsctl.c-2087-
fs/nfsd/nfsctl.c:2088: mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c-2089- nn = net_generic(genl_info_net(info), nfsd_net_id);
--
fs/nfsd/nfssvc.c=240=int nfsd_nrthreads(struct net *net)
--
fs/nfsd/nfssvc.c-244-
fs/nfsd/nfssvc.c:245: mutex_lock(&nfsd_mutex);
fs/nfsd/nfssvc.c-246- if (nn->nfsd_serv)
--
fs/nfsd/nfssvc.c=571=void nfsd_shutdown_threads(struct net *net)
--
fs/nfsd/nfssvc.c-575-
fs/nfsd/nfssvc.c:576: mutex_lock(&nfsd_mutex);
fs/nfsd/nfssvc.c-577- serv = nn->nfsd_serv;
]
|
| 42/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 38594
output: 45
thoughts: 84
Thoughts: Okay, let me think this through.
**Analyzing NFS Daemon Security**
Right, I'm digging into this `nfsd_mutex` and it's turning up in a bunch of these `write_*` functions. Specifically, I'm seeing it's held in contexts related to `/proc/fs/nfsd/` files: things like `write_threads`, `write_ports`, `write_versions`. Hmm, that raises a flag. These are sysfs/procfs interfaces, and my main concern is always privilege separation. The critical question here is: are these `/proc/fs/nfsd/` files readable, or worse, *writable*, by a regular, unprivileged user? That could be a serious security hole. I need to verify what the file permissions are. Let me check the permissions on a few key files. `/proc/fs/nfsd/portlist` would be a good one, or perhaps `/proc/fs/nfsd/threads` would be better. That should tell me if we have a problem.
|
| 43/2 |
2026/05/24 09:08 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:nfsd_files]
Results: map[SourceCode: SourceFile:]
|
| 44/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 38970
output: 17
thoughts: 18
Thoughts: Here's my summary, as though I'm thinking through this process:
**Diving into the NFS Kernel Operations**
Okay, so we're seeing something funky with the NFS daemon. Time to get down to the nitty-gritty. My initial hunch, given the context, is that we need to examine the kernel-level operations that NFS uses for control and management. I'm immediately thinking of the `nfsd_nfsctl_ops` structure, or something very similar within the kernel's NFS subsystem. That seems like the logical starting point for investigating potential issues or misconfigurations at this level. Let's see if that's where the problem lies.
|
| 45/2 |
2026/05/24 09:08 |
tool |
grepper |
0m
Args: map[Expression:write_ports]
Results: map[Output:drivers/net/pse-pd/pd692x0.c=1166=static int
drivers/net/pse-pd/pd692x0.c:1167:pd692x0_write_ports_matrix(struct pd692x0_priv *priv)
drivers/net/pse-pd/pd692x0.c-1168-{
--
drivers/net/pse-pd/pd692x0.c=1194=static int pd692x0_hw_conf_init(struct pd692x0_priv *priv)
--
drivers/net/pse-pd/pd692x0.c-1206-
drivers/net/pse-pd/pd692x0.c:1207: ret = pd692x0_write_ports_matrix(priv);
drivers/net/pse-pd/pd692x0.c-1208- if (ret)
--
fs/nfsd/nfsctl.c=67=static ssize_t write_versions(struct file *file, char *buf, size_t size);
fs/nfsd/nfsctl.c:68:static ssize_t write_ports(struct file *file, char *buf, size_t size);
fs/nfsd/nfsctl.c-69-static ssize_t write_maxblksize(struct file *file, char *buf, size_t size);
--
fs/nfsd/nfsctl.c=79=static ssize_t (*const write_op[])(struct file *, char *, size_t) = {
--
fs/nfsd/nfsctl.c-85- [NFSD_Versions] = write_versions,
fs/nfsd/nfsctl.c:86: [NFSD_Ports] = write_ports,
fs/nfsd/nfsctl.c-87- [NFSD_MaxBlkSize] = write_maxblksize,
--
fs/nfsd/nfsctl.c=696=static ssize_t write_versions(struct file *file, char *buf, size_t size)
--
fs/nfsd/nfsctl.c-709- */
fs/nfsd/nfsctl.c:710:static ssize_t __write_ports_names(char *buf, struct net *net)
fs/nfsd/nfsctl.c-711-{
--
fs/nfsd/nfsctl.c-723- */
fs/nfsd/nfsctl.c:724:static ssize_t __write_ports_addfd(char *buf, struct net *net, const struct cred *cred)
fs/nfsd/nfsctl.c-725-{
--
fs/nfsd/nfsctl.c-752- */
fs/nfsd/nfsctl.c:753:static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cred *cred)
fs/nfsd/nfsctl.c-754-{
--
fs/nfsd/nfsctl.c-796-
fs/nfsd/nfsctl.c:797:static ssize_t __write_ports(struct file *file, char *buf, size_t size,
fs/nfsd/nfsctl.c-798- struct net *net)
--
fs/nfsd/nfsctl.c-800- if (size == 0)
fs/nfsd/nfsctl.c:801: return __write_ports_names(buf, net);
fs/nfsd/nfsctl.c-802-
fs/nfsd/nfsctl.c-803- if (isdigit(buf[0]))
fs/nfsd/nfsctl.c:804: return __write_ports_addfd(buf, net, file->f_cred);
fs/nfsd/nfsctl.c-805-
fs/nfsd/nfsctl.c-806- if (isalpha(buf[0]))
fs/nfsd/nfsctl.c:807: return __write_ports_addxprt(buf, net, file->f_cred);
fs/nfsd/nfsctl.c-808-
--
fs/nfsd/nfsctl.c-812-/*
fs/nfsd/nfsctl.c:813: * write_ports - Pass a socket file descriptor or transport name to listen on
fs/nfsd/nfsctl.c-814- *
--
fs/nfsd/nfsctl.c-854- */
fs/nfsd/nfsctl.c:855:static ssize_t write_ports(struct file *file, char *buf, size_t size)
fs/nfsd/nfsctl.c-856-{
--
fs/nfsd/nfsctl.c-859- mutex_lock(&nfsd_mutex);
fs/nfsd/nfsctl.c:860: rv = __write_ports(file, buf, size, netns(file));
fs/nfsd/nfsctl.c-861- mutex_unlock(&nfsd_mutex);
--
fs/nfsd/nfssvc.c=502=void nfsd_destroy_serv(struct net *net)
--
fs/nfsd/nfssvc.c-521- /*
fs/nfsd/nfssvc.c:522: * write_ports can create the server without actually starting
fs/nfsd/nfssvc.c-523- * any threads. If we get shut down before any threads are
]
|
| 46/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 40606
output: 49
thoughts: 15
Thoughts: Okay, here's my summarization of those thoughts, tailored for an expert audience, and written in the first person:
**Analyzing the `__write_ports_addxprt` Function**
Alright, let's dive into this. I need to refresh my memory on the implementation of `__write_ports_addxprt`. I'm going to start by running through the code to quickly check its core functionality. My main focus here is to understand how it handles the adding of export entries, especially in relation to the write ports. I need to make sure I recall how the memory is allocated and how the synchronization primitives are used. I need to also remind myself of any potential race conditions that might exist.
|
| 47/2 |
2026/05/24 09:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:__write_ports_addxprt]
Results: map[SourceCode: 749: /*
750: * A transport listener is added by writing its transport name and
751: * a port number.
752: */
753: static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cred *cred)
754: {
755: char transport[16];
756: struct svc_xprt *xprt;
757: int port, err;
758: struct nfsd_net *nn = net_generic(net, nfsd_net_id);
759: struct svc_serv *serv;
760:
761: if (sscanf(buf, "%15s %5u", transport, &port) != 2)
762: return -EINVAL;
763:
764: if (port < 1 || port > USHRT_MAX)
765: return -EINVAL;
766: trace_nfsd_ctl_ports_addxprt(net, transport, port);
767:
768: err = nfsd_create_serv(net);
769: if (err != 0)
770: return err;
771:
772: serv = nn->nfsd_serv;
773: err = svc_xprt_create(serv, transport, net,
774: PF_INET, port, SVC_SOCK_ANONYMOUS, cred);
775: if (err < 0)
776: goto out_err;
777:
778: err = svc_xprt_create(serv, transport, net,
779: PF_INET6, port, SVC_SOCK_ANONYMOUS, cred);
780: if (err < 0 && err != -EAFNOSUPPORT)
781: goto out_close;
782:
783: return 0;
784: out_close:
785: xprt = svc_find_xprt(serv, transport, net, PF_INET, port);
786: if (xprt != NULL) {
787: svc_xprt_close(xprt);
788: svc_xprt_put(xprt);
789: }
790: out_err:
791: if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks))
792: nfsd_destroy_serv(net);
793:
794: return err;
795: }
SourceFile:fs/nfsd/nfsctl.c]
|
| 48/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 41600
output: 48
thoughts: 22
Thoughts: Here's a summary of my immediate thoughts, as I understand them:
**Initial Thoughts on `svc_xprt_create`**
Okay, so I'm looking at `svc_xprt_create` and my first thought is, "Ah, right, it's calling `request_module` with a string derived from the `transport` parameter." The format is interesting; it looks like it's trying to load a module with a name that is prefixed with "svc" and then has the name of the specified `transport` variable appended to it. I wonder what the actual implications of this are. Is it using the `%s` format specifier safely? What are the potential security implications here? Is this the right way to determine the type of transport? I suppose that’s why it calls it to determine whether the relevant transport modules are available. I should probably dig deeper into the `request_module` function next.
|
| 49/2 |
2026/05/24 09:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/sunrpc/svc_xprt.c IncludeLines:true Name:svc_xprt_create]
Results: map[SourceCode: 331: /**
332: * svc_xprt_create - Add a new listener to @serv
333: * @serv: target RPC service
334: * @xprt_name: transport class name
335: * @net: network namespace
336: * @family: network address family
337: * @port: listener port
338: * @flags: SVC_SOCK flags
339: * @cred: credential to bind to this transport
340: *
341: * Return local xprt port on success or %-EPROTONOSUPPORT on failure
342: */
343: int svc_xprt_create(struct svc_serv *serv, const char *xprt_name,
344: struct net *net, const int family,
345: const unsigned short port, int flags,
346: const struct cred *cred)
347: {
348: struct sockaddr_in sin = {
349: .sin_family = AF_INET,
350: .sin_addr.s_addr = htonl(INADDR_ANY),
351: .sin_port = htons(port),
352: };
353: #if IS_ENABLED(CONFIG_IPV6)
354: struct sockaddr_in6 sin6 = {
355: .sin6_family = AF_INET6,
356: .sin6_addr = IN6ADDR_ANY_INIT,
357: .sin6_port = htons(port),
358: };
359: #endif
360: struct sockaddr *sap;
361:
362: switch (family) {
363: case PF_INET:
364: sap = (struct sockaddr *)&sin;
365: break;
366: #if IS_ENABLED(CONFIG_IPV6)
367: case PF_INET6:
368: sap = (struct sockaddr *)&sin6;
369: break;
370: #endif
371: default:
372: return -EAFNOSUPPORT;
373: }
374:
375: return svc_xprt_create_from_sa(serv, xprt_name, net, sap, flags, cred);
376: }
SourceFile:net/sunrpc/svc_xprt.c]
|
| 50/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 42572
output: 45
thoughts: 85
Thoughts: **Analyzing NFS Port Information**
Okay, so I'm tracing this `svc_xprt_create` function call. Looks like it funnels down through `svc_xprt_create_from_sa` and that, in turn, is calling `request_module("svc%s", xprt_name)`. My initial thought is to cross-reference this with the NFS configuration. And of course, the information on the ports in use is available via `/proc/fs/nfsd/portlist`.
Now, I need to understand the permissions. Let me quickly check the access control for `/proc/fs/nfsd/portlist`. I need to ensure the appropriate users and processes can actually read this critical information. That's the key next step to ensure I can proceed.
|
| 51/2 |
2026/05/24 09:08 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:nfsd_files]
Results: map[SourceCode: SourceFile:]
|
| 52/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 42894
output: 16
thoughts: 23
Thoughts: Okay, here's my summary, tailored for an expert audience, as if I'm thinking these thoughts:
**Navigating the NFSd Port Configuration Labyrinth**
Alright, I'm thinking I need to track down how the NFS daemon's port handling is configured. I'm going to start with a targeted search. Let's see... the `fs/nfsd` directory seems like the obvious place for the NFS server's code, and within that, `nfsctl.c` often handles control interfaces and parameters. So, my initial thought is to hunt for the string `portlist` within `fs/nfsd/nfsctl.c`. This *should* lead me to either the direct definition of a port list configuration or, at the very least, functions or structures that *interact* with port selection logic. That's my starting point. From there, I can drill down as needed.
|
| 53/2 |
2026/05/24 09:08 |
tool |
grepper |
0m
Args:
Results: map[Output:Documentation/admin-guide/nfs/nfs-rdma.rst=228=Each time a machine boots:
--
Documentation/admin-guide/nfs/nfs-rdma.rst-270-
Documentation/admin-guide/nfs/nfs-rdma.rst:271: $ echo rdma 20049 > /proc/fs/nfsd/portlist
Documentation/admin-guide/nfs/nfs-rdma.rst-272-
--
Documentation/admin-guide/nfs/nfsd-admin-interfaces.rst=14=Before doing that, NFSD can be told which sockets to listen on by
Documentation/admin-guide/nfs/nfsd-admin-interfaces.rst:15:writing to nfsd/portlist; that write may be:
Documentation/admin-guide/nfs/nfsd-admin-interfaces.rst-16-
--
drivers/accessibility/speakup/speakup_acntpc.c=34=static int port_forced;
drivers/accessibility/speakup/speakup_acntpc.c:35:static unsigned int synth_portlist[] = { 0x2a8, 0 };
drivers/accessibility/speakup/speakup_acntpc.c-36-
--
drivers/accessibility/speakup/speakup_acntpc.c=256=static int synth_probe(struct spk_synth *synth)
--
drivers/accessibility/speakup/speakup_acntpc.c-273- } else {
drivers/accessibility/speakup/speakup_acntpc.c:274: for (i = 0; synth_portlist[i]; i++) {
drivers/accessibility/speakup/speakup_acntpc.c:275: if (synth_request_region(synth_portlist[i],
drivers/accessibility/speakup/speakup_acntpc.c-276- SYNTH_IO_EXTENT)) {
--
drivers/accessibility/speakup/speakup_acntpc.c-278- ("request_region: failed with 0x%x, %d\n",
drivers/accessibility/speakup/speakup_acntpc.c:279: synth_portlist[i], SYNTH_IO_EXTENT);
drivers/accessibility/speakup/speakup_acntpc.c-280- continue;
drivers/accessibility/speakup/speakup_acntpc.c-281- }
drivers/accessibility/speakup/speakup_acntpc.c:282: port_val = inw(synth_portlist[i]) & 0xfffc;
drivers/accessibility/speakup/speakup_acntpc.c-283- if (port_val == 0x53fc) {
drivers/accessibility/speakup/speakup_acntpc.c-284- /* 'S' and out&input bits */
drivers/accessibility/speakup/speakup_acntpc.c:285: synth_port_control = synth_portlist[i];
drivers/accessibility/speakup/speakup_acntpc.c-286- speakup_info.port_tts = synth_port_control + 1;
--
drivers/accessibility/speakup/speakup_decpc.c=131=static void synth_flush(struct spk_synth *synth);
drivers/accessibility/speakup/speakup_decpc.c-132-
drivers/accessibility/speakup/speakup_decpc.c:133:static int synth_portlist[] = { 0x340, 0x350, 0x240, 0x250, 0 };
drivers/accessibility/speakup/speakup_decpc.c-134-static int in_escape, is_flushing;
--
drivers/accessibility/speakup/speakup_decpc.c=461=static int synth_probe(struct spk_synth *synth)
--
drivers/accessibility/speakup/speakup_decpc.c-465- pr_info("Probing for %s.\n", synth->long_name);
drivers/accessibility/speakup/speakup_decpc.c:466: for (i = 0; synth_portlist[i]; i++) {
drivers/accessibility/speakup/speakup_decpc.c:467: if (synth_request_region(synth_portlist[i], SYNTH_IO_EXTENT)) {
drivers/accessibility/speakup/speakup_decpc.c-468- pr_warn("request_region: failed with 0x%x, %d\n",
drivers/accessibility/speakup/speakup_decpc.c:469: synth_portlist[i], SYNTH_IO_EXTENT);
drivers/accessibility/speakup/speakup_decpc.c-470- continue;
drivers/accessibility/speakup/speakup_decpc.c-471- }
drivers/accessibility/speakup/speakup_decpc.c:472: speakup_info.port_tts = synth_portlist[i];
drivers/accessibility/speakup/speakup_decpc.c-473- failed = testkernel();
--
drivers/accessibility/speakup/speakup_dtlk.c=33=static int port_forced;
drivers/accessibility/speakup/speakup_dtlk.c:34:static unsigned int synth_portlist[] = {
drivers/accessibility/speakup/speakup_dtlk.c-35- 0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0
--
drivers/accessibility/speakup/speakup_dtlk.c=326=static int synth_probe(struct spk_synth *synth)
--
drivers/accessibility/speakup/speakup_dtlk.c-346- } else {
drivers/accessibility/speakup/speakup_dtlk.c:347: for (i = 0; synth_portlist[i]; i++) {
drivers/accessibility/speakup/speakup_dtlk.c:348: if (synth_request_region(synth_portlist[i],
drivers/accessibility/speakup/speakup_dtlk.c-349- SYNTH_IO_EXTENT))
drivers/accessibility/speakup/speakup_dtlk.c-350- continue;
drivers/accessibility/speakup/speakup_dtlk.c:351: port_val = inw(synth_portlist[i]) & 0xfbff;
drivers/accessibility/speakup/speakup_dtlk.c-352- if (port_val == 0x107f) {
drivers/accessibility/speakup/speakup_dtlk.c:353: synth_lpc = synth_portlist[i];
drivers/accessibility/speakup/speakup_dtlk.c-354- speakup_info.port_tts = synth_lpc + 1;
--
drivers/accessibility/speakup/speakup_dtlk.c-356- }
drivers/accessibility/speakup/speakup_dtlk.c:357: synth_release_region(synth_portlist[i],
drivers/accessibility/speakup/speakup_dtlk.c-358- SYNTH_IO_EXTENT);
--
drivers/accessibility/speakup/speakup_keypc.c=33=static int port_forced;
drivers/accessibility/speakup/speakup_keypc.c:34:static unsigned int synth_portlist[] = { 0x2a8, 0 };
drivers/accessibility/speakup/speakup_keypc.c-35-
--
drivers/accessibility/speakup/speakup_keypc.c=263=static int synth_probe(struct spk_synth *synth)
--
drivers/accessibility/speakup/speakup_keypc.c-278- } else {
drivers/accessibility/speakup/speakup_keypc.c:279: for (i = 0; synth_portlist[i]; i++) {
drivers/accessibility/speakup/speakup_keypc.c:280: if (synth_request_region(synth_portlist[i],
drivers/accessibility/speakup/speakup_keypc.c-281- SYNTH_IO_EXTENT)) {
--
drivers/accessibility/speakup/speakup_keypc.c-283- ("request_region: failed with 0x%x, %d\n",
drivers/accessibility/speakup/speakup_keypc.c:284: synth_portlist[i], SYNTH_IO_EXTENT);
drivers/accessibility/speakup/speakup_keypc.c-285- continue;
drivers/accessibility/speakup/speakup_keypc.c-286- }
drivers/accessibility/speakup/speakup_keypc.c:287: port_val = inb(synth_portlist[i]);
drivers/accessibility/speakup/speakup_keypc.c-288- if (port_val == 0x80) {
drivers/accessibility/speakup/speakup_keypc.c:289: synth_port = synth_portlist[i];
drivers/accessibility/speakup/speakup_keypc.c-290- break;
--
drivers/char/dtlk.c=84=static int dtlk_has_indexing;
drivers/char/dtlk.c:85:static unsigned int dtlk_portlist[] =
drivers/char/dtlk.c-86-{0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0};
--
drivers/char/dtlk.c=389=static int __init dtlk_dev_probe(void)
--
drivers/char/dtlk.c-397-
drivers/char/dtlk.c:398: for (i = 0; dtlk_portlist[i]; i++) {
drivers/char/dtlk.c-399-#if 0
drivers/char/dtlk.c-400- printk("DoubleTalk PC - Port %03x = %04x\n",
drivers/char/dtlk.c:401: dtlk_portlist[i], (testval = inw_p(dtlk_portlist[i])));
drivers/char/dtlk.c-402-#endif
drivers/char/dtlk.c-403-
drivers/char/dtlk.c:404: if (!request_region(dtlk_portlist[i], DTLK_IO_EXTENT,
drivers/char/dtlk.c-405- "dtlk"))
drivers/char/dtlk.c-406- continue;
drivers/char/dtlk.c:407: testval = inw_p(dtlk_portlist[i]);
drivers/char/dtlk.c-408- if ((testval &= 0xfbff) == 0x107f) {
drivers/char/dtlk.c:409: dtlk_port_lpc = dtlk_portlist[i];
drivers/char/dtlk.c-410- dtlk_port_tts = dtlk_port_lpc + 1;
--
drivers/char/dtlk.c-414- "ROM version %s, serial number %u",
drivers/char/dtlk.c:415: dtlk_portlist[i], dtlk_portlist[i] +
drivers/char/dtlk.c-416- DTLK_IO_EXTENT - 1,
--
drivers/char/dtlk.c=467=for (i = 0; i < 10; i++) \
--
drivers/char/dtlk.c-492- }
drivers/char/dtlk.c:493: release_region(dtlk_portlist[i], DTLK_IO_EXTENT);
drivers/char/dtlk.c-494- }
--
drivers/input/gameport/ns558.c=23=MODULE_LICENSE("GPL");
drivers/input/gameport/ns558.c-24-
drivers/input/gameport/ns558.c:25:static int ns558_isa_portlist[] = { 0x201, 0x200, 0x202, 0x203, 0x204, 0x205, 0x207, 0x209,
drivers/input/gameport/ns558.c-26- 0x20b, 0x20c, 0x20e, 0x20f, 0x211, 0x219, 0x101, 0 };
--
drivers/input/gameport/ns558.c=232=static int __init ns558_init(void)
--
drivers/input/gameport/ns558.c-246-
drivers/input/gameport/ns558.c:247: while (ns558_isa_portlist[i])
drivers/input/gameport/ns558.c:248: ns558_isa_probe(ns558_isa_portlist[i++]);
drivers/input/gameport/ns558.c-249-
--
drivers/net/ethernet/8390/ne.c=100=ISA device autoprobes on a running machine are not recommended anyway. */
drivers/net/ethernet/8390/ne.c-101-#if !defined(MODULE) && defined(CONFIG_ISA)
drivers/net/ethernet/8390/ne.c:102:/* Do we need a portlist for the ISA auto-probe ? */
drivers/net/ethernet/8390/ne.c-103-#define NEEDS_PORTLIST
--
drivers/net/ethernet/8390/ne.c-107-#ifdef NEEDS_PORTLIST
drivers/net/ethernet/8390/ne.c:108:static unsigned int netcard_portlist[] __initdata = {
drivers/net/ethernet/8390/ne.c-109- 0x300, 0x280, 0x320, 0x340, 0x360, 0x380, 0
--
drivers/net/ethernet/8390/ne.c=207=static int __init do_ne_probe(struct net_device *dev)
--
drivers/net/ethernet/8390/ne.c-230- /* Last resort. The semi-risky ISA auto-probe. */
drivers/net/ethernet/8390/ne.c:231: for (base_addr = 0; netcard_portlist[base_addr] != 0; base_addr++) {
drivers/net/ethernet/8390/ne.c:232: int ioaddr = netcard_portlist[base_addr];
drivers/net/ethernet/8390/ne.c-233- dev->irq = orig_irq;
--
drivers/net/ethernet/amd/pcnet32.c=76=static int cards_found;
--
drivers/net/ethernet/amd/pcnet32.c-80- */
drivers/net/ethernet/amd/pcnet32.c:81:static unsigned int pcnet32_portlist[] =
drivers/net/ethernet/amd/pcnet32.c-82- { 0x300, 0x320, 0x340, 0x360, 0 };
--
drivers/net/ethernet/amd/pcnet32.c=1491=static const struct ethtool_ops pcnet32_ethtool_ops = {
--
drivers/net/ethernet/amd/pcnet32.c-1511-
drivers/net/ethernet/amd/pcnet32.c:1512:static void pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)
drivers/net/ethernet/amd/pcnet32.c-1513-{
--
drivers/net/ethernet/amd/pcnet32.c-1516- /* search for PCnet32 VLB cards at known addresses */
drivers/net/ethernet/amd/pcnet32.c:1517: for (port = pcnet32_portlist; (ioaddr = *port); port++) {
drivers/net/ethernet/amd/pcnet32.c-1518- if (request_region
--
drivers/net/ethernet/amd/pcnet32.c=3002=static int __init pcnet32_init_module(void)
--
drivers/net/ethernet/amd/pcnet32.c-3014- if (pcnet32vlb)
drivers/net/ethernet/amd/pcnet32.c:3015: pcnet32_probe_vlbus(pcnet32_portlist);
drivers/net/ethernet/amd/pcnet32.c-3016-
--
drivers/net/ethernet/cirrus/cs89x0.c=90=static char version[] __initdata =
--
drivers/net/ethernet/cirrus/cs89x0.c-108-#if IS_ENABLED(CONFIG_CS89x0_ISA)
drivers/net/ethernet/cirrus/cs89x0.c:109:static unsigned int netcard_portlist[] __used __initdata = {
drivers/net/ethernet/cirrus/cs89x0.c-110- 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240,
--
drivers/net/ethernet/cirrus/cs89x0.c=1648=struct net_device * __init cs89x0_probe(int unit)
--
drivers/net/ethernet/cirrus/cs89x0.c-1670- } else {
drivers/net/ethernet/cirrus/cs89x0.c:1671: for (port = netcard_portlist; *port; port++) {
drivers/net/ethernet/cirrus/cs89x0.c-1672- if (cs89x0_ioport_probe(dev, *port, 0) == 0)
--
drivers/parport/share.c=43=int parport_default_spintime = DEFAULT_SPIN_TIME;
drivers/parport/share.c-44-
drivers/parport/share.c:45:static LIST_HEAD(portlist);
drivers/parport/share.c:46:static DEFINE_SPINLOCK(parportlist_lock);
drivers/parport/share.c-47-
--
drivers/parport/share.c=504=void parport_announce_port(struct parport *port)
--
drivers/parport/share.c-518- mutex_lock(®istration_lock);
drivers/parport/share.c:519: spin_lock_irq(&parportlist_lock);
drivers/parport/share.c:520: list_add_tail(&port->list, &portlist);
drivers/parport/share.c-521- for (i = 1; i < 3; i++) {
--
drivers/parport/share.c-523- if (slave)
drivers/parport/share.c:524: list_add_tail(&slave->list, &portlist);
drivers/parport/share.c-525- }
drivers/parport/share.c:526: spin_unlock_irq(&parportlist_lock);
drivers/parport/share.c-527-
--
drivers/parport/share.c=558=void parport_remove_port(struct parport *port)
--
drivers/parport/share.c-579- port->ops = &dead_ops;
drivers/parport/share.c:580: spin_lock(&parportlist_lock);
drivers/parport/share.c-581- list_del_init(&port->list);
--
drivers/parport/share.c-586- }
drivers/parport/share.c:587: spin_unlock(&parportlist_lock);
drivers/parport/share.c-588-
--
drivers/parport/share.c=894=struct parport *parport_find_number(int number)
--
drivers/parport/share.c-897-
drivers/parport/share.c:898: if (list_empty(&portlist))
drivers/parport/share.c-899- get_lowlevel_driver();
drivers/parport/share.c-900-
drivers/parport/share.c:901: spin_lock(&parportlist_lock);
drivers/parport/share.c:902: list_for_each_entry(port, &portlist, list) {
drivers/parport/share.c-903- if (port->number == number) {
--
drivers/parport/share.c-907- }
drivers/parport/share.c:908: spin_unlock(&parportlist_lock);
drivers/parport/share.c-909- return result;
--
drivers/parport/share.c=925=struct parport *parport_find_base(unsigned long base)
--
drivers/parport/share.c-928-
drivers/parport/share.c:929: if (list_empty(&portlist))
drivers/parport/share.c-930- get_lowlevel_driver();
drivers/parport/share.c-931-
drivers/parport/share.c:932: spin_lock(&parportlist_lock);
drivers/parport/share.c:933: list_for_each_entry(port, &portlist, list) {
drivers/parport/share.c-934- if (port->base == base) {
--
drivers/parport/share.c-938- }
drivers/parport/share.c:939: spin_unlock(&parportlist_lock);
drivers/parport/share.c-940- return result;
--
fs/nfsd/nfsctl.c=1286=static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc)
--
fs/nfsd/nfsctl.c-1309- [NFSD_Versions] = {"versions", &transaction_ops, S_IWUSR|S_IRUSR},
fs/nfsd/nfsctl.c:1310: [NFSD_Ports] = {"portlist", &transaction_ops, S_IWUSR|S_IRUGO},
fs/nfsd/nfsctl.c-1311- [NFSD_MaxBlkSize] = {"max_block_size", &transaction_ops, S_IWUSR|S_IRUGO},
]
|
| 54/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 49060
output: 47
thoughts: 141
Thoughts: **Analyzing NFSd Port Configuration**
Okay, here's what I'm thinking... I see this line of code: `[NFSD_Ports] = {"portlist", &transaction_ops, S_IWUSR|S_IRUGO}`. Right, so `/proc/fs/nfsd/portlist` is being defined, and the critical piece here is the permissions: it's writable only by the owner (`S_IWUSR`). The rest of the world can read (`S_IRUGO`).
My immediate assumption is the owner is root, and that makes sense, which limits modification to root users. But hold on a second... what if this `nfsd` filesystem is mounted within a user namespace? If that's the case, the *effective* owner of that file will be root *within that specific namespace*, not necessarily the global root. The implication is, with the right namespace configuration, a non-root user *could* potentially modify this critical port list.
The next obvious step is to verify whether or not `nfsd` is even designed to be mounted inside of a user namespace. Let's see if that's possible...
|
| 55/2 |
2026/05/24 09:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:nfsd_fs_type]
Results: map[SourceCode:1370: static struct file_system_type nfsd_fs_type = {
1371: .owner = THIS_MODULE,
1372: .name = "nfsd",
1373: .init_fs_context = nfsd_init_fs_context,
1374: .kill_sb = nfsd_umount,
1375: };
SourceFile:fs/nfsd/nfsctl.c]
|
| 56/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 49637
output: 47
thoughts: 41
Thoughts: Okay, let's see. My first thought is: **Hang on a minute, I was sure `nfsd_fs_type` had the `FS_USERNS_MOUNT` flag set, but now I'm doubting myself!** This is unexpected. I really need to double-check that. I can't trust my memory on this. Okay, let's go back and carefully re-examine `nfsd_fs_type`. Just to be absolutely certain...this is crucial, and a detail like this can throw everything off track if incorrect. Let's get this right.
|
| 57/2 |
2026/05/24 09:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:nfsd_fs_type]
Results: map[SourceCode:1370: static struct file_system_type nfsd_fs_type = {
1371: .owner = THIS_MODULE,
1372: .name = "nfsd",
1373: .init_fs_context = nfsd_init_fs_context,
1374: .kill_sb = nfsd_umount,
1375: };
SourceFile:fs/nfsd/nfsctl.c]
|
| 58/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 49993
output: 48
thoughts: 317
Thoughts: **Analyzing User Namespace Mounting and NFSd**
Okay, so I'm thinking, if the filesystem type doesn't have the `FS_USERNS_MOUNT` flag set, then it's a hard "no" for unprivileged user namespace mounts. And wait a second, even if a user namespace *is* created, and the user has `CAP_SYS_ADMIN` inside that namespace... they *still* can't mount `nfsd` unless `FS_USERNS_MOUNT` is there. I need to verify this assumption because it's crucial for the security model.
Right, after checking `mount(2)`, it's clear: `FS_USERNS_MOUNT` *is* required for any mounting action within a user namespace. Therefore, an unprivileged user is effectively blocked from mounting an `nfsd` filesystem, which is what I wanted to confirm.
Okay, let's consider another angle. Say root in the initial namespace mounts `nfsd`, and then a non-root user attempts a write. The filesystem permissions would be `S_IWUSR|S_IRUGO`, which translates to `0644`. So, essentially, only root would have write permissions.
Now, what about `nfsd_nl_listener_set_doit`? This is a genetlink command, but we already know genetlink with `GENL_ADMIN_PERM` requires `CAP_NET_ADMIN` in the initial user namespace. Given that `.netnsok` is not sufficient, but the function requires `init_user_ns`.
But wait. The `nfsd_nl_family` has its `.netnsok` flag set to true. Hmm, does the presence of `.netnsok` change how `GENL_ADMIN_PERM` functions? That's a crucial point to understand the security implications. I'll need to go back and re-examine `genl_family_rcv_msg` to see how it all interacts.
|
| 59/2 |
2026/05/24 09:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/netlink/genetlink.c IncludeLines:true Name:genl_family_rcv_msg]
Results: map[SourceCode:1155: static int genl_family_rcv_msg(const struct genl_family *family,
1156: struct sk_buff *skb,
1157: struct nlmsghdr *nlh,
1158: struct netlink_ext_ack *extack)
1159: {
1160: struct net *net = sock_net(skb->sk);
1161: struct genlmsghdr *hdr = nlmsg_data(nlh);
1162: struct genl_split_ops op;
1163: int hdrlen;
1164: u8 flags;
1165:
1166: /* this family doesn't exist in this netns */
1167: if (!family->netnsok && !net_eq(net, &init_net))
1168: return -ENOENT;
1169:
1170: hdrlen = GENL_HDRLEN + family->hdrsize;
1171: if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
1172: return -EINVAL;
1173:
1174: if (genl_header_check(family, nlh, hdr, extack))
1175: return -EINVAL;
1176:
1177: flags = (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP ?
1178: GENL_CMD_CAP_DUMP : GENL_CMD_CAP_DO;
1179: if (genl_get_cmd(hdr->cmd, flags, family, &op))
1180: return -EOPNOTSUPP;
1181:
1182: if ((op.flags & GENL_ADMIN_PERM) &&
1183: !netlink_capable(skb, CAP_NET_ADMIN))
1184: return -EPERM;
1185:
1186: if ((op.flags & GENL_UNS_ADMIN_PERM) &&
1187: !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN))
1188: return -EPERM;
1189:
1190: if (flags & GENL_CMD_CAP_DUMP)
1191: return genl_family_rcv_msg_dumpit(family, skb, nlh, extack,
1192: &op, hdrlen, net);
1193: else
1194: return genl_family_rcv_msg_doit(family, skb, nlh, extack,
1195: &op, hdrlen, net);
1196: }
SourceFile:net/netlink/genetlink.c]
|
| 60/2 |
2026/05/24 09:08 |
llm |
expert |
0m
Model:
Tokens:
input: 51561
output: 46
thoughts: 196
Thoughts: **Analyzing NFSd Netlink Permissions**
Okay, so the `GENL_ADMIN_PERM` check is ultimately tied to `CAP_NET_ADMIN` within the initial user namespace, that's clear. The `netlink_capable` function makes that connection, checking the `init_user_ns`. Even if the network namespace is considered okay (`netnsok`), I'm still constrained by the `CAP_NET_ADMIN` requirement in the initial user namespace due to `GENL_ADMIN_PERM`. They specifically *didn't* use `GENL_UNS_ADMIN_PERM` which would have relaxed the requirements for a user namespace. Therefore, `nfsd_nl_listener_set_doit` is inherently limited to root in the very first user namespace.
But hold on... I need to double-check something. Let me rethink this... What about the other operations defined in `nfsd_nl_ops`? Are there *any* other operations that might sidestep `GENL_ADMIN_PERM`, yet still hold `nfsd_mutex`? I need to go back and really look at that `nfsd_nl_ops` structure again, to make absolutely sure.
|
| 61/2 |
2026/05/24 09:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/netlink.c IncludeLines:true Name:nfsd_nl_ops]
Results: map[SourceCode: 51: /* Ops table for nfsd */
52: static const struct genl_split_ops nfsd_nl_ops[] = {
53: {
54: .cmd = NFSD_CMD_RPC_STATUS_GET,
55: .dumpit = nfsd_nl_rpc_status_get_dumpit,
56: .flags = GENL_CMD_CAP_DUMP,
57: },
58: {
59: .cmd = NFSD_CMD_THREADS_SET,
60: .doit = nfsd_nl_threads_set_doit,
61: .policy = nfsd_threads_set_nl_policy,
62: .maxattr = NFSD_A_SERVER_FH_KEY,
63: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
64: },
65: {
66: .cmd = NFSD_CMD_THREADS_GET,
67: .doit = nfsd_nl_threads_get_doit,
68: .flags = GENL_CMD_CAP_DO,
69: },
70: {
71: .cmd = NFSD_CMD_VERSION_SET,
72: .doit = nfsd_nl_version_set_doit,
73: .policy = nfsd_version_set_nl_policy,
74: .maxattr = NFSD_A_SERVER_PROTO_VERSION,
75: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
76: },
77: {
78: .cmd = NFSD_CMD_VERSION_GET,
79: .doit = nfsd_nl_version_get_doit,
80: .flags = GENL_CMD_CAP_DO,
81: },
82: {
83: .cmd = NFSD_CMD_LISTENER_SET,
84: .doit = nfsd_nl_listener_set_doit,
85: .policy = nfsd_listener_set_nl_policy,
86: .maxattr = NFSD_A_SERVER_SOCK_ADDR,
87: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
88: },
89: {
90: .cmd = NFSD_CMD_LISTENER_GET,
91: .doit = nfsd_nl_listener_get_doit,
92: .flags = GENL_CMD_CAP_DO,
93: },
94: {
95: .cmd = NFSD_CMD_POOL_MODE_SET,
96: .doit = nfsd_nl_pool_mode_set_doit,
97: .policy = nfsd_pool_mode_set_nl_policy,
98: .maxattr = NFSD_A_POOL_MODE_MODE,
99: .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
100: },
101: {
102: .cmd = NFSD_CMD_POOL_MODE_GET,
103: .doit = nfsd_nl_pool_mode_get_doit,
104: .flags = GENL_CMD_CAP_DO,
105: },
106: };
SourceFile:fs/nfsd/netlink.c]
|
| 62/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 53061
output: 52
thoughts: 43
Thoughts: Here's my summary, as the expert:
**Investigating the NFSd Netlink Command Listener**
Okay, so I'm digging into this `NFSD_CMD_LISTENER_GET` command. The code clearly sets `.flags = GENL_CMD_CAP_DO`. That's interesting, it means the command likely has some specific capabilities associated with it, beyond the standard retrieval. Let's see... my first instinct is to drill down into `nfsd_nl_listener_get_doit` – that's probably where the actual execution and handling of this GET command takes place. I need to understand what this function *does*, given the capabilities flag is set as I've seen. Is there perhaps something interesting with permissions checking or specific access control logic I need to watch out for? It may contain some capability check for the user or perhaps handle some information retrieval specific to the capability set. Let's see...
|
| 63/2 |
2026/05/24 09:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfsd/nfsctl.c IncludeLines:true Name:nfsd_nl_listener_get_doit]
Results: map[SourceCode:2063: /**
2064: * nfsd_nl_listener_get_doit - get the nfs running listeners
2065: * @skb: reply buffer
2066: * @info: netlink metadata and command arguments
2067: *
2068: * Return 0 on success or a negative errno.
2069: */
2070: int nfsd_nl_listener_get_doit(struct sk_buff *skb, struct genl_info *info)
2071: {
2072: struct svc_xprt *xprt;
2073: struct svc_serv *serv;
2074: struct nfsd_net *nn;
2075: void *hdr;
2076: int err;
2077:
2078: skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_KERNEL);
2079: if (!skb)
2080: return -ENOMEM;
2081:
2082: hdr = genlmsg_iput(skb, info);
2083: if (!hdr) {
2084: err = -EMSGSIZE;
2085: goto err_free_msg;
2086: }
2087:
2088: mutex_lock(&nfsd_mutex);
2089: nn = net_generic(genl_info_net(info), nfsd_net_id);
2090:
2091: /* no nfs server? Just send empty socket list */
2092: if (!nn->nfsd_serv)
2093: goto out_unlock_mtx;
2094:
2095: serv = nn->nfsd_serv;
2096: spin_lock_bh(&serv->sv_lock);
2097: list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) {
2098: struct nlattr *attr;
2099:
2100: attr = nla_nest_start(skb, NFSD_A_SERVER_SOCK_ADDR);
2101: if (!attr) {
2102: err = -EINVAL;
2103: goto err_serv_unlock;
2104: }
2105:
2106: if (nla_put_string(skb, NFSD_A_SOCK_TRANSPORT_NAME,
2107: xprt->xpt_class->xcl_name) ||
2108: nla_put(skb, NFSD_A_SOCK_ADDR,
2109: sizeof(struct sockaddr_storage),
2110: &xprt->xpt_local)) {
2111: err = -EINVAL;
2112: goto err_serv_unlock;
2113: }
2114:
2115: nla_nest_end(skb, attr);
2116: }
2117: spin_unlock_bh(&serv->sv_lock);
2118: out_unlock_mtx:
2119: mutex_unlock(&nfsd_mutex);
2120: genlmsg_end(skb, hdr);
2121:
2122: return genlmsg_reply(skb, info);
2123:
2124: err_serv_unlock:
2125: spin_unlock_bh(&serv->sv_lock);
2126: mutex_unlock(&nfsd_mutex);
2127: err_free_msg:
2128: nlmsg_free(skb);
2129:
2130: return err;
2131: }
SourceFile:fs/nfsd/nfsctl.c]
|
| 64/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 54414
output: 49
thoughts: 1293
Thoughts: **Analysis of a Potential Deadlock in the NFS Daemon**
Okay, let's break this down. My initial thought was that `nfsd_nl_listener_get_doit` could be a vulnerability because it acquires `nfsd_mutex` without requiring `GENL_ADMIN_PERM`. I reasoned that an unprivileged user *could* call this and snag the mutex. However, `nfsd_nl_listener_get_doit` just iterates, so it shouldn't block. But then I considered a race condition: what if `nfsd_nl_listener_get_doit` is called *during* the execution of `nfsd_nl_listener_set_doit`?
Now, `nfsd_nl_listener_set_doit` is run by root, and it *does* hold `nfsd_mutex`. The bug report confirms this. Specifically, `syz.0.496/8229` clearly holds the `nfsd_mutex`. But if `syz.0.496/8229` is an unprivileged process, how did it enter that code path? Ah, syzkaller usually runs as root, or in a user namespace with all capabilities. That explains it. So syzkaller *can* trigger `nfsd_nl_listener_set_doit`.
The core question now: is this accessible to an unprivileged process? We know `nfsd_nl_listener_set_doit` *needs* `CAP_NET_ADMIN`. So, unprivileged users are out of luck there. And I quickly checked `/proc/fs/nfsd/portlist` – owned by root, permissions 0644 – no access for an unprivileged user to `write_ports` either.
So, where else is `request_module` called while holding `nfsd_mutex`? I traced it, and it's only called within `svc_xprt_create_from_sa`, itself called from `nfsd_nl_listener_set_doit` and `write_ports`. Both of those need root privileges.
But wait, is there another angle to consider here? Could an unprivileged user call `nfsd_nl_listener_get_doit` and block on `nfsd_mutex`? Yes, they *could* block themselves, but that's not a denial of service (DoS). The real DoS is when `nfsd_nl_listener_set_doit` (running as root) hangs, holding both `nfsd_mutex` *and* `cb_lock`.
Why does it hang? Because it calls `request_module("svc%s", xcl_name)`. If `xcl_name` is controlled by root, could root pass something that causes modprobe to hang? I was a bit confused at first thinking about the `modprobe` logic. But the syzkaller test hangs not directly through `modprobe`, but because `modprobe` tries to load a module that calls `genl_register_family`. That function then attempts to acquire `cb_lock` for writing. But `cb_lock` is *already* held for reading by `genl_rcv`, in the thread that originally called `nfsd_nl_listener_set_doit`!
The `modprobe` process, therefore, blocks on `cb_lock`. And the original thread calling `nfsd_nl_listener_set_doit` blocks waiting for `modprobe` to complete, which it won't. **Deadlock!**
This deadlock *happens* because `request_module` is called from a genetlink "doit" callback. And those callbacks are called with `cb_lock` held! It's a fundamental vulnerability: *any* genetlink `doit` callback that calls `request_module`, and the requested module attempts to register a genetlink family, will deadlock.
So the killer here is that `request_module` is called with `xcl_name` controlled via a netlink message. If root sends a netlink message to `NFSD_CMD_LISTENER_SET` with `xcl_name` = "rdma", it requests `svcrdma`. That's an alias for `rpcrdma`. Now, the important question is: Does `rpcrdma` register a genetlink family? That's the key.
|
| 65/2 |
2026/05/24 09:09 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:net/sunrpc/xprtrdma/module.c IncludeLines:true Name:rpc_rdma_init]
Results: map[SourceCode: SourceFile:]
|
| 66/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 56747
output: 23
thoughts: 27
Thoughts: Here's my thought process, summarized as you requested:
**Navigating the RPC/RDMA Landscape**
Okay, so I need to find where the initialization happens for the RDMA transport within SunRPC. I remember seeing `module_init` used quite a bit in the kernel. My immediate hunch is that the core initialization for that module will be declared somewhere in the `net/sunrpc` subtree, specifically within the RDMA-specific code. I'll start with `xprtrdma`, and I'm pretty sure I've worked in that `module.c` file before when digging into the RPC/RDMA stack, so that seems like a logical first place to look. Let's target that specific file, `net/sunrpc/xprtrdma/module.c` and see if `module_init` is used there. That should reveal where the RDMA transport registers itself, starts up any core components, or generally gets itself ready to roll. That's the entry point I'm looking for.
|
| 67/2 |
2026/05/24 09:09 |
tool |
grepper |
0m
Error:
Args: map[Expression:module_init.*xprtrdma]
Results:
|
| 68/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 57033
output: 17
thoughts: 24
Thoughts: Okay, here's my summary, presented as a stream of thought:
**Diving into the `net/sunrpc/xprtrdma/` Codebase**
Alright, time to get to work. Let's see... the task at hand is to understand how `net/sunrpc/xprtrdma/` is structured. My immediate thought is to start with a specific point of interest. I'm going to start with a familiar entry point, a macro I've dealt with a hundred times: `module_init`. Searching for `module_init` within this directory, `net/sunrpc/xprtrdma/`, is the best way to uncover the core initialization sequences and figure out how this part of the network stack is actually brought to life. I want to see which functions are hooked up to module loading and understand the dependencies. That will give me a clear overview of the relevant initialization and resource allocation, helping me build a mental map of this area of the code. Let's see what we can find.
|
| 69/2 |
2026/05/24 09:09 |
tool |
grepper |
0m
Args: map[Expression:module_init]
Results: map[Output:
Full output is too long, showing 500 out of 20737 lines.
Use more precise expression if possible.
[Documentation/PCI/pci.rst=131=Tips on when/where to use the above attributes:
Documentation/PCI/pci.rst:132: - The module_init()/module_exit() functions (and all
Documentation/PCI/pci.rst-133- initialization functions called _only_ from these)
--
Documentation/PCI/pciebus-howto.rst=152=driver.
--
Documentation/PCI/pciebus-howto.rst-172-
Documentation/PCI/pciebus-howto.rst:173: module_init(aerdrv_service_init);
Documentation/PCI/pciebus-howto.rst-174- module_exit(aerdrv_service_exit);
--
Documentation/admin-guide/reporting-issues.rst=1008=the code the kernel was executing when the error occurred::
Documentation/admin-guide/reporting-issues.rst-1009-
Documentation/admin-guide/reporting-issues.rst:1010: [ 68.387301] RIP: 0010:test_module_init+0x5/0xffa [test_module]
Documentation/admin-guide/reporting-issues.rst-1011-
Documentation/admin-guide/reporting-issues.rst=1012=Once decoded, these lines will look like this::
Documentation/admin-guide/reporting-issues.rst-1013-
Documentation/admin-guide/reporting-issues.rst:1014: [ 68.387301] RIP: 0010:test_module_init (/home/username/linux-5.10.5/test-module/test-module.c:16) test_module
Documentation/admin-guide/reporting-issues.rst-1015-
--
Documentation/arch/s390/s390dbf.rst=124=Examples
--
Documentation/arch/s390/s390dbf.rst-156-
Documentation/arch/s390/s390dbf.rst:157: module_init(init);
Documentation/arch/s390/s390dbf.rst-158- module_exit(cleanup);
--
Documentation/arch/s390/s390dbf.rst-189-
Documentation/arch/s390/s390dbf.rst:190: module_init(init);
Documentation/arch/s390/s390dbf.rst-191- module_exit(cleanup);
--
Documentation/core-api/local_ops.rst=136=Here is a sample module which implements a basic per cpu counter using
--
Documentation/core-api/local_ops.rst-196-
Documentation/core-api/local_ops.rst:197: module_init(test_init);
Documentation/core-api/local_ops.rst-198- module_exit(test_exit);
--
Documentation/cpu-freq/cpu-drivers.rst=33=on what is necessary:
--
Documentation/cpu-freq/cpu-drivers.rst-38-
Documentation/cpu-freq/cpu-drivers.rst:39:First of all, in an __initcall level 7 (module_init()) or later
Documentation/cpu-freq/cpu-drivers.rst-40-function check whether this kernel runs on the right CPU and the right
--
Documentation/dev-tools/kunit/architecture.rst=96=When built as a module, the ``kunit_test_suites()`` macro defines a
Documentation/dev-tools/kunit/architecture.rst:97:``module_init()`` function, which runs all the tests in the compilation
Documentation/dev-tools/kunit/architecture.rst-98-unit instead of utilizing the executor.
--
Documentation/driver-api/driver-model/porting.rst=36=Step 1: Registering the bus driver.
--
Documentation/driver-api/driver-model/porting.rst-48- This should be done in the initialization function for the bus type,
Documentation/driver-api/driver-model/porting.rst:49: which is usually the module_init(), or equivalent, function::
Documentation/driver-api/driver-model/porting.rst-50-
--
Documentation/driver-api/isa.rst=25=The usage model this provides is nice, and has been acked from the ALSA
Documentation/driver-api/isa.rst:26:side by Takashi Iwai and Jaroslav Kysela. The ALSA driver module_init's
Documentation/driver-api/isa.rst-27-now (for oldisa-only drivers) become::
--
Documentation/driver-api/isa.rst=117=boilerplate code. Each module may only use this macro once, and calling
Documentation/driver-api/isa.rst:118:it replaces module_init and module_exit.
Documentation/driver-api/isa.rst-119-
--
Documentation/driver-api/mei/mei-client-bus.rst=80=The driver init and exit routines for this device would look like:
--
Documentation/driver-api/mei/mei-client-bus.rst-119-
Documentation/driver-api/mei/mei-client-bus.rst:120: module_init(contact_init);
Documentation/driver-api/mei/mei-client-bus.rst-121- module_exit(contact_exit);
--
Documentation/driver-api/men-chameleon-bus.rst=160=module at the MCB core::
--
Documentation/driver-api/men-chameleon-bus.rst-165- }
Documentation/driver-api/men-chameleon-bus.rst:166: module_init(foo_init);
Documentation/driver-api/men-chameleon-bus.rst-167-
--
Documentation/driver-api/mtdnand.rst=210=necessary information about the device.
--
Documentation/driver-api/mtdnand.rst-263- }
Documentation/driver-api/mtdnand.rst:264: module_init(board_init);
Documentation/driver-api/mtdnand.rst-265-
--
Documentation/driver-api/usb/writing_usb_driver.rst=88=usually in the driver's init function, as shown here::
--
Documentation/driver-api/usb/writing_usb_driver.rst-103- }
Documentation/driver-api/usb/writing_usb_driver.rst:104: module_init(usb_skel_init);
Documentation/driver-api/usb/writing_usb_driver.rst-105-
--
Documentation/filesystems/configfs.rst=341=struct configfs_subsystem
--
Documentation/filesystems/configfs.rst-343-
Documentation/filesystems/configfs.rst:344:A subsystem must register itself, usually at module_init time. This
Documentation/filesystems/configfs.rst-345-tells configfs to make the subsystem appear in the file tree::
--
Documentation/filesystems/seq_file.rst=347=code, that is done in the initialization code in the usual way::
--
Documentation/filesystems/seq_file.rst-356-
Documentation/filesystems/seq_file.rst:357: module_init(ct_init);
Documentation/filesystems/seq_file.rst-358-
--
Documentation/i2c/writing-clients.rst=229=driver module is usually enough.
--
Documentation/i2c/writing-clients.rst-236- }
Documentation/i2c/writing-clients.rst:237: module_init(foo_init);
Documentation/i2c/writing-clients.rst-238-
--
Documentation/input/input-programming.rst=10=pressed or released a BUTTON_IRQ happens. The driver could look like::
--
Documentation/input/input-programming.rst-67-
Documentation/input/input-programming.rst:68: module_init(button_init);
Documentation/input/input-programming.rst-69- module_exit(button_exit);
--
Documentation/kbuild/makefiles.rst=122=Link order is significant, because certain functions
Documentation/kbuild/makefiles.rst:123:(module_init() / __initcall) will be called during boot in the
Documentation/kbuild/makefiles.rst-124-order they appear. So keep in mind that changing the link
--
Documentation/kernel-hacking/hacking.rst=437=will break.
Documentation/kernel-hacking/hacking.rst-438-
Documentation/kernel-hacking/hacking.rst:439:__initcall()/module_init()
Documentation/kernel-hacking/hacking.rst-440---------------------------
--
Documentation/kernel-hacking/hacking.rst=444=Many parts of the kernel are well served as a module
Documentation/kernel-hacking/hacking.rst-445-(dynamically-loadable parts of the kernel). Using the
Documentation/kernel-hacking/hacking.rst:446:module_init() and module_exit() macros it
Documentation/kernel-hacking/hacking.rst-447-is easy to write code without #ifdefs which can operate both as a module
Documentation/kernel-hacking/hacking.rst=448=or built into the kernel.
Documentation/kernel-hacking/hacking.rst-449-
Documentation/kernel-hacking/hacking.rst:450:The module_init() macro defines which function is to be
Documentation/kernel-hacking/hacking.rst-451-called at module insertion time (if the file is compiled as a module),
Documentation/kernel-hacking/hacking.rst=452=or at boot time: if the file is not compiled as a module the
Documentation/kernel-hacking/hacking.rst:453:module_init() macro becomes equivalent to
Documentation/kernel-hacking/hacking.rst-454-__initcall(), which through linker magic ensures that
--
Documentation/livepatch/cumulative-patches.rst=61=Limitations:
--
Documentation/livepatch/cumulative-patches.rst-69- to that patch. This is safe as long as the livepatches do _not_ do
Documentation/livepatch/cumulative-patches.rst:70: extra modifications in (un)patching callbacks or in the module_init()
Documentation/livepatch/cumulative-patches.rst-71- or module_exit() functions, see below.
--
Documentation/livepatch/livepatch.rst=302=module is being loaded. For this, klp_enable_patch() has to be called
Documentation/livepatch/livepatch.rst:303:in the module_init() callback. There are two main reasons:
Documentation/livepatch/livepatch.rst-304-
--
Documentation/livepatch/livepatch.rst=314=The livepatch gets enabled by calling klp_enable_patch() from
Documentation/livepatch/livepatch.rst:315:the module_init() callback. The system will start using the new
Documentation/livepatch/livepatch.rst-316-implementation of the patched functions at this stage.
--
Documentation/locking/spinlocks.rst=150=appropriate::
--
Documentation/locking/spinlocks.rst-161-
Documentation/locking/spinlocks.rst:162: module_init(xxx_init);
Documentation/locking/spinlocks.rst-163-
--
Documentation/scsi/ChangeLog.lpfc=47=Changes from 20050308 to 20050323
--
Documentation/scsi/ChangeLog.lpfc-68- a multi-value file which is against the sysfs guidelines).
Documentation/scsi/ChangeLog.lpfc:69: * Change pci_module_init to pci_register_module() with appropriate
Documentation/scsi/ChangeLog.lpfc-70- ifdefs.
--
Documentation/scsi/ChangeLog.lpfc=425=Changes from 20041207 to 20041213
--
Documentation/scsi/ChangeLog.lpfc-434- * Integrate Christoph Hellwig's patch for 8.0.14: if
Documentation/scsi/ChangeLog.lpfc:435: pci_module_init fails we need to release the transport template.
Documentation/scsi/ChangeLog.lpfc-436- (also don't print the driver name at startup, linux drivers can
--
Documentation/scsi/ChangeLog.lpfc=1275=Changes from 20040507 to 20040515
--
Documentation/scsi/ChangeLog.lpfc-1292- * Remove unnecessary memset to 0 of lpfcDRVR
Documentation/scsi/ChangeLog.lpfc:1293: * Attach driver attributes always unless pci_module_init failed
Documentation/scsi/ChangeLog.lpfc-1294- * Remove all one-line wrappers from lpfc_mem.
--
Documentation/scsi/ChangeLog.megaraid=202=Older Version : 2.20.4.5 (scsi module), 2.20.2.5 (cmm module)
--
Documentation/scsi/ChangeLog.megaraid-215-
Documentation/scsi/ChangeLog.megaraid:216:3. Convert pci_module_init to pci_register_driver
Documentation/scsi/ChangeLog.megaraid:217: Convert from pci_module_init to pci_register_driver
Documentation/scsi/ChangeLog.megaraid-218- (from:http://kernelnewbies.org/KernelJanitors/TODO)
--
Documentation/sound/kernel-api/writing-an-alsa-driver.rst=698=destructor and PCI entries. Example code is shown first, below::
--
Documentation/sound/kernel-api/writing-an-alsa-driver.rst-819-
Documentation/sound/kernel-api/writing-an-alsa-driver.rst:820: module_init(alsa_card_mychip_init)
Documentation/sound/kernel-api/writing-an-alsa-driver.rst-821- module_exit(alsa_card_mychip_exit)
--
Documentation/sound/kernel-api/writing-an-alsa-driver.rst=1075=And at last, the module entries::
--
Documentation/sound/kernel-api/writing-an-alsa-driver.rst-1086-
Documentation/sound/kernel-api/writing-an-alsa-driver.rst:1087: module_init(alsa_card_mychip_init)
Documentation/sound/kernel-api/writing-an-alsa-driver.rst-1088- module_exit(alsa_card_mychip_exit)
--
Documentation/timers/hpet.rst=22=The driver supports detection of HPET driver allocation and initialization
Documentation/timers/hpet.rst:23:of the HPET before the driver module_init routine is called. This enables
Documentation/timers/hpet.rst-24-platform code which uses timer 0 or 1 as the main timer to intercept HPET
--
Documentation/translations/it_IT/kernel-hacking/hacking.rst=464=esportata ai moduli utilizzando :c:func:`EXPORT_SYMBOL()` o
--
Documentation/translations/it_IT/kernel-hacking/hacking.rst-467-
Documentation/translations/it_IT/kernel-hacking/hacking.rst:468::c:func:`__initcall()`/:c:func:`module_init()`
Documentation/translations/it_IT/kernel-hacking/hacking.rst-469-----------------------------------------------
--
Documentation/translations/it_IT/kernel-hacking/hacking.rst=473=Molte parti del kernel funzionano bene come moduli (componenti del kernel
Documentation/translations/it_IT/kernel-hacking/hacking.rst:474:caricabili dinamicamente). L'utilizzo delle macro :c:func:`module_init()`
Documentation/translations/it_IT/kernel-hacking/hacking.rst-475-e :c:func:`module_exit()` semplifica la scrittura di codice che può funzionare
Documentation/translations/it_IT/kernel-hacking/hacking.rst=476=sia come modulo, sia come parte del kernel, senza l'ausilio di #ifdef.
Documentation/translations/it_IT/kernel-hacking/hacking.rst-477-
Documentation/translations/it_IT/kernel-hacking/hacking.rst:478:La macro :c:func:`module_init()` definisce quale funzione dev'essere
Documentation/translations/it_IT/kernel-hacking/hacking.rst-479-chiamata quando il modulo viene inserito (se il file è stato compilato come
Documentation/translations/it_IT/kernel-hacking/hacking.rst=480=tale), o in fase di avvio : se il file non è stato compilato come modulo la
Documentation/translations/it_IT/kernel-hacking/hacking.rst:481:macro :c:func:`module_init()` diventa equivalente a :c:func:`__initcall()`,
Documentation/translations/it_IT/kernel-hacking/hacking.rst-482-la quale, tramite qualche magia del linker, s'assicura che la funzione venga
--
Documentation/translations/zh_CN/PCI/pci.rst=99=pci_device_id表。
--
Documentation/translations/zh_CN/PCI/pci.rst-136-
Documentation/translations/zh_CN/PCI/pci.rst:137: - module_init()/module_exit()函数(以及所有仅由这些函数调用的初始化函数)应该被标记
Documentation/translations/zh_CN/PCI/pci.rst-138-
--
Documentation/translations/zh_CN/PCI/pciebus-howto.rst=108=pcie_port_service_unregister取代了Linux驱动模型的pci_unregister_driver。当一
--
Documentation/translations/zh_CN/PCI/pciebus-howto.rst-156-
Documentation/translations/zh_CN/PCI/pciebus-howto.rst:157: module_init(aerdrv_service_init);
Documentation/translations/zh_CN/PCI/pciebus-howto.rst-158- module_exit(aerdrv_service_exit);
--
Documentation/translations/zh_CN/admin-guide/reporting-issues.rst=751=CONFIG_DEBUG_INFO 和 CONFIG_KALLSYMS选项时,这种方法才起效。如果已启用此选项,
--
Documentation/translations/zh_CN/admin-guide/reporting-issues.rst-768-
Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:769: [ 68.387301] RIP: 0010:test_module_init+0x5/0xffa [test_module]
Documentation/translations/zh_CN/admin-guide/reporting-issues.rst-770-
--
Documentation/translations/zh_CN/admin-guide/reporting-issues.rst-772-
Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:773: [ 68.387301] RIP: 0010:test_module_init (/home/username/linux-5.10.5/test-module/test-module.c:16) test_module
Documentation/translations/zh_CN/admin-guide/reporting-issues.rst-774-
--
Documentation/translations/zh_CN/core-api/local_ops.rst=51=UP之间没有不同的行为,在你的架构的 ``local.h`` 中包括 ``asm-generic/local.h``
--
Documentation/translations/zh_CN/core-api/local_ops.rst-190-
Documentation/translations/zh_CN/core-api/local_ops.rst:191: module_init(test_init);
Documentation/translations/zh_CN/core-api/local_ops.rst-192- module_exit(test_exit);
--
Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst-49-
Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst:50:首先,在 __initcall level 7 (module_init())或更靠后的函数中检查这个内核是否
Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst-51-运行在正确的CPU和正确的芯片组上。如果是,则使用cpufreq_register_driver()向
--
Documentation/translations/zh_CN/kernel-hacking/hacking.rst=347=CPU上运行。
--
Documentation/translations/zh_CN/kernel-hacking/hacking.rst-373-
Documentation/translations/zh_CN/kernel-hacking/hacking.rst:374::c:func:`__initcall()`/:c:func:`module_init()`
Documentation/translations/zh_CN/kernel-hacking/hacking.rst-375-----------------------------------------------
--
Documentation/translations/zh_CN/kernel-hacking/hacking.rst-379-内核的许多部分都作为模块(内核的可动态加载部分)良好服务。使用
Documentation/translations/zh_CN/kernel-hacking/hacking.rst:380::c:func:`module_init()` 和 :c:func:`module_exit()` 宏可以简化代码编写,无需
Documentation/translations/zh_CN/kernel-hacking/hacking.rst-381-``#ifdef`` ,即可以作为模块运行或内置在内核中。
Documentation/translations/zh_CN/kernel-hacking/hacking.rst-382-
Documentation/translations/zh_CN/kernel-hacking/hacking.rst:383::c:func:`module_init()` 宏定义在模块插入时(如果文件编译为模块)或在引导时
Documentation/translations/zh_CN/kernel-hacking/hacking.rst:384:调用哪个函数:如果文件未编译为模块,:c:func:`module_init()` 宏将等效于
Documentation/translations/zh_CN/kernel-hacking/hacking.rst-385-:c:func:`__initcall()` ,它通过链接器的魔力确保在引导时调用该函数。
--
Documentation/translations/zh_CN/locking/spinlocks.rst-145-
Documentation/translations/zh_CN/locking/spinlocks.rst:146: module_init(xxx_init);
Documentation/translations/zh_CN/locking/spinlocks.rst-147-
--
Documentation/translations/zh_TW/admin-guide/reporting-issues.rst=752=CONFIG_DEBUG_INFO 和 CONFIG_KALLSYMS選項時,這種方法才起效。如果已啓用此選項,
--
Documentation/translations/zh_TW/admin-guide/reporting-issues.rst-769-
Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:770: [ 68.387301] RIP: 0010:test_module_init+0x5/0xffa [test_module]
Documentation/translations/zh_TW/admin-guide/reporting-issues.rst-771-
--
Documentation/translations/zh_TW/admin-guide/reporting-issues.rst-773-
Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:774: [ 68.387301] RIP: 0010:test_module_init (/home/username/linux-5.10.5/test-module/test-module.c:16) test_module
Documentation/translations/zh_TW/admin-guide/reporting-issues.rst-775-
--
Documentation/translations/zh_TW/cpu-freq/cpu-drivers.rst-49-
Documentation/translations/zh_TW/cpu-freq/cpu-drivers.rst:50:首先,在 __initcall level 7 (module_init())或更靠後的函數中檢查這個內核是否
Documentation/translations/zh_TW/cpu-freq/cpu-drivers.rst-51-運行在正確的CPU和正確的芯片組上。如果是,則使用cpufreq_register_driver()向
--
arch/alpha/kernel/srm_env.c=211=srm_env_exit(void)
--
arch/alpha/kernel/srm_env.c-216-
arch/alpha/kernel/srm_env.c:217:module_init(srm_env_init);
arch/alpha/kernel/srm_env.c-218-module_exit(srm_env_exit);
--
arch/alpha/math-emu/math.c=63=static int alpha_fp_emul_init_module(void)
--
arch/alpha/math-emu/math.c-70-}
arch/alpha/math-emu/math.c:71:module_init(alpha_fp_emul_init_module);
arch/alpha/math-emu/math.c-72-
--
arch/arc/kernel/arc_hostlink.c=50=static int __init arc_hl_init(void)
--
arch/arc/kernel/arc_hostlink.c-54-}
arch/arc/kernel/arc_hostlink.c:55:module_init(arc_hl_init);
--
arch/arm/boot/dts/ti/omap/omap4.dtsi=53= cpu@1 {
--
arch/arm/boot/dts/ti/omap/omap4.dtsi-62- * Needed early by omap4_sram_init() for barrier, do not move to l3
arch/arm/boot/dts/ti/omap/omap4.dtsi:63: * interconnect as simple-pm-bus probes at module_init() time.
arch/arm/boot/dts/ti/omap/omap4.dtsi-64- */
--
arch/arm/boot/dts/ti/omap/omap5.dtsi=103= pmu {
--
arch/arm/boot/dts/ti/omap/omap5.dtsi-110- * Needed early by omap4_sram_init() for barrier, do not move to l3
arch/arm/boot/dts/ti/omap/omap5.dtsi:111: * interconnect as simple-pm-bus probes at module_init() time.
arch/arm/boot/dts/ti/omap/omap5.dtsi-112- */
--
arch/arm/common/locomo.c=875=static void __exit locomo_exit(void)
--
arch/arm/common/locomo.c-880-
arch/arm/common/locomo.c:881:module_init(locomo_init);
arch/arm/common/locomo.c-882-module_exit(locomo_exit);
--
arch/arm/crypto/aes-neonbs-glue.c=405=static int __init aes_init(void)
--
arch/arm/crypto/aes-neonbs-glue.c-412-
arch/arm/crypto/aes-neonbs-glue.c:413:module_init(aes_init);
arch/arm/crypto/aes-neonbs-glue.c-414-module_exit(aes_exit);
--
arch/arm/crypto/ghash-ce-glue.c=440=static void __exit ghash_ce_mod_exit(void)
--
arch/arm/crypto/ghash-ce-glue.c-444-
arch/arm/crypto/ghash-ce-glue.c:445:module_init(ghash_ce_mod_init);
arch/arm/crypto/ghash-ce-glue.c-446-module_exit(ghash_ce_mod_exit);
--
arch/arm/kernel/module-plts.c=46=u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val)
arch/arm/kernel/module-plts.c-47-{
arch/arm/kernel/module-plts.c:48: struct mod_plt_sec *pltsec = !within_module_init(loc, mod) ?
arch/arm/kernel/module-plts.c-49- &mod->arch.core : &mod->arch.init;
--
arch/arm/kernel/module-plts.c=209=int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
--
arch/arm/kernel/module-plts.c-265-
arch/arm/kernel/module-plts.c:266: if (!module_init_layout_section(secstrings + dstsec->sh_name))
arch/arm/kernel/module-plts.c-267- core_plts += count_plts(syms, dstsec->sh_addr, rels,
--
arch/arm/kernel/module.c-22-
arch/arm/kernel/module.c:23:bool module_init_section(const char *name)
arch/arm/kernel/module.c-24-{
--
arch/arm/mach-omap1/ocpi.c=96=MODULE_LICENSE("GPL");
arch/arm/mach-omap1/ocpi.c:97:module_init(omap_ocpi_init);
arch/arm/mach-omap1/ocpi.c-98-module_exit(omap_ocpi_exit);
--
arch/arm/mach-pxa/spitz_pm.c=251=static void spitzpm_exit(void)
--
arch/arm/mach-pxa/spitz_pm.c-255-
arch/arm/mach-pxa/spitz_pm.c:256:module_init(spitzpm_init);
arch/arm/mach-pxa/spitz_pm.c-257-module_exit(spitzpm_exit);
--
arch/arm/mach-sa1100/jornada720_ssp.c=197=static int __init jornada_ssp_init(void)
--
arch/arm/mach-sa1100/jornada720_ssp.c-201-
arch/arm/mach-sa1100/jornada720_ssp.c:202:module_init(jornada_ssp_init);
--
arch/arm/nwfpe/fpmodule.c=131=void float_raise(signed char flags)
--
arch/arm/nwfpe/fpmodule.c-168-
arch/arm/nwfpe/fpmodule.c:169:module_init(fpe_init);
arch/arm/nwfpe/fpmodule.c-170-module_exit(fpe_exit);
--
arch/arm/probes/kprobes/test-core.c=1660=static void __exit kprobe_test_exit(void)
--
arch/arm/probes/kprobes/test-core.c-1663-
arch/arm/probes/kprobes/test-core.c:1664:module_init(run_all_tests)
arch/arm/probes/kprobes/test-core.c-1665-module_exit(kprobe_test_exit)
--
arch/arm64/crypto/aes-ce-ccm-glue.c=313=static void __exit aes_mod_exit(void)
--
arch/arm64/crypto/aes-ce-ccm-glue.c-317-
arch/arm64/crypto/aes-ce-ccm-glue.c:318:module_init(aes_mod_init);
arch/arm64/crypto/aes-ce-ccm-glue.c-319-module_exit(aes_mod_exit);
--
arch/arm64/crypto/aes-glue.c=722=module_cpu_feature_match(AES, aes_init);
arch/arm64/crypto/aes-glue.c-723-#else
arch/arm64/crypto/aes-glue.c:724:module_init(aes_init);
arch/arm64/crypto/aes-glue.c-725-#endif
--
arch/arm64/crypto/aes-neonbs-glue.c=455=static int __init aes_init(void)
--
arch/arm64/crypto/aes-neonbs-glue.c-462-
arch/arm64/crypto/aes-neonbs-glue.c:463:module_init(aes_init);
arch/arm64/crypto/aes-neonbs-glue.c-464-module_exit(aes_exit);
--
arch/arm64/crypto/ghash-ce-glue.c=401=MODULE_DEVICE_TABLE(cpu, ghash_cpu_feature);
arch/arm64/crypto/ghash-ce-glue.c-402-
arch/arm64/crypto/ghash-ce-glue.c:403:module_init(ghash_ce_mod_init);
arch/arm64/crypto/ghash-ce-glue.c-404-module_exit(ghash_ce_mod_exit);
--
arch/arm64/crypto/sm4-neon-glue.c=233=static void __exit sm4_exit(void)
--
arch/arm64/crypto/sm4-neon-glue.c-237-
arch/arm64/crypto/sm4-neon-glue.c:238:module_init(sm4_init);
arch/arm64/crypto/sm4-neon-glue.c-239-module_exit(sm4_exit);
--
arch/arm64/kernel/module-plts.c=69=u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs,
--
arch/arm64/kernel/module-plts.c-72-{
arch/arm64/kernel/module-plts.c:73: struct mod_plt_sec *pltsec = !within_module_init((unsigned long)loc, mod) ?
arch/arm64/kernel/module-plts.c-74- &mod->arch.core : &mod->arch.init;
--
arch/arm64/kernel/module-plts.c=101=u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs,
--
arch/arm64/kernel/module-plts.c-103-{
arch/arm64/kernel/module-plts.c:104: struct mod_plt_sec *pltsec = !within_module_init((unsigned long)loc, mod) ?
arch/arm64/kernel/module-plts.c-105- &mod->arch.core : &mod->arch.init;
--
arch/arm64/kernel/module-plts.c=280=int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
--
arch/arm64/kernel/module-plts.c-337-
arch/arm64/kernel/module-plts.c:338: if (!module_init_layout_section(secstrings + dstsec->sh_name))
arch/arm64/kernel/module-plts.c-339- core_plts += count_plts(syms, rels, numrels,
--
arch/arm64/kernel/module.c=447=static inline void __init_plt(struct plt_entry *plt, unsigned long addr)
--
arch/arm64/kernel/module.c-451-
arch/arm64/kernel/module.c:452:static int module_init_ftrace_plt(const Elf_Ehdr *hdr,
arch/arm64/kernel/module.c-453- const Elf_Shdr *sechdrs,
--
arch/arm64/kernel/module.c=484=int module_finalize(const Elf_Ehdr *hdr,
--
arch/arm64/kernel/module.c-517-
arch/arm64/kernel/module.c:518: return module_init_ftrace_plt(hdr, sechdrs, me);
arch/arm64/kernel/module.c-519-}
--
arch/arm64/kernel/reloc_test_core.c=70=static void __exit reloc_test_exit(void)
--
arch/arm64/kernel/reloc_test_core.c-73-
arch/arm64/kernel/reloc_test_core.c:74:module_init(reloc_test_init);
arch/arm64/kernel/reloc_test_core.c-75-module_exit(reloc_test_exit);
--
arch/arm64/kvm/arm.c=3142=enum kvm_mode kvm_get_mode(void)
--
arch/arm64/kvm/arm.c-3146-
arch/arm64/kvm/arm.c:3147:module_init(kvm_arm_init);
--
arch/arm64/mm/init.c=427=static u64 __init random_bounding_box(u64 size, u64 start, u64 end)
--
arch/arm64/mm/init.c-459- */
arch/arm64/mm/init.c:460:static int __init module_init_limits(void)
arch/arm64/mm/init.c-461-{
--
arch/arm64/mm/init.c=505=struct execmem_info __init *execmem_arch_setup(void)
--
arch/arm64/mm/init.c-509-
arch/arm64/mm/init.c:510: module_init_limits();
arch/arm64/mm/init.c-511-
--
arch/loongarch/include/asm/unwind.h=91=void unwind_init(void);
arch/loongarch/include/asm/unwind.h:92:void unwind_module_init(struct module *mod, void *orc_ip, size_t orc_ip_size, void *orc, size_t orc_size);
arch/loongarch/include/asm/unwind.h-93-#else
arch/loongarch/include/asm/unwind.h=94=static inline void unwind_init(void) {}
arch/loongarch/include/asm/unwind.h:95:static inline void unwind_module_init(struct module *mod, void *orc_ip, size_t orc_ip_size, void *orc, size_t orc_size) {}
arch/loongarch/include/asm/unwind.h-96-#endif
--
arch/loongarch/kernel/module.c=473=int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
--
arch/loongarch/kernel/module.c-588-
arch/loongarch/kernel/module.c:589:static void module_init_ftrace_plt(const Elf_Ehdr *hdr,
arch/loongarch/kernel/module.c-590- const Elf_Shdr *sechdrs, struct module *mod)
--
arch/loongarch/kernel/module.c=606=int module_finalize(const Elf_Ehdr *hdr,
--
arch/loongarch/kernel/module.c-626- if (orc && orc_ip)
arch/loongarch/kernel/module.c:627: unwind_module_init(mod, (void *)orc_ip->sh_addr, orc_ip->sh_size, (void *)orc->sh_addr, orc->sh_size);
arch/loongarch/kernel/module.c-628-
arch/loongarch/kernel/module.c-629- if (ftrace)
arch/loongarch/kernel/module.c:630: module_init_ftrace_plt(hdr, ftrace, mod);
arch/loongarch/kernel/module.c-631-
--
arch/loongarch/kernel/unwind_orc.c=220=static int orc_sort_cmp(const void *_a, const void *_b)
--
arch/loongarch/kernel/unwind_orc.c-242-
arch/loongarch/kernel/unwind_orc.c:243:void unwind_module_init(struct module *mod, void *_orc_ip, size_t orc_ip_size,
arch/loongarch/kernel/unwind_orc.c-244- void *_orc, size_t orc_size)
--
arch/loongarch/kvm/main.c=433=static void kvm_loongarch_exit(void)
--
arch/loongarch/kvm/main.c-438-
arch/loongarch/kvm/main.c:439:module_init(kvm_loongarch_init);
arch/loongarch/kvm/main.c-440-module_exit(kvm_loongarch_exit);
--
arch/m68k/bvme6000/rtc.c=167=static int __init rtc_DP8570A_init(void)
--
arch/m68k/bvme6000/rtc.c-174-}
arch/m68k/bvme6000/rtc.c:175:module_init(rtc_DP8570A_init);
--
arch/m68k/emu/nfblock.c=182=static void __exit nfhd_exit(void)
--
arch/m68k/emu/nfblock.c-194-
arch/m68k/emu/nfblock.c:195:module_init(nfhd_init);
arch/m68k/emu/nfblock.c-196-module_exit(nfhd_exit);
--
arch/m68k/emu/nfcon.c=165=static void __exit nfcon_exit(void)
--
arch/m68k/emu/nfcon.c-172-
arch/m68k/emu/nfcon.c:173:module_init(nfcon_init);
arch/m68k/emu/nfcon.c-174-module_exit(nfcon_exit);
--
arch/m68k/emu/nfeth.c=251=static void __exit nfeth_cleanup(void)
--
arch/m68k/emu/nfeth.c-263-
arch/m68k/emu/nfeth.c:264:module_init(nfeth_init);
arch/m68k/emu/nfeth.c-265-module_exit(nfeth_cleanup);
--
arch/m68k/kernel/setup_mm.c=500=static int __init proc_hardware_init(void)
--
arch/m68k/kernel/setup_mm.c-504-}
]
]
|
| 70/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 68096
output: 49
thoughts: 44
Thoughts: Okay, let me think this through.
**Navigating the RPC/RDMA Landscape**
Hmm, where did I see that `rpcrdma` module again? Ah, right, it lives in `net/sunrpc/xprtrdma/`. Okay, that makes sense given the relationship. So, to get a clear picture of what's going on, the logical next step is to examine the source code for the module itself. I'll need to dive into `net/sunrpc/xprtrdma/module.c` to understand its core functionality and how it's integrated within that directory. That's where the real detail will be.
|
| 71/2 |
2026/05/24 09:09 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:net/sunrpc/xprtrdma/module.c IncludeLines:true Name:rpc_rdma_init]
Results: map[SourceCode: SourceFile:]
|
| 72/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 68352
output: 29
thoughts: 20
Thoughts: Here's my take on the thoughts, rendered as a first-person summary, keeping in mind my expertise:
**Diving into `net/sunrpc/xprtrdma/module.c`**
Alright, time to crack open `net/sunrpc/xprtrdma/module.c`. This is where the rubber meets the road for the RDMA transport layer within the SunRPC framework. I'm expecting to see the core module initialization and exit routines, likely including the registration and unregistration of the transport protocol itself. I'll be looking specifically for how they handle the RDMA-specific aspects – the setup of the device context, memory registration, and the interaction with the underlying verbs API. I'll want to see how they integrate with the socket layer. I want to pay attention to how they handle the details for memory mapping and zero-copy transfers, because that's where the real performance benefit of RDMA lies. Let's see how they manage resource allocation and error handling, especially in the context of network congestion and potential RDMA-specific issues. I'm keen to spot the clever bits, the places where they've had to optimize or work around limitations of the verbs API or the kernel's memory management. I'm anticipating some intricate locking strategies to handle concurrent access to the RDMA resources and data structures, so that'll be something I'll focus on. Ultimately, I'm hoping to get a clear picture of how they've built a robust and efficient RDMA-based RPC transport. Let's dig in.
|
| 73/2 |
2026/05/24 09:09 |
tool |
read-file |
0m
Args: map[File:net/sunrpc/xprtrdma/module.c]
Results: map[Contents:// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Copyright (c) 2015, 2017 Oracle. All rights reserved.
*/
/* rpcrdma.ko module initialization
*/
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sunrpc/svc_rdma.h>
#include <linux/sunrpc/rdma_rn.h>
#include <asm/swab.h>
#include "xprt_rdma.h"
#define CREATE_TRACE_POINTS
#include <trace/events/rpcrdma.h>
MODULE_AUTHOR("Open Grid Computing and Network Appliance, Inc.");
MODULE_DESCRIPTION("RPC/RDMA Transport");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_ALIAS("svcrdma");
MODULE_ALIAS("xprtrdma");
MODULE_ALIAS("rpcrdma6");
static void __exit rpc_rdma_cleanup(void)
{
xprt_rdma_cleanup();
svc_rdma_cleanup();
rpcrdma_ib_client_unregister();
}
static int __init rpc_rdma_init(void)
{
int rc;
rc = rpcrdma_ib_client_register();
if (rc)
goto out_rc;
rc = svc_rdma_init();
if (rc)
goto out_ib_client;
rc = xprt_rdma_init();
if (rc)
goto out_svc_rdma;
return 0;
out_svc_rdma:
svc_rdma_cleanup();
out_ib_client:
rpcrdma_ib_client_unregister();
out_rc:
return rc;
}
module_init(rpc_rdma_init);
module_exit(rpc_rdma_cleanup);
]
|
| 74/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 69221
output: 52
thoughts: 12
Thoughts: Okay, here's my attempt at summarizing that thought process, keeping in mind I'm speaking to a fellow expert:
**Investigating `svc_rdma_init`**
Alright, time to dive in. Let's see what's happening with `svc_rdma_init`. I need to get a clear picture of what this function is doing. Where does it fit into the broader picture of RDMA service initialization? Are there any obvious red flags I need to watch out for? What key data structures is it setting up? Let's check the code and see what we can find. I want to build a mental map of its control flow and dependencies.
|
| 75/2 |
2026/05/24 09:09 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:net/sunrpc/xprtrdma/svc_rdma.c IncludeLines:true Name:svc_rdma_init]
Results: map[SourceCode: SourceFile:]
|
| 76/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 69447
output: 20
thoughts: 13
Thoughts: Okay, here's my attempt at summarizing that thought process, tailored for an expert audience:
**Investigating the `svc_rdma_init` Function**
Alright, let's dive into this. The objective is to understand the implications of the function `svc_rdma_init`. I'm immediately thinking of the kernel space, probably somewhere within the RDMA (Remote Direct Memory Access) subsystem if I had to guess. I'm assuming it's an initialization function for a specific RDMA service or module – "svc" strongly suggests service. My experience tells me this will likely involve setup for connection management, resource allocation (like memory regions or protection domains), and perhaps registration with the appropriate RDMA transport provider. I'd be looking for how it handles things like error conditions and potential race conditions during its startup. Does it involve locking mechanisms? What resources are being initialized and how are they tracked? Also, is it a module load, or part of the core kernel code? This initial exploration will guide the detailed analysis to follow.
|
| 77/2 |
2026/05/24 09:09 |
tool |
grepper |
0m
Args: map[Expression:svc_rdma_init]
Results: map[Output:include/linux/sunrpc/svc_rdma.h=333=extern struct svc_xprt_class svc_rdma_bc_class;
--
include/linux/sunrpc/svc_rdma.h-336-/* svc_rdma.c */
include/linux/sunrpc/svc_rdma.h:337:extern int svc_rdma_init(void);
include/linux/sunrpc/svc_rdma.h-338-extern void svc_rdma_cleanup(void);
--
net/sunrpc/xprtrdma/module.c=37=static int __init rpc_rdma_init(void)
--
net/sunrpc/xprtrdma/module.c-44-
net/sunrpc/xprtrdma/module.c:45: rc = svc_rdma_init();
net/sunrpc/xprtrdma/module.c-46- if (rc)
--
net/sunrpc/xprtrdma/svc_rdma.c=269=void svc_rdma_cleanup(void)
--
net/sunrpc/xprtrdma/svc_rdma.c-282-
net/sunrpc/xprtrdma/svc_rdma.c:283:int svc_rdma_init(void)
net/sunrpc/xprtrdma/svc_rdma.c-284-{
]
|
| 78/2 |
2026/05/24 09:09 |
llm |
expert |
0m
Model:
Tokens:
input: 70060
output: 52
thoughts: 32
Thoughts: Okay, let's dive into this. Here's my thought process on this:
**Examining `svc_rdma_init` in `net/sunrpc/xprtrdma/svc_rdma.c`**
Alright, I need to get a handle on how RDMA support is initialized in the `sunrpc` subsystem. The first logical step is to check out `svc_rdma_init` function, which is located in `net/sunrpc/xprtrdma/svc_rdma.c`. I expect this to be the entry point for the RDMA-specific parts of the server-side RPC initialization. Knowing `svc_rdma_init` will likely give me a foundation of understanding the architecture. I'm hoping it clearly outlines the module's dependencies, resource allocation, and any initial setup required for the RDMA transport layer to be functional within the broader RPC framework. My goal is to understand how the RDMA transport is plumbed into the standard RPC server flow.
|
| 79/2 |
2026/05/24 09:10 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:net/sunrpc/xprtrdma/svc_rdma.c IncludeLines:true Name:svc_rdma_init]
Results: map[SourceCode: SourceFile:]
|
| 80/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 70381
output: 24
thoughts: 35
Thoughts: Here's my take on the line of thinking, presented as a personal reflection:
**Delving into the RDMA RPC Implementation**
Okay, let me quickly navigate to that `svc_rdma.c` file within the `net/sunrpc/xprtrdma` directory. Specifically, I need to get a closer look at what's happening around line 283. I suspect this is where the core logic for the RDMA-specific service implementation is. I'm probably looking for something dealing with transport level details. Perhaps it deals with connection establishment, data transfer handling, or error management. I'm keen to understand how this code specifically leverages RDMA capabilities within the broader RPC framework. Hopefully it is well documented, so I can save myself some time.
|
| 81/2 |
2026/05/24 09:10 |
tool |
grepper |
0m
Args: map[Expression:int svc_rdma_init\(void\)]
Results: map[Output:include/linux/sunrpc/svc_rdma.h=333=extern struct svc_xprt_class svc_rdma_bc_class;
--
include/linux/sunrpc/svc_rdma.h-336-/* svc_rdma.c */
include/linux/sunrpc/svc_rdma.h:337:extern int svc_rdma_init(void);
include/linux/sunrpc/svc_rdma.h-338-extern void svc_rdma_cleanup(void);
--
net/sunrpc/xprtrdma/svc_rdma.c=269=void svc_rdma_cleanup(void)
--
net/sunrpc/xprtrdma/svc_rdma.c-282-
net/sunrpc/xprtrdma/svc_rdma.c:283:int svc_rdma_init(void)
net/sunrpc/xprtrdma/svc_rdma.c-284-{
]
|
| 82/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 70858
output: 45
thoughts: 35
Thoughts: Here's my summary, as though I'm processing the code:
**Diving into svc_rdma.c - The RDMA Transport Layer**
Alright, let's take a look at `net/sunrpc/xprtrdma/svc_rdma.c`, focusing on lines 283 to 300. I need to refresh my understanding of how the RDMA transport layer behaves within the RPC framework. From the line numbers, I'm expecting this section to deal with some core function or data structure within the `svc_rdma` context. Considering the surrounding code, I'm betting this addresses connection management, registration/deregistration of memory regions, or possibly how incoming RDMA messages are parsed and handled by the server. I have a hunch it's how the connection gets established and handles requests. Given the `svc_rdma` context, I anticipate this segment is crucial for bridging the standard RPC client/server model with the low-level RDMA protocols. Now, let's see what the code reveals. Time to dissect and see if my assumptions hold true.
|
| 83/2 |
2026/05/24 09:10 |
tool |
git-blame |
0m
Args: map[End:310 File:net/sunrpc/xprtrdma/svc_rdma.c Start:283]
Results: map[Output:ef7fbf59e6f78 283) int svc_rdma_init(void)
ef7fbf59e6f78 284) {
9c7e1a06588ee 285) struct workqueue_struct *wq;
59a00257c66c2 286) int rc;
59a00257c66c2 287)
9c7e1a06588ee 288) wq = alloc_workqueue("svcrdma", WQ_UNBOUND, 0);
9c7e1a06588ee 289) if (!wq)
9c7e1a06588ee 290) return -ENOMEM;
a25e758c5fa11 291)
59a00257c66c2 292) rc = svc_rdma_proc_init();
9c7e1a06588ee 293) if (rc) {
9c7e1a06588ee 294) destroy_workqueue(wq);
59a00257c66c2 295) return rc;
9c7e1a06588ee 296) }
ef7fbf59e6f78 297)
9c7e1a06588ee 298) svcrdma_wq = wq;
ef7fbf59e6f78 299) svc_reg_xprt_class(&svc_rdma_class);
9c7e1a06588ee 300)
9c7e1a06588ee 301) dprintk("SVCRDMA Module Init, register RPC RDMA transport\n");
9c7e1a06588ee 302) dprintk("\tsvcrdma_ord : %d\n", svcrdma_ord);
9c7e1a06588ee 303) dprintk("\tmax_requests : %u\n", svcrdma_max_requests);
9c7e1a06588ee 304) dprintk("\tmax_bc_requests : %u\n", svcrdma_max_bc_requests);
9c7e1a06588ee 305) dprintk("\tmax_inline : %d\n", svcrdma_max_req_size);
ef7fbf59e6f78 306) return 0;
ef7fbf59e6f78 307) }
]
|
| 84/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 71896
output: 23
thoughts: 117
Thoughts: **Investigating Potential Deadlock in rpcrdma Module Initialization**
Okay, hold on a second. I was under the impression that the `rpc_rdma_init` function was responsible for registering the generic netlink family, but it doesn't actually call `genl_register_family` directly. That throws a wrench in my initial deadlock theory involving the `cb_lock`. So, loading the `rpcrdma` module itself shouldn't trigger that specific deadlock.
Now, let's rethink this. What *does* `rpc_rdma_init` call? Right, it calls `rpcrdma_ib_client_register()`, `svc_rdma_init()`, and `xprt_rdma_init()`. The crucial question is: do *any* of those three functions call `genl_register_family`? That's where the problem might lie. It's time to dive into the code for those three and figure this out. I'll start with `rpcrdma_ib_client_register`, it seems like a reasonable first step. Let's see what's what.
|
| 85/2 |
2026/05/24 09:10 |
tool |
grepper |
0m
Args: map[Expression:rpcrdma_ib_client_register]
Results: map[Output:include/linux/sunrpc/rdma_rn.h=22=void rpcrdma_rn_unregister(struct ib_device *device,
include/linux/sunrpc/rdma_rn.h-23- struct rpcrdma_notification *rn);
include/linux/sunrpc/rdma_rn.h:24:int rpcrdma_ib_client_register(void);
include/linux/sunrpc/rdma_rn.h-25-void rpcrdma_ib_client_unregister(void);
--
net/sunrpc/xprtrdma/ib_client.c=171=void rpcrdma_ib_client_unregister(void)
--
net/sunrpc/xprtrdma/ib_client.c-176-/**
net/sunrpc/xprtrdma/ib_client.c:177: * rpcrdma_ib_client_register - register ib_client for rpcrdma
net/sunrpc/xprtrdma/ib_client.c-178- *
--
net/sunrpc/xprtrdma/ib_client.c-180- */
net/sunrpc/xprtrdma/ib_client.c:181:int rpcrdma_ib_client_register(void)
net/sunrpc/xprtrdma/ib_client.c-182-{
--
net/sunrpc/xprtrdma/module.c=37=static int __init rpc_rdma_init(void)
--
net/sunrpc/xprtrdma/module.c-40-
net/sunrpc/xprtrdma/module.c:41: rc = rpcrdma_ib_client_register();
net/sunrpc/xprtrdma/module.c-42- if (rc)
]
|
| 86/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 72745
output: 44
thoughts: 34
Thoughts: Here's my take on the thought process, as requested:
**Diving into the RDMA Client Registration**
Okay, time to get my hands dirty. I need to understand how the RDMA client registration is handled in the `sunrpc` subsystem. My focus is on the `xprtrdma` implementation, so let's zero in on `rpcrdma_ib_client_register`. This function, located in `net/sunrpc/xprtrdma/ib_client.c`, should be the key entry point for this whole process. I'm expecting this to be where the resources for RDMA communication are set up or registered with the system. I anticipate this function handling the interaction with the InfiniBand hardware, potentially setting up memory registration, queues, and other relevant structures for efficient RDMA operations. Time to dive into the code and see if my assumptions hold true and exactly how this process unfolds.
|
| 87/2 |
2026/05/24 09:10 |
tool |
git-blame |
0m
Args: map[End:190 File:net/sunrpc/xprtrdma/ib_client.c Start:181]
Results: map[Output:7e86845a0346e 181) int rpcrdma_ib_client_register(void)
7e86845a0346e 182) {
7e86845a0346e 183) return ib_register_client(&rpcrdma_ib_client);
7e86845a0346e 184) }
]
|
| 88/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 73142
output: 23
thoughts: 101
Thoughts: **Investigating the Connection Between Infiniband Registration and Generic Netlink Families**
Okay, so I'm trying to figure out how these Infiniband drivers and Generic Netlink families hook up. My initial thought was whether `ib_register_client` calls `genl_register_family` directly. That seemed too simplistic, and a quick glance tells me no, it registers an IB client. Hmm. But what about dependencies? I need to think about module loading with `modprobe`. If I load a module, it could pull in others as dependencies, potentially creating the connection I'm looking for.
For instance, let's take `rpcrdma`. That relies on `ib_core`, `sunrpc`, `rdma_cm`, `iw_cm`, and probably a few others. So, does `rdma_cm` register a Generic Netlink family? That's the key question. I need to dive into the `rdma_cm` module's initialization code and see exactly what it's doing during startup. That's the next step to confirm my theory.
|
| 89/2 |
2026/05/24 09:10 |
tool |
grepper |
0m
Error:
Args: map[Expression:genl_register_family.*rdma]
Results:
|
| 90/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 73511
output: 21
thoughts: 29
Thoughts: Here's my thought process, summarized as you requested:
**Netlink Registration Inquiry**
Okay, hold on a second… `rdma_nl_register`? That function name just pinged something in my memory. I need to quickly verify my initial assumption. Is `rdma_cm` – the connection manager itself – the component responsible for registering a netlink family? I need to confirm that this function is part of that process. If `rdma_cm` doesn't register a netlink family, then what is this `rdma_nl_register` doing? This could indicate a design change, a potential oversight, or maybe I'm misinterpreting the context. Time to dig deeper into the code and relevant documentation.
|
| 91/2 |
2026/05/24 09:10 |
tool |
grepper |
0m
Args: map[Expression:genl_register_family.*]
Results: map[Output:drivers/acpi/event.c=148=static int __init acpi_event_genetlink_init(void)
drivers/acpi/event.c-149-{
drivers/acpi/event.c:150: return genl_register_family(&acpi_event_genl_family);
drivers/acpi/event.c-151-}
--
drivers/android/binder.c=7091=static int __init binder_init(void)
--
drivers/android/binder.c-7138-
drivers/android/binder.c:7139: ret = genl_register_family(&binder_nl_family);
drivers/android/binder.c-7140- if (ret)
--
drivers/block/nbd.c=2643=static int __init nbd_init(void)
--
drivers/block/nbd.c-2683-
drivers/block/nbd.c:2684: if (genl_register_family(&nbd_genl_family)) {
drivers/block/nbd.c-2685- destroy_workqueue(nbd_del_wq);
--
drivers/dpll/dpll_core.c=1132=static int __init dpll_init(void)
--
drivers/dpll/dpll_core.c-1135-
drivers/dpll/dpll_core.c:1136: ret = genl_register_family(&dpll_nl_family);
drivers/dpll/dpll_core.c-1137- if (ret)
--
drivers/gpu/drm/drm_ras_genl_family.c=17=int drm_ras_genl_family_register(void)
--
drivers/gpu/drm/drm_ras_genl_family.c-22-
drivers/gpu/drm/drm_ras_genl_family.c:23: ret = genl_register_family(&drm_ras_nl_family);
drivers/gpu/drm/drm_ras_genl_family.c-24- if (ret)
--
drivers/net/gtp.c=2500=static int __init gtp_init(void)
--
drivers/net/gtp.c-2513-
drivers/net/gtp.c:2514: err = genl_register_family(>p_genl_family);
drivers/net/gtp.c-2515- if (err < 0)
--
drivers/net/ieee802154/mac802154_hwsim.c=1056=static __init int hwsim_init_module(void)
--
drivers/net/ieee802154/mac802154_hwsim.c-1059-
drivers/net/ieee802154/mac802154_hwsim.c:1060: rc = genl_register_family(&hwsim_genl_family);
drivers/net/ieee802154/mac802154_hwsim.c-1061- if (rc)
--
drivers/net/macsec.c=4510=static int __init macsec_init(void)
--
drivers/net/macsec.c-4526-
drivers/net/macsec.c:4527: err = genl_register_family(&macsec_fam);
drivers/net/macsec.c-4528- if (err)
--
drivers/net/ovpn/netlink.c=1367=int __init ovpn_nl_register(void)
drivers/net/ovpn/netlink.c-1368-{
drivers/net/ovpn/netlink.c:1369: int ret = genl_register_family(&ovpn_nl_family);
drivers/net/ovpn/netlink.c-1370-
drivers/net/ovpn/netlink.c-1371- if (ret) {
drivers/net/ovpn/netlink.c:1372: pr_err("ovpn: genl_register_family failed: %d\n", ret);
drivers/net/ovpn/netlink.c-1373- return ret;
--
drivers/net/team/team_core.c=3030=static int __init team_nl_init(void)
drivers/net/team/team_core.c-3031-{
drivers/net/team/team_core.c:3032: return genl_register_family(&team_nl_family);
drivers/net/team/team_core.c-3033-}
--
drivers/net/wireguard/netlink.c=596=int __init wg_genetlink_init(void)
--
drivers/net/wireguard/netlink.c-600-
drivers/net/wireguard/netlink.c:601: return genl_register_family(&genl_family);
drivers/net/wireguard/netlink.c-602-}
--
drivers/net/wireless/virtual/mac80211_hwsim.c=6978=static int __init hwsim_init_netlink(void)
--
drivers/net/wireless/virtual/mac80211_hwsim.c-6983-
drivers/net/wireless/virtual/mac80211_hwsim.c:6984: rc = genl_register_family(&hwsim_genl_family);
drivers/net/wireless/virtual/mac80211_hwsim.c-6985- if (rc)
--
drivers/regulator/event.c=74=static int __init reg_event_genetlink_init(void)
drivers/regulator/event.c-75-{
drivers/regulator/event.c:76: return genl_register_family(®_event_genl_family);
drivers/regulator/event.c-77-}
--
drivers/scsi/pmcraid.c=1358=static int __init pmcraid_netlink_init(void)
--
drivers/scsi/pmcraid.c-1361-
drivers/scsi/pmcraid.c:1362: result = genl_register_family(&pmcraid_event_family);
drivers/scsi/pmcraid.c-1363-
--
drivers/target/target_core_user.c=3321=static int __init tcmu_module_init(void)
--
drivers/target/target_core_user.c-3341-
drivers/target/target_core_user.c:3342: ret = genl_register_family(&tcmu_genl_family);
drivers/target/target_core_user.c-3343- if (ret < 0) {
--
drivers/thermal/thermal_netlink.c=929=int __init thermal_netlink_init(void)
drivers/thermal/thermal_netlink.c-930-{
drivers/thermal/thermal_netlink.c:931: return genl_register_family(&thermal_genl_family);
drivers/thermal/thermal_netlink.c-932-}
--
drivers/vdpa/vdpa.c=1558=static int vdpa_init(void)
--
drivers/vdpa/vdpa.c-1564- return err;
drivers/vdpa/vdpa.c:1565: err = genl_register_family(&vdpa_nl_family);
drivers/vdpa/vdpa.c-1566- if (err)
--
fs/lockd/svc.c=592=static int __init init_nlm(void)
--
fs/lockd/svc.c-605-
fs/lockd/svc.c:606: err = genl_register_family(&lockd_nl_family);
fs/lockd/svc.c-607- if (err)
--
fs/nfsd/nfsctl.c=2297=static int __init init_nfsd(void)
--
fs/nfsd/nfsctl.c-2327- goto out_free_nfsd4;
fs/nfsd/nfsctl.c:2328: retval = genl_register_family(&nfsd_nl_family);
fs/nfsd/nfsctl.c-2329- if (retval)
--
fs/quota/netlink.c=96=static int __init quota_init(void)
fs/quota/netlink.c-97-{
fs/quota/netlink.c:98: if (genl_register_family("a_genl_family) != 0)
fs/quota/netlink.c-99- printk(KERN_ERR
--
fs/smb/client/netlink.c=64=int cifs_genl_init(void)
--
fs/smb/client/netlink.c-67-
fs/smb/client/netlink.c:68: ret = genl_register_family(&cifs_genl_family);
fs/smb/client/netlink.c-69- if (ret < 0) {
--
fs/smb/server/transport_ipc.c=990=int ksmbd_ipc_init(void)
--
fs/smb/server/transport_ipc.c-996-
fs/smb/server/transport_ipc.c:997: ret = genl_register_family(&ksmbd_genl_family);
fs/smb/server/transport_ipc.c-998- if (ret) {
--
include/linux/drbd_genl.h-70- * and static register/unregister functions to
include/linux/drbd_genl.h:71: * genl_register_family().
include/linux/drbd_genl.h-72- *
--
include/linux/genl_magic_func.h=308=int CONCATENATE(GENL_MAGIC_FAMILY, _genl_register)(void)
include/linux/genl_magic_func.h-309-{
include/linux/genl_magic_func.h:310: return genl_register_family(&ZZZ_genl_family);
include/linux/genl_magic_func.h-311-}
--
include/net/genetlink.h=330=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk);
include/net/genetlink.h:331:int genl_register_family(struct genl_family *family);
include/net/genetlink.h-332-int genl_unregister_family(const struct genl_family *family);
--
kernel/power/em_netlink.c=373=static int __init em_netlink_init(void)
kernel/power/em_netlink.c-374-{
kernel/power/em_netlink.c:375: return genl_register_family(&dev_energymodel_nl_family);
kernel/power/em_netlink.c-376-}
--
kernel/taskstats.c=701=static int __init taskstats_init(void)
--
kernel/taskstats.c-704-
kernel/taskstats.c:705: rc = genl_register_family(&family);
kernel/taskstats.c-706- if (rc)
--
net/batman-adv/netlink.c=1544=void __init batadv_netlink_register(void)
--
net/batman-adv/netlink.c-1547-
net/batman-adv/netlink.c:1548: ret = genl_register_family(&batadv_netlink_family);
net/batman-adv/netlink.c-1549- if (ret)
--
net/core/drop_monitor.c=1725=static int __init init_net_drop_monitor(void)
--
net/core/drop_monitor.c-1746-
net/core/drop_monitor.c:1747: rc = genl_register_family(&net_drop_monitor_family);
net/core/drop_monitor.c-1748- if (rc) {
--
net/core/netdev-genl.c=1427=static int __init netdev_genl_init(void)
--
net/core/netdev-genl.c-1434-
net/core/netdev-genl.c:1435: err = genl_register_family(&netdev_nl_family);
net/core/netdev-genl.c-1436- if (err)
--
net/devlink/core.c=577=static int __init devlink_init(void)
--
net/devlink/core.c-583- goto out;
net/devlink/core.c:584: err = genl_register_family(&devlink_nl_family);
net/devlink/core.c-585- if (err)
--
net/ethtool/netlink.c=1571=static int __init ethnl_init(void)
--
net/ethtool/netlink.c-1574-
net/ethtool/netlink.c:1575: ret = genl_register_family(ðtool_genl_family);
net/ethtool/netlink.c-1576- if (WARN(ret < 0, "ethtool: genetlink family registration failed"))
--
net/handshake/netlink.c=244=static int __init handshake_init(void)
--
net/handshake/netlink.c-253-
net/handshake/netlink.c:254: ret = genl_register_family(&handshake_nl_family);
net/handshake/netlink.c-255- if (ret) {
--
net/hsr/hsr_netlink.c=566=int __init hsr_netlink_init(void)
--
net/hsr/hsr_netlink.c-573-
net/hsr/hsr_netlink.c:574: rc = genl_register_family(&hsr_genl_family);
net/hsr/hsr_netlink.c-575- if (rc)
net/hsr/hsr_netlink.c:576: goto fail_genl_register_family;
net/hsr/hsr_netlink.c-577-
--
net/hsr/hsr_netlink.c-580-
net/hsr/hsr_netlink.c:581:fail_genl_register_family:
net/hsr/hsr_netlink.c-582- rtnl_link_unregister(&hsr_link_ops);
--
net/ieee802154/netlink.c=140=int __init ieee802154_nl_init(void)
net/ieee802154/netlink.c-141-{
net/ieee802154/netlink.c:142: return genl_register_family(&nl802154_family);
net/ieee802154/netlink.c-143-}
--
net/ieee802154/nl802154.c=3100=int __init nl802154_init(void)
net/ieee802154/nl802154.c-3101-{
net/ieee802154/nl802154.c:3102: return genl_register_family(&nl802154_fam);
net/ieee802154/nl802154.c-3103-}
--
net/ipv4/fou_core.c=1244=static int __init fou_init(void)
--
net/ipv4/fou_core.c-1251-
net/ipv4/fou_core.c:1252: ret = genl_register_family(&fou_nl_family);
net/ipv4/fou_core.c-1253- if (ret < 0)
--
net/ipv4/tcp_metrics.c=1046=void __init tcp_metrics_init(void)
--
net/ipv4/tcp_metrics.c-1055-
net/ipv4/tcp_metrics.c:1056: ret = genl_register_family(&tcp_metrics_nl_family);
net/ipv4/tcp_metrics.c-1057- if (ret < 0)
--
net/ipv6/ila/ila_main.c=92=static int __init ila_init(void)
--
net/ipv6/ila/ila_main.c-99-
net/ipv6/ila/ila_main.c:100: ret = genl_register_family(&ila_nl_family);
net/ipv6/ila/ila_main.c-101- if (ret)
--
net/ipv6/ioam6.c=1027=int __init ioam6_init(void)
--
net/ipv6/ioam6.c-1032-
net/ipv6/ioam6.c:1033: err = genl_register_family(&ioam6_genl_family);
net/ipv6/ioam6.c-1034- if (err)
--
net/ipv6/seg6.c=505=int __init seg6_init(void)
--
net/ipv6/seg6.c-512-
net/ipv6/seg6.c:513: err = genl_register_family(&seg6_genl_family);
net/ipv6/seg6.c-514- if (err)
--
net/l2tp/l2tp_netlink.c=1042=static int __init l2tp_nl_init(void)
--
net/l2tp/l2tp_netlink.c-1044- pr_info("L2TP netlink interface\n");
net/l2tp/l2tp_netlink.c:1045: return genl_register_family(&l2tp_nl_family);
net/l2tp/l2tp_netlink.c-1046-}
--
net/mptcp/pm_netlink.c=642=void __init mptcp_pm_nl_init(void)
net/mptcp/pm_netlink.c-643-{
net/mptcp/pm_netlink.c:644: if (genl_register_family(&mptcp_genl_family))
net/mptcp/pm_netlink.c-645- panic("Failed to register MPTCP PM netlink family\n");
--
net/ncsi/ncsi-netlink.c=774=static int __init ncsi_init_netlink(void)
net/ncsi/ncsi-netlink.c-775-{
net/ncsi/ncsi-netlink.c:776: return genl_register_family(&ncsi_genl_family);
net/ncsi/ncsi-netlink.c-777-}
--
net/netfilter/ipvs/ip_vs_ctl.c=4875=static int __init ip_vs_genl_register(void)
net/netfilter/ipvs/ip_vs_ctl.c-4876-{
net/netfilter/ipvs/ip_vs_ctl.c:4877: return genl_register_family(&ip_vs_genl_family);
net/netfilter/ipvs/ip_vs_ctl.c-4878-}
--
net/netlabel/netlabel_calipso.c=386=int __init netlbl_calipso_genl_init(void)
net/netlabel/netlabel_calipso.c-387-{
net/netlabel/netlabel_calipso.c:388: return genl_register_family(&netlbl_calipso_gnl_family);
net/netlabel/netlabel_calipso.c-389-}
--
net/netlabel/netlabel_cipso_v4.c=785=int __init netlbl_cipsov4_genl_init(void)
net/netlabel/netlabel_cipso_v4.c-786-{
net/netlabel/netlabel_cipso_v4.c:787: return genl_register_family(&netlbl_cipsov4_gnl_family);
net/netlabel/netlabel_cipso_v4.c-788-}
--
net/netlabel/netlabel_mgmt.c=839=int __init netlbl_mgmt_genl_init(void)
net/netlabel/netlabel_mgmt.c-840-{
net/netlabel/netlabel_mgmt.c:841: return genl_register_family(&netlbl_mgmt_gnl_family);
net/netlabel/netlabel_mgmt.c-842-}
--
net/netlabel/netlabel_unlabeled.c=1384=int __init netlbl_unlabel_genl_init(void)
net/netlabel/netlabel_unlabeled.c-1385-{
net/netlabel/netlabel_unlabeled.c:1386: return genl_register_family(&netlbl_unlabel_gnl_family);
net/netlabel/netlabel_unlabeled.c-1387-}
--
net/netlink/genetlink.c=737=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk)
--
net/netlink/genetlink.c-763-/**
net/netlink/genetlink.c:764: * genl_register_family - register a generic netlink family
net/netlink/genetlink.c-765- * @family: generic netlink family
--
net/netlink/genetlink.c-774- */
net/netlink/genetlink.c:775:int genl_register_family(struct genl_family *family)
net/netlink/genetlink.c-776-{
--
net/netlink/genetlink.c-839-}
net/netlink/genetlink.c:840:EXPORT_SYMBOL(genl_register_family);
net/netlink/genetlink.c-841-
--
net/netlink/genetlink.c=1910=static int __init genl_init(void)
--
net/netlink/genetlink.c-1913-
net/netlink/genetlink.c:1914: err = genl_register_family(&genl_ctrl);
net/netlink/genetlink.c-1915- if (err < 0)
--
net/nfc/netlink.c=1909=int __init nfc_genl_init(void)
--
net/nfc/netlink.c-1912-
net/nfc/netlink.c:1913: rc = genl_register_family(&nfc_genl_family);
net/nfc/netlink.c-1914- if (rc)
--
net/openvswitch/datapath.c=2672=static int __init dp_register_genl(void)
--
net/openvswitch/datapath.c-2678-
net/openvswitch/datapath.c:2679: err = genl_register_family(dp_genl_families[i]);
net/openvswitch/datapath.c-2680- if (err)
--
net/psample/psample.c=518=static int __init psample_module_init(void)
net/psample/psample.c-519-{
net/psample/psample.c:520: return genl_register_family(&psample_nl_family);
net/psample/psample.c-521-}
--
net/psp/psp_main.c=373=static int __init psp_init(void)
--
net/psp/psp_main.c-376-
net/psp/psp_main.c:377: return genl_register_family(&psp_nl_family);
net/psp/psp_main.c-378-}
--
net/shaper/shaper.c=1529=static int __init shaper_init(void)
net/shaper/shaper.c-1530-{
net/shaper/shaper.c:1531: return genl_register_family(&net_shaper_nl_family);
net/shaper/shaper.c-1532-}
--
net/smc/smc_netlink.c=149=int __init smc_nl_init(void)
net/smc/smc_netlink.c-150-{
net/smc/smc_netlink.c:151: return genl_register_family(&smc_gen_nl_family);
net/smc/smc_netlink.c-152-}
--
net/smc/smc_pnet.c=893=int __init smc_pnet_init(void)
--
net/smc/smc_pnet.c-896-
net/smc/smc_pnet.c:897: rc = genl_register_family(&smc_pnet_nl_family);
net/smc/smc_pnet.c-898- if (rc)
--
net/tipc/netlink.c=300=int __init tipc_netlink_start(void)
--
net/tipc/netlink.c-303-
net/tipc/netlink.c:304: res = genl_register_family(&tipc_genl_family);
net/tipc/netlink.c-305- if (res) {
--
net/tipc/netlink_compat.c=1357=int __init tipc_netlink_compat_start(void)
--
net/tipc/netlink_compat.c-1360-
net/tipc/netlink_compat.c:1361: res = genl_register_family(&tipc_genl_compat_family);
net/tipc/netlink_compat.c-1362- if (res) {
--
net/wireless/nl80211.c=23018=int __init nl80211_init(void)
--
net/wireless/nl80211.c-23021-
net/wireless/nl80211.c:23022: err = genl_register_family(&nl80211_fam);
net/wireless/nl80211.c-23023- if (err)
--
tools/lib/thermal/commands.c=490=thermal_error_t thermal_cmd_init(struct thermal_handler *th)
--
tools/lib/thermal/commands.c-497-
tools/lib/thermal/commands.c:498: ret = genl_register_family(&thermal_cmd_ops);
tools/lib/thermal/commands.c-499- if (ret)
]
|
| 92/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 80778
output: 21
thoughts: 68
Thoughts: **Investigating the InfiniBand Connection Management Genetlink Implementation**
Okay, so I'm trying to figure out how InfiniBand connection management interacts with Genetlink. First thought: I'm pretty sure `rdma_cm` doesn't register a Genetlink family, which is the standard mechanism, but I should check before I rule it out completely. What about `iw_cm`? That might be a candidate. Or perhaps it's handled by `ib_core` directly, I need to keep that on my radar too. Wait, does the core `ib_core` specifically register a Genetlink family? I don't recall seeing that explicitly done. I really need to get to the bottom of this. Right, the best way to verify would be to dive into the kernel source and verify. Let's start with `drivers/infiniband/core/nldev.c`. That seems like the logical place to look for network link device specific registration if it exists. Time to get digging!
|
| 93/2 |
2026/05/24 09:10 |
tool |
grepper |
0m
Args: map[Expression:genl_register_family.*]
Results: map[Output:drivers/acpi/event.c=148=static int __init acpi_event_genetlink_init(void)
drivers/acpi/event.c-149-{
drivers/acpi/event.c:150: return genl_register_family(&acpi_event_genl_family);
drivers/acpi/event.c-151-}
--
drivers/android/binder.c=7091=static int __init binder_init(void)
--
drivers/android/binder.c-7138-
drivers/android/binder.c:7139: ret = genl_register_family(&binder_nl_family);
drivers/android/binder.c-7140- if (ret)
--
drivers/block/nbd.c=2643=static int __init nbd_init(void)
--
drivers/block/nbd.c-2683-
drivers/block/nbd.c:2684: if (genl_register_family(&nbd_genl_family)) {
drivers/block/nbd.c-2685- destroy_workqueue(nbd_del_wq);
--
drivers/dpll/dpll_core.c=1132=static int __init dpll_init(void)
--
drivers/dpll/dpll_core.c-1135-
drivers/dpll/dpll_core.c:1136: ret = genl_register_family(&dpll_nl_family);
drivers/dpll/dpll_core.c-1137- if (ret)
--
drivers/gpu/drm/drm_ras_genl_family.c=17=int drm_ras_genl_family_register(void)
--
drivers/gpu/drm/drm_ras_genl_family.c-22-
drivers/gpu/drm/drm_ras_genl_family.c:23: ret = genl_register_family(&drm_ras_nl_family);
drivers/gpu/drm/drm_ras_genl_family.c-24- if (ret)
--
drivers/net/gtp.c=2500=static int __init gtp_init(void)
--
drivers/net/gtp.c-2513-
drivers/net/gtp.c:2514: err = genl_register_family(>p_genl_family);
drivers/net/gtp.c-2515- if (err < 0)
--
drivers/net/ieee802154/mac802154_hwsim.c=1056=static __init int hwsim_init_module(void)
--
drivers/net/ieee802154/mac802154_hwsim.c-1059-
drivers/net/ieee802154/mac802154_hwsim.c:1060: rc = genl_register_family(&hwsim_genl_family);
drivers/net/ieee802154/mac802154_hwsim.c-1061- if (rc)
--
drivers/net/macsec.c=4510=static int __init macsec_init(void)
--
drivers/net/macsec.c-4526-
drivers/net/macsec.c:4527: err = genl_register_family(&macsec_fam);
drivers/net/macsec.c-4528- if (err)
--
drivers/net/ovpn/netlink.c=1367=int __init ovpn_nl_register(void)
drivers/net/ovpn/netlink.c-1368-{
drivers/net/ovpn/netlink.c:1369: int ret = genl_register_family(&ovpn_nl_family);
drivers/net/ovpn/netlink.c-1370-
drivers/net/ovpn/netlink.c-1371- if (ret) {
drivers/net/ovpn/netlink.c:1372: pr_err("ovpn: genl_register_family failed: %d\n", ret);
drivers/net/ovpn/netlink.c-1373- return ret;
--
drivers/net/team/team_core.c=3030=static int __init team_nl_init(void)
drivers/net/team/team_core.c-3031-{
drivers/net/team/team_core.c:3032: return genl_register_family(&team_nl_family);
drivers/net/team/team_core.c-3033-}
--
drivers/net/wireguard/netlink.c=596=int __init wg_genetlink_init(void)
--
drivers/net/wireguard/netlink.c-600-
drivers/net/wireguard/netlink.c:601: return genl_register_family(&genl_family);
drivers/net/wireguard/netlink.c-602-}
--
drivers/net/wireless/virtual/mac80211_hwsim.c=6978=static int __init hwsim_init_netlink(void)
--
drivers/net/wireless/virtual/mac80211_hwsim.c-6983-
drivers/net/wireless/virtual/mac80211_hwsim.c:6984: rc = genl_register_family(&hwsim_genl_family);
drivers/net/wireless/virtual/mac80211_hwsim.c-6985- if (rc)
--
drivers/regulator/event.c=74=static int __init reg_event_genetlink_init(void)
drivers/regulator/event.c-75-{
drivers/regulator/event.c:76: return genl_register_family(®_event_genl_family);
drivers/regulator/event.c-77-}
--
drivers/scsi/pmcraid.c=1358=static int __init pmcraid_netlink_init(void)
--
drivers/scsi/pmcraid.c-1361-
drivers/scsi/pmcraid.c:1362: result = genl_register_family(&pmcraid_event_family);
drivers/scsi/pmcraid.c-1363-
--
drivers/target/target_core_user.c=3321=static int __init tcmu_module_init(void)
--
drivers/target/target_core_user.c-3341-
drivers/target/target_core_user.c:3342: ret = genl_register_family(&tcmu_genl_family);
drivers/target/target_core_user.c-3343- if (ret < 0) {
--
drivers/thermal/thermal_netlink.c=929=int __init thermal_netlink_init(void)
drivers/thermal/thermal_netlink.c-930-{
drivers/thermal/thermal_netlink.c:931: return genl_register_family(&thermal_genl_family);
drivers/thermal/thermal_netlink.c-932-}
--
drivers/vdpa/vdpa.c=1558=static int vdpa_init(void)
--
drivers/vdpa/vdpa.c-1564- return err;
drivers/vdpa/vdpa.c:1565: err = genl_register_family(&vdpa_nl_family);
drivers/vdpa/vdpa.c-1566- if (err)
--
fs/lockd/svc.c=592=static int __init init_nlm(void)
--
fs/lockd/svc.c-605-
fs/lockd/svc.c:606: err = genl_register_family(&lockd_nl_family);
fs/lockd/svc.c-607- if (err)
--
fs/nfsd/nfsctl.c=2297=static int __init init_nfsd(void)
--
fs/nfsd/nfsctl.c-2327- goto out_free_nfsd4;
fs/nfsd/nfsctl.c:2328: retval = genl_register_family(&nfsd_nl_family);
fs/nfsd/nfsctl.c-2329- if (retval)
--
fs/quota/netlink.c=96=static int __init quota_init(void)
fs/quota/netlink.c-97-{
fs/quota/netlink.c:98: if (genl_register_family("a_genl_family) != 0)
fs/quota/netlink.c-99- printk(KERN_ERR
--
fs/smb/client/netlink.c=64=int cifs_genl_init(void)
--
fs/smb/client/netlink.c-67-
fs/smb/client/netlink.c:68: ret = genl_register_family(&cifs_genl_family);
fs/smb/client/netlink.c-69- if (ret < 0) {
--
fs/smb/server/transport_ipc.c=990=int ksmbd_ipc_init(void)
--
fs/smb/server/transport_ipc.c-996-
fs/smb/server/transport_ipc.c:997: ret = genl_register_family(&ksmbd_genl_family);
fs/smb/server/transport_ipc.c-998- if (ret) {
--
include/linux/drbd_genl.h-70- * and static register/unregister functions to
include/linux/drbd_genl.h:71: * genl_register_family().
include/linux/drbd_genl.h-72- *
--
include/linux/genl_magic_func.h=308=int CONCATENATE(GENL_MAGIC_FAMILY, _genl_register)(void)
include/linux/genl_magic_func.h-309-{
include/linux/genl_magic_func.h:310: return genl_register_family(&ZZZ_genl_family);
include/linux/genl_magic_func.h-311-}
--
include/net/genetlink.h=330=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk);
include/net/genetlink.h:331:int genl_register_family(struct genl_family *family);
include/net/genetlink.h-332-int genl_unregister_family(const struct genl_family *family);
--
kernel/power/em_netlink.c=373=static int __init em_netlink_init(void)
kernel/power/em_netlink.c-374-{
kernel/power/em_netlink.c:375: return genl_register_family(&dev_energymodel_nl_family);
kernel/power/em_netlink.c-376-}
--
kernel/taskstats.c=701=static int __init taskstats_init(void)
--
kernel/taskstats.c-704-
kernel/taskstats.c:705: rc = genl_register_family(&family);
kernel/taskstats.c-706- if (rc)
--
net/batman-adv/netlink.c=1544=void __init batadv_netlink_register(void)
--
net/batman-adv/netlink.c-1547-
net/batman-adv/netlink.c:1548: ret = genl_register_family(&batadv_netlink_family);
net/batman-adv/netlink.c-1549- if (ret)
--
net/core/drop_monitor.c=1725=static int __init init_net_drop_monitor(void)
--
net/core/drop_monitor.c-1746-
net/core/drop_monitor.c:1747: rc = genl_register_family(&net_drop_monitor_family);
net/core/drop_monitor.c-1748- if (rc) {
--
net/core/netdev-genl.c=1427=static int __init netdev_genl_init(void)
--
net/core/netdev-genl.c-1434-
net/core/netdev-genl.c:1435: err = genl_register_family(&netdev_nl_family);
net/core/netdev-genl.c-1436- if (err)
--
net/devlink/core.c=577=static int __init devlink_init(void)
--
net/devlink/core.c-583- goto out;
net/devlink/core.c:584: err = genl_register_family(&devlink_nl_family);
net/devlink/core.c-585- if (err)
--
net/ethtool/netlink.c=1571=static int __init ethnl_init(void)
--
net/ethtool/netlink.c-1574-
net/ethtool/netlink.c:1575: ret = genl_register_family(ðtool_genl_family);
net/ethtool/netlink.c-1576- if (WARN(ret < 0, "ethtool: genetlink family registration failed"))
--
net/handshake/netlink.c=244=static int __init handshake_init(void)
--
net/handshake/netlink.c-253-
net/handshake/netlink.c:254: ret = genl_register_family(&handshake_nl_family);
net/handshake/netlink.c-255- if (ret) {
--
net/hsr/hsr_netlink.c=566=int __init hsr_netlink_init(void)
--
net/hsr/hsr_netlink.c-573-
net/hsr/hsr_netlink.c:574: rc = genl_register_family(&hsr_genl_family);
net/hsr/hsr_netlink.c-575- if (rc)
net/hsr/hsr_netlink.c:576: goto fail_genl_register_family;
net/hsr/hsr_netlink.c-577-
--
net/hsr/hsr_netlink.c-580-
net/hsr/hsr_netlink.c:581:fail_genl_register_family:
net/hsr/hsr_netlink.c-582- rtnl_link_unregister(&hsr_link_ops);
--
net/ieee802154/netlink.c=140=int __init ieee802154_nl_init(void)
net/ieee802154/netlink.c-141-{
net/ieee802154/netlink.c:142: return genl_register_family(&nl802154_family);
net/ieee802154/netlink.c-143-}
--
net/ieee802154/nl802154.c=3100=int __init nl802154_init(void)
net/ieee802154/nl802154.c-3101-{
net/ieee802154/nl802154.c:3102: return genl_register_family(&nl802154_fam);
net/ieee802154/nl802154.c-3103-}
--
net/ipv4/fou_core.c=1244=static int __init fou_init(void)
--
net/ipv4/fou_core.c-1251-
net/ipv4/fou_core.c:1252: ret = genl_register_family(&fou_nl_family);
net/ipv4/fou_core.c-1253- if (ret < 0)
--
net/ipv4/tcp_metrics.c=1046=void __init tcp_metrics_init(void)
--
net/ipv4/tcp_metrics.c-1055-
net/ipv4/tcp_metrics.c:1056: ret = genl_register_family(&tcp_metrics_nl_family);
net/ipv4/tcp_metrics.c-1057- if (ret < 0)
--
net/ipv6/ila/ila_main.c=92=static int __init ila_init(void)
--
net/ipv6/ila/ila_main.c-99-
net/ipv6/ila/ila_main.c:100: ret = genl_register_family(&ila_nl_family);
net/ipv6/ila/ila_main.c-101- if (ret)
--
net/ipv6/ioam6.c=1027=int __init ioam6_init(void)
--
net/ipv6/ioam6.c-1032-
net/ipv6/ioam6.c:1033: err = genl_register_family(&ioam6_genl_family);
net/ipv6/ioam6.c-1034- if (err)
--
net/ipv6/seg6.c=505=int __init seg6_init(void)
--
net/ipv6/seg6.c-512-
net/ipv6/seg6.c:513: err = genl_register_family(&seg6_genl_family);
net/ipv6/seg6.c-514- if (err)
--
net/l2tp/l2tp_netlink.c=1042=static int __init l2tp_nl_init(void)
--
net/l2tp/l2tp_netlink.c-1044- pr_info("L2TP netlink interface\n");
net/l2tp/l2tp_netlink.c:1045: return genl_register_family(&l2tp_nl_family);
net/l2tp/l2tp_netlink.c-1046-}
--
net/mptcp/pm_netlink.c=642=void __init mptcp_pm_nl_init(void)
net/mptcp/pm_netlink.c-643-{
net/mptcp/pm_netlink.c:644: if (genl_register_family(&mptcp_genl_family))
net/mptcp/pm_netlink.c-645- panic("Failed to register MPTCP PM netlink family\n");
--
net/ncsi/ncsi-netlink.c=774=static int __init ncsi_init_netlink(void)
net/ncsi/ncsi-netlink.c-775-{
net/ncsi/ncsi-netlink.c:776: return genl_register_family(&ncsi_genl_family);
net/ncsi/ncsi-netlink.c-777-}
--
net/netfilter/ipvs/ip_vs_ctl.c=4875=static int __init ip_vs_genl_register(void)
net/netfilter/ipvs/ip_vs_ctl.c-4876-{
net/netfilter/ipvs/ip_vs_ctl.c:4877: return genl_register_family(&ip_vs_genl_family);
net/netfilter/ipvs/ip_vs_ctl.c-4878-}
--
net/netlabel/netlabel_calipso.c=386=int __init netlbl_calipso_genl_init(void)
net/netlabel/netlabel_calipso.c-387-{
net/netlabel/netlabel_calipso.c:388: return genl_register_family(&netlbl_calipso_gnl_family);
net/netlabel/netlabel_calipso.c-389-}
--
net/netlabel/netlabel_cipso_v4.c=785=int __init netlbl_cipsov4_genl_init(void)
net/netlabel/netlabel_cipso_v4.c-786-{
net/netlabel/netlabel_cipso_v4.c:787: return genl_register_family(&netlbl_cipsov4_gnl_family);
net/netlabel/netlabel_cipso_v4.c-788-}
--
net/netlabel/netlabel_mgmt.c=839=int __init netlbl_mgmt_genl_init(void)
net/netlabel/netlabel_mgmt.c-840-{
net/netlabel/netlabel_mgmt.c:841: return genl_register_family(&netlbl_mgmt_gnl_family);
net/netlabel/netlabel_mgmt.c-842-}
--
net/netlabel/netlabel_unlabeled.c=1384=int __init netlbl_unlabel_genl_init(void)
net/netlabel/netlabel_unlabeled.c-1385-{
net/netlabel/netlabel_unlabeled.c:1386: return genl_register_family(&netlbl_unlabel_gnl_family);
net/netlabel/netlabel_unlabeled.c-1387-}
--
net/netlink/genetlink.c=737=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk)
--
net/netlink/genetlink.c-763-/**
net/netlink/genetlink.c:764: * genl_register_family - register a generic netlink family
net/netlink/genetlink.c-765- * @family: generic netlink family
--
net/netlink/genetlink.c-774- */
net/netlink/genetlink.c:775:int genl_register_family(struct genl_family *family)
net/netlink/genetlink.c-776-{
--
net/netlink/genetlink.c-839-}
net/netlink/genetlink.c:840:EXPORT_SYMBOL(genl_register_family);
net/netlink/genetlink.c-841-
--
net/netlink/genetlink.c=1910=static int __init genl_init(void)
--
net/netlink/genetlink.c-1913-
net/netlink/genetlink.c:1914: err = genl_register_family(&genl_ctrl);
net/netlink/genetlink.c-1915- if (err < 0)
--
net/nfc/netlink.c=1909=int __init nfc_genl_init(void)
--
net/nfc/netlink.c-1912-
net/nfc/netlink.c:1913: rc = genl_register_family(&nfc_genl_family);
net/nfc/netlink.c-1914- if (rc)
--
net/openvswitch/datapath.c=2672=static int __init dp_register_genl(void)
--
net/openvswitch/datapath.c-2678-
net/openvswitch/datapath.c:2679: err = genl_register_family(dp_genl_families[i]);
net/openvswitch/datapath.c-2680- if (err)
--
net/psample/psample.c=518=static int __init psample_module_init(void)
net/psample/psample.c-519-{
net/psample/psample.c:520: return genl_register_family(&psample_nl_family);
net/psample/psample.c-521-}
--
net/psp/psp_main.c=373=static int __init psp_init(void)
--
net/psp/psp_main.c-376-
net/psp/psp_main.c:377: return genl_register_family(&psp_nl_family);
net/psp/psp_main.c-378-}
--
net/shaper/shaper.c=1529=static int __init shaper_init(void)
net/shaper/shaper.c-1530-{
net/shaper/shaper.c:1531: return genl_register_family(&net_shaper_nl_family);
net/shaper/shaper.c-1532-}
--
net/smc/smc_netlink.c=149=int __init smc_nl_init(void)
net/smc/smc_netlink.c-150-{
net/smc/smc_netlink.c:151: return genl_register_family(&smc_gen_nl_family);
net/smc/smc_netlink.c-152-}
--
net/smc/smc_pnet.c=893=int __init smc_pnet_init(void)
--
net/smc/smc_pnet.c-896-
net/smc/smc_pnet.c:897: rc = genl_register_family(&smc_pnet_nl_family);
net/smc/smc_pnet.c-898- if (rc)
--
net/tipc/netlink.c=300=int __init tipc_netlink_start(void)
--
net/tipc/netlink.c-303-
net/tipc/netlink.c:304: res = genl_register_family(&tipc_genl_family);
net/tipc/netlink.c-305- if (res) {
--
net/tipc/netlink_compat.c=1357=int __init tipc_netlink_compat_start(void)
--
net/tipc/netlink_compat.c-1360-
net/tipc/netlink_compat.c:1361: res = genl_register_family(&tipc_genl_compat_family);
net/tipc/netlink_compat.c-1362- if (res) {
--
net/wireless/nl80211.c=23018=int __init nl80211_init(void)
--
net/wireless/nl80211.c-23021-
net/wireless/nl80211.c:23022: err = genl_register_family(&nl80211_fam);
net/wireless/nl80211.c-23023- if (err)
--
tools/lib/thermal/commands.c=490=thermal_error_t thermal_cmd_init(struct thermal_handler *th)
--
tools/lib/thermal/commands.c-497-
tools/lib/thermal/commands.c:498: ret = genl_register_family(&thermal_cmd_ops);
tools/lib/thermal/commands.c-499- if (ret)
]
|
| 94/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 88142
output: 20
thoughts: 399
Thoughts: **My Line of Reasoning**
Okay, so `rdma_cm` isn't setting up a Genetlink family directly, that's clear. But, let's explore this further. If a user sets `xcl_name` to "smc", we end up with `request_module("svcsmc")`. Does that module exist? No, it doesn't. And what about "rdma"? That gives us `request_module("svcrdma")`. I know `svcrdma` is just an alias for `rpcrdma`. Now, the crucial question: does the `rpcrdma` module's initialization register a Genetlink family? I don't think so, but better double-check. Okay, it doesn't. But, and this is important, could a `modprobe svcrdma` indirectly trigger the loading of a module that *does* register a family? Could `rpcrdma` depend on something else that then does the registration? Let's rule that out. I've scanned the relevant kernel code; no dice. No `genl_register_family` calls in the `rdma` or `ib` core modules.
Okay, let's try another approach. "tcp_metrics" gives us `request_module("svctcp_metrics")`, but that's a dead end. Okay, hold on... does `request_module` *really* load *any* module given an alias? No, the module name has to start with `svc`. So, the question becomes, is there *any* module that starts with "svc" and actually *does* register a Genetlink family? Time to re-examine the list of `genl_register_family` calls I have. Aha! `fs/lockd/svc.c`! It calls `genl_register_family(&lockd_nl_family)`. Wait, that's compiled into `lockd.ko`. But does `lockd.ko` have an alias that starts with "svc"? That's the real test. Let me look at `fs/lockd/svc.c`...
|
| 95/2 |
2026/05/24 09:10 |
tool |
grepper |
0m
Error:
Args: map[Expression:MODULE_ALIAS.*lockd]
Results:
|
| 96/2 |
2026/05/24 09:10 |
llm |
expert |
0m
Model:
Tokens:
input: 89031
output: 50
thoughts: 553
Thoughts: **Unraveling a Potential Kernel Hang**
Okay, so I'm trying to figure out this `modprobe` hang, and the `xcl_name` variable keeps popping up as a clue. My initial thought is, maybe `xcl_name` isn't *directly* causing the hang, but rather, it's a trigger that makes `modprobe` get stuck on something else, a cascading failure, if you will. For instance, what if loading the module triggered by `xcl_name` results in an attempt to load another module that somehow requests `nfsd_mutex`?
Then I remember that `lockd.ko` does this `genl_register_family` call during initialization. If `lockd.ko` *is* loaded, that call will happen. But how could `request_module("svc%s", xcl_name)` possibly load `lockd.ko`? Is the `xcl_name` path to the module somehow crafted to be something like `../fs/lockd/lockd`? Ah, but no, `modprobe` wouldn't allow directory traversal in module names.
Okay, let's step back. What if `modprobe` is just slow, and syzkaller is spamming it? Maybe the exploit is triggering `nfsd_nl_listener_set_doit` repeatedly, creating a flurry of `modprobe` processes? But there is a limit, isn't there? `request_module` has a cap on concurrent `modprobe` calls (`kmod_concurrent_max`). Ah, if that limit is reached, `request_module` blocks! And what does it block on? Oh, right, `request_module` uses a `down_timeout` on `kmod_concurrent_max`, for `MAX_KMOD_ALL_BUSY_TIMEOUT` which is 50 seconds. This block holds `nfsd_mutex` *and* `cb_lock`! That 50-second timeout – if it blocks for that long, that could very well trigger the hung task timeout, which is reported as 143 seconds. That makes sense!
But wait… `request_module` *waits* for `modprobe` to finish! If `modprobe` takes forever, `request_module` blocks. So, why would `modprobe` be taking so long? Maybe syzkaller is generating a ton of loops, or maybe `modprobe` is blocked on another lock somewhere.
Hold on, what if `xcl_name` is set to `rdma`? Then `request_module("svcrdma")` calls `modprobe svcrdma`. That would load `rpcrdma`. Does initializing `rpcrdma` block on anything? Oh, yeah, `rpcrdma` initialization does call `svc_rdma_init()`, which in turn calls `svc_reg_xprt_class(&svc_rdma_class)`. That `svc_reg_xprt_class` function... does *that* take any locks? That's a point to examine closely.
|
| 97/2 |
2026/05/24 09:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/sunrpc/svc_xprt.c IncludeLines:true Name:svc_reg_xprt_class]
Results: map[SourceCode: 77: /**
78: * svc_reg_xprt_class - Register a server-side RPC transport class
79: * @xcl: New transport class to be registered
80: *
81: * Returns zero on success; otherwise a negative errno is returned.
82: */
83: int svc_reg_xprt_class(struct svc_xprt_class *xcl)
84: {
85: struct svc_xprt_class *cl;
86: int res = -EEXIST;
87:
88: INIT_LIST_HEAD(&xcl->xcl_list);
89: spin_lock(&svc_xprt_class_lock);
90: /* Make sure there isn't already a class with the same name */
91: list_for_each_entry(cl, &svc_xprt_class_list, xcl_list) {
92: if (strcmp(xcl->xcl_name, cl->xcl_name) == 0)
93: goto out;
94: }
95: list_add_tail(&xcl->xcl_list, &svc_xprt_class_list);
96: res = 0;
97: out:
98: spin_unlock(&svc_xprt_class_lock);
99: return res;
100: }
SourceFile:net/sunrpc/svc_xprt.c]
|
| 98/2 |
2026/05/24 09:11 |
llm |
expert |
0m
Model:
Tokens:
input: 90719
output: 51
thoughts: 751
Thoughts: **Analyzing a Potential Deadlock in Kernel Module Loading**
Okay, so initially I was thinking this was a simple spinlock issue, but it's more complex than that. My mind immediately went to the possibility of `modprobe` being blocked by something, specifically `nfsd_mutex`, but that didn't quite make sense. Why would loading `svcrdma` have that dependency? `rpc_rdma_init` doesn't even take `nfsd_mutex`, so scratch that.
Then it hit me: what if `modprobe` loads a module that *internally* calls `register_pernet_subsys`? That function does use `pernet_ops_rwsem`, and the lockdep output is showing a lot of activity involving that, along with `rtnl_mutex` and `rcu_state.exp_mutex`.
Looking at the output:
```
5 locks held by kworker/u11:26/7849:
#0: ffff88801c6ae140 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x12d6/0x1980 kernel/workqueue.c:3289
#1: ffffc90003587d08 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x973/0x1980 kernel/workqueue.c:3290
#2: ffffffff905f7688 (pernet_ops_rwsem){++++}-{4:4}, at: cleanup_net+0xb8/0x920 net/core/net_namespace.c:673
#3: ffffffff906103e0 (rtnl_mutex){+.+.}-{4:4}, at: ops_exit_rtnl_list net/core/net_namespace.c:173 [inline]
#3: ffffffff906103e0 (rtnl_mutex){+.+.}-{4:4}, at: ops_undo_list+0x7ec/0xab0 net/core/net_namespace.c:248
#4: ffffffff8e7f0f68 (rcu_state.exp_mutex){+.+.}-{4:4}, at: exp_funnel_lock+0x19e/0x3c0 kernel/rcu/tree_exp.h:343
```
Right! The crucial point is `cleanup_net` is holding `pernet_ops_rwsem`, `rtnl_mutex`, and `rcu_state.exp_mutex`. It's doing `ops_undo_list` which then calls `ops_exit_rtnl_list` . If `cleanup_net` is blocked *it* is still holding `pernet_ops_rwsem`! Therefore, if `modprobe svcrdma` *does* call `register_pernet_subsys` somehow, then it's going to deadlock on `pernet_ops_rwsem`.
Now, the key question: Does `rpcrdma` call `register_pernet_subsys`? Let's trace it back. Okay, so `rpc_rdma_init` calls `svc_rdma_init()`, but that doesn't seem to, from the code, directly call `register_pernet_subsys`. Does `xprt_rdma_init` make any calls to this function?
|
| 99/2 |
2026/05/24 09:11 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:net/sunrpc/xprtrdma/transport.c IncludeLines:true Name:xprt_rdma_init]
Results: map[SourceCode: SourceFile:]
|
| 100/2 |
2026/05/24 09:11 |
llm |
expert |
0m
Model:
Tokens:
input: 92343
output: 22
thoughts: 15
Thoughts: Okay, here's my attempt at summarizing that thought process, tailored for an expert audience:
**Analyzing the Search Query: `xprt_rdma_init`**
Alright, so the search term is `xprt_rdma_init`. The presence of the "xprt" prefix immediately flags this as likely related to the XPRT (eXchange Protocol) layer, which I know is a core component in the Linux kernel's networking stack, particularly in the context of remote procedure calls. The "rdma" part is even clearer. It signifies Remote Direct Memory Access, a high-performance networking technology. The "init" suggests this is a function related to initialization or setup, quite possibly for an RDMA transport mechanism within the XPRT layer. Based on this, I'm expecting to find the kernel source code defining the initialization routine for an RDMA-based transport or connection within a distributed system environment, probably related to something like NFS or RPC over RDMA. My initial assumption is that this will be within the kernel's networking or filesystem-related code. My next step will be digging into the results and seeing if my hypothesis is correct.
|
| 101/2 |
2026/05/24 09:11 |
tool |
grepper |
0m
Args: map[Expression:xprt_rdma_init]
Results: map[Output:net/sunrpc/xprtrdma/module.c=37=static int __init rpc_rdma_init(void)
--
net/sunrpc/xprtrdma/module.c-48-
net/sunrpc/xprtrdma/module.c:49: rc = xprt_rdma_init();
net/sunrpc/xprtrdma/module.c-50- if (rc)
--
net/sunrpc/xprtrdma/transport.c=776=void xprt_rdma_cleanup(void)
--
net/sunrpc/xprtrdma/transport.c-788-
net/sunrpc/xprtrdma/transport.c:789:int xprt_rdma_init(void)
net/sunrpc/xprtrdma/transport.c-790-{
--
net/sunrpc/xprtrdma/xprt_rdma.h=604=void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq);
net/sunrpc/xprtrdma/xprt_rdma.h:605:int xprt_rdma_init(void);
net/sunrpc/xprtrdma/xprt_rdma.h-606-void xprt_rdma_cleanup(void);
]
|
| 102/2 |
2026/05/24 09:11 |
llm |
expert |
0m
Model:
Tokens:
input: 92987
output: 42
thoughts: 31
Thoughts: Okay, let's dive into this. Here's my thought process on the matter, summarized as requested:
**Deconstructing xprt_rdma_init**
Alright, I need to get a handle on what's going on with the RDMA transport initialization. My immediate instinct is to jump into the `net/sunrpc/xprtrdma/transport.c` file and specifically check out the `xprt_rdma_init` function. That's the logical starting point for understanding how the RDMA transport is brought online within the SUN RPC framework. I'm assuming, given the naming, that this is where the core setup happens – resource allocation, connection establishment, and perhaps even some initial configuration. I'll need to look closely at the function's arguments, internal data structures, and the functions it calls to get the full picture. My expertise tells me that this function likely interacts with the RDMA device driver, and probably handles setup of queues and memory regions. Let's see what secrets it holds.
|
| 103/2 |
2026/05/24 09:11 |
tool |
git-blame |
0m
Args: map[End:800 File:net/sunrpc/xprtrdma/transport.c Start:789]
Results: map[Output:ffe1f0df58623 789) int xprt_rdma_init(void)
f58851e6b0f14 790) {
f58851e6b0f14 791) int rc;
f58851e6b0f14 792)
951e721ca0d66 793) rc = xprt_register_transport(&xprt_rdma);
6d2d0ee27c7a1 794) if (rc)
951e721ca0d66 795) return rc;
951e721ca0d66 796)
5d252f90a800c 797) rc = xprt_register_transport(&xprt_rdma_bc);
5d252f90a800c 798) if (rc) {
5d252f90a800c 799) xprt_unregister_transport(&xprt_rdma);
5d252f90a800c 800) return rc;
]
|
| 104/2 |
2026/05/24 09:11 |
llm |
expert |
0m
Model:
Tokens:
input: 93614
output: 29
thoughts: 870
Thoughts: **Analyzing a Potential Kernel Hang**
Okay, let's break this down. No `register_pernet_subsys` – that's not the path. But what about `modprobe`? Could it be loading the `sunrpc` module, which *does* call `register_pernet_subsys`? No, because `nfsd` depends on `sunrpc`, so it should already be loaded. What if `modprobe` is loading something else that calls `genl_register_family`? We already discounted that.
Aha! What if `modprobe` is just blocked on `kmod_concurrent_max`? If we hit the limit, `request_module` will block for a significant amount of time – 50 seconds. If syzkaller triggers enough concurrent `request_module` calls, the next one will indeed block for 50 seconds. But... wait. `request_module` is called while holding `nfsd_mutex`! That means only *one* thread can be inside `nfsd_nl_listener_set_doit` at a time. It can't trigger 50 concurrent calls from there. But can it be triggered from other places, like socket creation or netfilter? Yes, it can, and if syzkaller exhausts `kmod_concurrent_max`, the thread holding `nfsd_mutex` will block for 50 seconds. Then another thread waiting for the mutex will also block. This is a classic `request_module` and global lock issue.
Is *this* the bug? The bug report says the task is blocked for *more* than 143 seconds. That’s more than 50, so that fits. However, `request_module` blocks for 50 seconds then it returns `-ENOMEM` or `-ETIME`. Then the code releases `nfsd_mutex`. So, it shouldn't block for *143* seconds unless `modprobe` itself is the cause. Why would `modprobe` block for 143 seconds? `modprobe` runs in userspace. If userspace is frozen, like if it gets ptrace'd or `SIGSTOP`ped, `modprobe` would block indefinitely! `UMH_WAIT_PROC` waits for the process to exit. Does `wait_for_completion` block indefinitely if the process is stopped? Yes, `call_usermodehelper_exec` is waiting for the process to exit. If syzkaller intercepts the execution by setting something like `core_pattern` or by using a FUSE filesystem for `/sbin/modprobe`, it can make `modprobe` hang.
If `modprobe` hangs, the kernel thread holding `nfsd_mutex` hangs indefinitely. This is known by design if root can trigger `request_module` while holding a global lock. Wait, is it root? Yes, `nfsd_nl_listener_set_doit` requires `CAP_NET_ADMIN` in the initial user namespace. So this is *only* exploitable by root. If root can trigger this, is this a security issue? No, root already can DoS or hang the system, so this is just a known issue and not a new vulnerability. Is there any way to reach `svc_xprt_create_from_sa` *without* `CAP_NET_ADMIN` in the initial user namespace? Let's check `write_ports`. The `/proc/fs/nfsd/portlist` is writable by root (`S_IWUSR`). Is there any other caller of `svc_xprt_create_from_sa`?
|
| 105/2 |
2026/05/24 09:11 |
tool |
codesearch-find-references |
0m
Args: map[Name:svc_xprt_create_from_sa]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:nfsd_nl_listener_set_doit SourceFile:fs/nfsd/nfsctl.c SourceLine:2047] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:svc_xprt_create SourceFile:net/sunrpc/svc_xprt.c SourceLine:375]] TruncatedOutput:false]
|
| 106/2 |
2026/05/24 09:11 |
llm |
expert |
0m
Model:
Tokens:
input: 95436
output: 25
thoughts: 15
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience:
**Analyzing `svc_xprt_create` Callers**
Alright, so the first thing I'm thinking is, "Let's dig into the callers of `svc_xprt_create`." That function is a critical building block in most RPC implementations, especially those using a socket-based transport. Knowing its call sites is essential for understanding how the transport layer is being initialized and managed. I need to get a handle on the various scenarios it handles. Is it used to create both TCP and UDP transports? What are the implications if we're seeing an unusual pattern in its usage, or encountering unexpected errors related to those transports? Are there any potential security vulnerabilities related to the way this function's parameters are being constructed, or any opportunities for resource exhaustion? Are we seeing memory allocation issues when a number of these are initiated concurrently? I need to analyze the calling code for all the ways we're actually *using* it. Essentially, I need to know the why, how, and where this function is being called so I have an easier time debugging any issues that might come up, as well as finding more efficient solutions.
|
| 107/2 |
2026/05/24 09:11 |
tool |
codesearch-find-references |
0m
Args: map[Name:svc_xprt_create]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__write_ports_addxprt SourceFile:fs/nfsd/nfsctl.c SourceLine:773] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__write_ports_addxprt SourceFile:fs/nfsd/nfsctl.c SourceLine:778] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:create_lockd_listener SourceFile:fs/lockd/svc.c SourceLine:166] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:nfs4_callback_up_net SourceFile:fs/nfs/callback.c SourceLine:47] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:nfs4_callback_up_net SourceFile:fs/nfs/callback.c SourceLine:56]] TruncatedOutput:false]
|
| 108/2 |
2026/05/24 09:11 |
llm |
expert |
0m
Model:
Tokens:
input: 96021
output: 43
thoughts: 12
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Analyzing the `create_lockd_listener` Function**
Alright, let's dive into the `create_lockd_listener` function. My initial thought is to immediately consider the context and its intended role within the larger locking system. I need to quickly ascertain its inputs, what the expected outputs are, and its overall purpose, of course. Is it creating a specific type of lockd listener? A general purpose one? Is it responsible for socket binding, accepting connections, setting up the necessary data structures, or handling more advanced things, such as thread pools or non-blocking I/O?
I'm mentally running through the typical lockd listener setup: What's the thread model? Is it a single-threaded server, or does it spawn worker threads for each connection? How are connection timeouts handled, if at all? What about error conditions – how are they reported and managed? I need to quickly establish the potential bottlenecks – is it network latency, CPU cycles, or contention for resources that are the most likely?
Beyond the basic setup, I'm thinking about the security aspects. Is there any authentication? Are there any measures against denial-of-service (DoS) attacks? Does it consider the network protocol's capabilities and its limitations. What are the potential vulnerabilities I need to be aware of? I'll probably want to double-check error handling here.
|
| 109/2 |
2026/05/24 09:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/lockd/svc.c IncludeLines:true Name:create_lockd_listener]
Results: map[SourceCode: 157: static int create_lockd_listener(struct svc_serv *serv, const char *name,
158: struct net *net, const int family,
159: const unsigned short port,
160: const struct cred *cred)
161: {
162: struct svc_xprt *xprt;
163:
164: xprt = svc_find_xprt(serv, name, net, family, 0);
165: if (xprt == NULL)
166: return svc_xprt_create(serv, name, net, family, port,
167: SVC_SOCK_DEFAULTS, cred);
168: svc_xprt_put(xprt);
169: return 0;
170: }
SourceFile:fs/lockd/svc.c]
|
| 110/2 |
2026/05/24 09:11 |
llm |
expert |
0m
Model:
Tokens:
input: 96640
output: 24
thoughts: 11
Thoughts: Here's my thought process, as if I were analyzing that question:
**Deconstructing the Call to `create_lockd_listener`**
Alright, so the core question is, "Who calls `create_lockd_listener`?" This isn't just a simple code question; it's about understanding the system's architecture and the control flow. My initial focus is on *why* I need to know this. Is it for debugging? Performance analysis? Security auditing? Understanding the calling context is crucial.
First, I'm thinking, "Is there a codebase I can use tools against? Are there logs I can check?" My expertise tells me there's almost certainly tooling for this. Static analysis tools, debuggers, maybe even simple grep searches if the codebase is manageable. I'd be looking for references to that function name directly, and then tracing back from those points.
But let's assume those aren't readily available or complete. I need to think systematically. "What's the overall design of the system?" What components are most likely to interact with locking mechanisms? Is it a distributed system? If so, network communication, RPC, or message queues could all be potential callers. What's the context where `create_lockd_listener` is used? It's likely associated with a distributed locking mechanism. This suggests a service that manages locks. I'd consider where this service would need to be instantiated.
Now, I'd go deeper. "What is the expected use case for `create_lockd_listener`?" Is this a service-level function? A core library component? An application specific thing? Thinking through the system's components helps. Are there initialization routines, configuration parsers, or service start-up scripts that might be responsible? Are there tests that invoke this function? I'd immediately think about how the system is designed. Does it use dependency injection? Configuration files? What's the entry point of the application? I'd look for initialization logic, bootstrapping code, or even command-line arguments that might trigger it. Thinking through all the potential call chains would lead me to the likely answer.
|
| 111/2 |
2026/05/24 09:12 |
tool |
codesearch-find-references |
0m
Args: map[Name:create_lockd_listener]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:create_lockd_family SourceFile:fs/lockd/svc.c SourceLine:178] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:create_lockd_family SourceFile:fs/lockd/svc.c SourceLine:183]] TruncatedOutput:false]
|
| 112/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 97249
output: 24
thoughts: 11
Thoughts: Here's my thought process, as if I were analyzing that question:
**Deconstructing the Call to `create_lockd_family`**
Okay, so the immediate question is, "Who's initiating this `create_lockd_family` call?" That's the crux of understanding its purpose and potential impact within the larger system. I need to trace back the execution flow to identify the caller. I'm thinking, is this a direct call from a userland program, or is it triggered internally by the kernel itself? That context is critical. If it's userland, then debugging that process is the obvious place to start. If it's in the kernel, then I need to understand what subsystems or kernel threads could be the source. Let's see... is this a function specific to a particular file system or network protocol? That would offer valuable clues. Are there any logging points or debug symbols I can leverage to see the call stack, to see who the parent function(s) are? Now, where do I even *find* the definition of `create_lockd_family`? Is there a header file or source code file that would give me a starting point? I'm picturing the project's directory structure in my head now. Okay, I need to get in there and either trace with a debugger or just grep and find all the locations `create_lockd_family` is even mentioned.
|
| 113/2 |
2026/05/24 09:12 |
tool |
codesearch-find-references |
0m
Args: map[Name:create_lockd_family]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:make_socks SourceFile:fs/lockd/svc.c SourceLine:203] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:make_socks SourceFile:fs/lockd/svc.c SourceLine:207]] TruncatedOutput:false]
|
| 114/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 97700
output: 21
thoughts: 8
Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:
**The Call Stack of Sock Creation**
My initial thought, whenever I see a function like `make_socks`, is always the same: *who* is calling this thing? It's not enough to understand *what* it does; I need to understand *why* and *when* it's called. The context of its invocation dictates so much about potential performance bottlenecks, error handling strategies, and even the overall architectural implications. Am I dealing with a high-frequency, time-critical routine? Is this part of a batch process? Does it sit within a request-response cycle? The caller's identity answers those questions.
Knowing the call path lets me anticipate concurrency issues, identify potential points of data contention, and reason about the impact of failure. If `make_socks` is invoked deep within a nested call chain, a bug here could propagate disastrously. Understanding its direct caller is just the starting point; I need to trace back further up the call stack to get the full picture. My mental model starts building from the leaves of the tree and moves towards the root. The caller reveals the entire purpose and meaning of this function's existence, and that is essential.
|
| 115/2 |
2026/05/24 09:12 |
tool |
codesearch-find-references |
0m
Args:
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:lockd_up_net SourceFile:fs/lockd/svc.c SourceLine:235]] TruncatedOutput:false]
|
| 116/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 98070
output: 24
thoughts: 11
Thoughts: Here's my thought process, as if I were considering this question:
**Investigating the Caller of `lockd_up_net`**
Okay, so the question is, *who* is calling `lockd_up_net`? That's the core of the issue. My initial reaction is to consider the context. What's the environment this function exists in? Is this a kernel module, a user-space application, a network service daemon, something else entirely? The type of caller is going to heavily influence where I look.
My first thought would be to use some debugging tools to inspect the call stack, right? A dynamic analysis approach would be ideal. `gdb` would let me attach to the running process (assuming it *is* a running process), set a breakpoint at `lockd_up_net`, and then step back up the stack to see what function calls *it*. Alternatively, I could use something like `systemtap` or `perf` to trace calls to that function, hopefully getting a count and some caller identifiers without interrupting the process too much.
Next I'd look for static analysis possibilities. Is there source code available? If so, a quick `grep` for "lockd_up_net" might reveal direct calls. I'd be looking for the include files and the context in which it's being used. If there's no direct source, or it's a closed-source component, I might need to resort to disassembling the binary and inspecting the assembly code. It's a bit more tedious, but it's often necessary. I might use `objdump` or something similar for this.
Another important consideration is the name itself, "lockd_up_net". That name suggests something network-related and perhaps locking-related. Is it part of a network file system implementation, like NFS? Is this related to socket handling or inter-process communication that utilizes network resources? That could drastically narrow the scope of potential callers if I can make an educated guess about the system's architecture. Looking at the module name could also be a clue.
Ultimately, to properly answer the question, I'd need to dig into the system and environment to figure out how this function is integrated into the architecture.
|
| 117/2 |
2026/05/24 09:12 |
tool |
codesearch-find-references |
0m
Args:
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:lockd_up SourceFile:fs/lockd/svc.c SourceLine:398]] TruncatedOutput:false]
|
| 118/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 98654
output: 22
thoughts: 9
Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it were my own internal monologue:
**Investigating the Caller of `lockd_up`**
Right, `lockd_up`. That function name triggers a few immediate questions, and I need to prioritize understanding its context. The first thing that pops into my head is: who *calls* this function? I need to understand the call graph, the dependencies, the execution path that leads to `lockd_up` being invoked. Is this a core kernel function, some filesystem component, a network service, or something userland that's behaving badly? Knowing the caller is absolutely fundamental. The nature of the caller *will* provide clues about the purpose, and likely the potential impact, of `lockd_up`. Is it a critical path, or something more obscure? That's what I have to figure out first.
|
| 119/2 |
2026/05/24 09:12 |
tool |
codesearch-find-references |
0m
Args:
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:nfsd_startup_net SourceFile:fs/nfsd/nfssvc.c SourceLine:368] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:nlmclnt_init SourceFile:fs/lockd/clntlock.c SourceLine:51] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:reclaimer SourceFile:fs/lockd/clntlock.c SourceLine:243]] TruncatedOutput:false]
|
| 120/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 99055
output: 27
thoughts: 55
Thoughts: **NFS Mounting Ponderings**
Okay, so `nlmclnt_init` gets called during the NFS mount, right? Makes sense. But that got me thinking... can *any* user, like, a regular joe, mount an NFS share? I thought about the security implications there. Right, I recall, NFS doesn't support `FS_USERNS_MOUNT`, so that should rule out unprivileged users. Unless... wait a second... what about `nfs4_callback_up_net`? That interaction's potentially in play, isn't it? Gotta remember how that fits into the picture. Need to revisit how that impacts mount permissions to be sure.
|
| 121/2 |
2026/05/24 09:12 |
tool |
codesearch-find-references |
0m
Args: map[Name:nfs4_callback_up_net]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:nfs_callback_up_net SourceFile:fs/nfs/callback.c SourceLine:154]] TruncatedOutput:false]
|
| 122/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 99356
output: 21
thoughts: 1697
Thoughts: **Analyzing the NFSv4 Deadlock**
Okay, so I'm looking at this deadlock related to NFSv4 and it's pretty straightforward, but let's break it down methodically. First, `nfs_callback_up_net` is called during NFSv4 mount, so `svc_xprt_create` calls require either `CAP_NET_ADMIN` in the init namespace or `CAP_SYS_ADMIN` to mount NFS. I need to make sure I understand all the possible paths. The deadlock itself involves two threads. Thread 1, triggered through `genl_rcv`, is holding a read lock (`cb_lock`) while calling `nfsd_nl_listener_set_doit`, which in turn, tries to acquire `nfsd_mutex` and then calls `request_module`. This `request_module` call is where the real problem starts because it's being called with `UMH_WAIT_PROC`. Modprobe (Thread 2) calls `genl_register_family` and tries to acquire a write lock on `cb_lock`, but it's blocked. So, Thread 1 is waiting on Thread 2 via `request_module` and Thread 2 is waiting on Thread 1. This is a classic deadlock situation, and it stems from a genetlink `doit` callback (`nfsd_nl_listener_set_doit`) being called with the read lock held.
`genl_rcv` is also holding `cb_lock` for reading. Can this be triggered without `CAP_NET_ADMIN`? No, because `nfsd_nl_listener_set_doit` requires it in the initial user namespace. Now, are there any other genetlink callbacks which might call `request_module` and *not* require `CAP_NET_ADMIN`? Let me check for other possibilities. However, the report specifically points to `nfsd_nl_listener_set_doit`.
The bug report confirms this deadlock. Since the `doit` function requires `CAP_NET_ADMIN` in the initial namespace, this bug is not accessible from unprivileged processes, and *definitely* not from user namespaces.
Exploitable? No, this is a DoS situation, not a memory corruption vulnerability. So, no privilege escalation. Is this something a VM guest could trigger? No, it's a local process. Network or peripheral triggers? Also no. Filesystem? Again, no.
Okay, let me double-check that `nfsd_nl_listener_set_doit` really mandates `CAP_NET_ADMIN`. `nfsd_nl_family` has `.netnsok = true`. `nfsd_nl_ops` has `.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO`. The check in `genl_family_rcv_msg` confirms this: it uses `GENL_ADMIN_PERM` which requires `netlink_capable`, so it needs `CAP_NET_ADMIN` in `init_user_ns`. The crucial part is that `netlink_capable` checks the initial user namespace, not the current one. If they'd wanted user namespace support, it would have used `GENL_UNS_ADMIN_PERM`. So yes, *definitely* not accessible from user namespaces.
Alright, any other path to `nfsd_nl_listener_set_doit`? No. The only call is via genetlink, which requires `CAP_NET_ADMIN`. Is there another way to get to `svc_xprt_create_from_sa` with `cb_lock` held? Nope. The only path is through genetlink, which again requires root.
So, the only way to trigger this is through a genetlink operation requiring `CAP_NET_ADMIN` in `init_user_ns`. Now, if `syz.0.496/8229` isn't root, it won't be triggered, but Syzkaller generally runs as root, unless testing user namespaces. Since the report specifies `CAP_NET_ADMIN`, the test was run as root. This is a DoS, which *is* only triggerable by root. It's not a security vulnerability in the typical sense, but a bug nonetheless.
So, let me summarize the answers:
- Exploitable: No (deadlock).
- Denial of Service: Yes (deadlock of `nfsd_mutex` and `cb_lock` blocking genetlink and nfsd operations).
- Accessible From Unprivileged Processes: No.
- Accessible From User Namespaces: No.
- VM Guest Trigger: No.
|
| 123/2 |
2026/05/24 09:12 |
tool |
grepper |
0m
Args: map[Expression:genl_register_family.*]
Results: map[Output:drivers/acpi/event.c=148=static int __init acpi_event_genetlink_init(void)
drivers/acpi/event.c-149-{
drivers/acpi/event.c:150: return genl_register_family(&acpi_event_genl_family);
drivers/acpi/event.c-151-}
--
drivers/android/binder.c=7091=static int __init binder_init(void)
--
drivers/android/binder.c-7138-
drivers/android/binder.c:7139: ret = genl_register_family(&binder_nl_family);
drivers/android/binder.c-7140- if (ret)
--
drivers/block/nbd.c=2643=static int __init nbd_init(void)
--
drivers/block/nbd.c-2683-
drivers/block/nbd.c:2684: if (genl_register_family(&nbd_genl_family)) {
drivers/block/nbd.c-2685- destroy_workqueue(nbd_del_wq);
--
drivers/dpll/dpll_core.c=1132=static int __init dpll_init(void)
--
drivers/dpll/dpll_core.c-1135-
drivers/dpll/dpll_core.c:1136: ret = genl_register_family(&dpll_nl_family);
drivers/dpll/dpll_core.c-1137- if (ret)
--
drivers/gpu/drm/drm_ras_genl_family.c=17=int drm_ras_genl_family_register(void)
--
drivers/gpu/drm/drm_ras_genl_family.c-22-
drivers/gpu/drm/drm_ras_genl_family.c:23: ret = genl_register_family(&drm_ras_nl_family);
drivers/gpu/drm/drm_ras_genl_family.c-24- if (ret)
--
drivers/net/gtp.c=2500=static int __init gtp_init(void)
--
drivers/net/gtp.c-2513-
drivers/net/gtp.c:2514: err = genl_register_family(>p_genl_family);
drivers/net/gtp.c-2515- if (err < 0)
--
drivers/net/ieee802154/mac802154_hwsim.c=1056=static __init int hwsim_init_module(void)
--
drivers/net/ieee802154/mac802154_hwsim.c-1059-
drivers/net/ieee802154/mac802154_hwsim.c:1060: rc = genl_register_family(&hwsim_genl_family);
drivers/net/ieee802154/mac802154_hwsim.c-1061- if (rc)
--
drivers/net/macsec.c=4510=static int __init macsec_init(void)
--
drivers/net/macsec.c-4526-
drivers/net/macsec.c:4527: err = genl_register_family(&macsec_fam);
drivers/net/macsec.c-4528- if (err)
--
drivers/net/ovpn/netlink.c=1367=int __init ovpn_nl_register(void)
drivers/net/ovpn/netlink.c-1368-{
drivers/net/ovpn/netlink.c:1369: int ret = genl_register_family(&ovpn_nl_family);
drivers/net/ovpn/netlink.c-1370-
drivers/net/ovpn/netlink.c-1371- if (ret) {
drivers/net/ovpn/netlink.c:1372: pr_err("ovpn: genl_register_family failed: %d\n", ret);
drivers/net/ovpn/netlink.c-1373- return ret;
--
drivers/net/team/team_core.c=3030=static int __init team_nl_init(void)
drivers/net/team/team_core.c-3031-{
drivers/net/team/team_core.c:3032: return genl_register_family(&team_nl_family);
drivers/net/team/team_core.c-3033-}
--
drivers/net/wireguard/netlink.c=596=int __init wg_genetlink_init(void)
--
drivers/net/wireguard/netlink.c-600-
drivers/net/wireguard/netlink.c:601: return genl_register_family(&genl_family);
drivers/net/wireguard/netlink.c-602-}
--
drivers/net/wireless/virtual/mac80211_hwsim.c=6978=static int __init hwsim_init_netlink(void)
--
drivers/net/wireless/virtual/mac80211_hwsim.c-6983-
drivers/net/wireless/virtual/mac80211_hwsim.c:6984: rc = genl_register_family(&hwsim_genl_family);
drivers/net/wireless/virtual/mac80211_hwsim.c-6985- if (rc)
--
drivers/regulator/event.c=74=static int __init reg_event_genetlink_init(void)
drivers/regulator/event.c-75-{
drivers/regulator/event.c:76: return genl_register_family(®_event_genl_family);
drivers/regulator/event.c-77-}
--
drivers/scsi/pmcraid.c=1358=static int __init pmcraid_netlink_init(void)
--
drivers/scsi/pmcraid.c-1361-
drivers/scsi/pmcraid.c:1362: result = genl_register_family(&pmcraid_event_family);
drivers/scsi/pmcraid.c-1363-
--
drivers/target/target_core_user.c=3321=static int __init tcmu_module_init(void)
--
drivers/target/target_core_user.c-3341-
drivers/target/target_core_user.c:3342: ret = genl_register_family(&tcmu_genl_family);
drivers/target/target_core_user.c-3343- if (ret < 0) {
--
drivers/thermal/thermal_netlink.c=929=int __init thermal_netlink_init(void)
drivers/thermal/thermal_netlink.c-930-{
drivers/thermal/thermal_netlink.c:931: return genl_register_family(&thermal_genl_family);
drivers/thermal/thermal_netlink.c-932-}
--
drivers/vdpa/vdpa.c=1558=static int vdpa_init(void)
--
drivers/vdpa/vdpa.c-1564- return err;
drivers/vdpa/vdpa.c:1565: err = genl_register_family(&vdpa_nl_family);
drivers/vdpa/vdpa.c-1566- if (err)
--
fs/lockd/svc.c=592=static int __init init_nlm(void)
--
fs/lockd/svc.c-605-
fs/lockd/svc.c:606: err = genl_register_family(&lockd_nl_family);
fs/lockd/svc.c-607- if (err)
--
fs/nfsd/nfsctl.c=2297=static int __init init_nfsd(void)
--
fs/nfsd/nfsctl.c-2327- goto out_free_nfsd4;
fs/nfsd/nfsctl.c:2328: retval = genl_register_family(&nfsd_nl_family);
fs/nfsd/nfsctl.c-2329- if (retval)
--
fs/quota/netlink.c=96=static int __init quota_init(void)
fs/quota/netlink.c-97-{
fs/quota/netlink.c:98: if (genl_register_family("a_genl_family) != 0)
fs/quota/netlink.c-99- printk(KERN_ERR
--
fs/smb/client/netlink.c=64=int cifs_genl_init(void)
--
fs/smb/client/netlink.c-67-
fs/smb/client/netlink.c:68: ret = genl_register_family(&cifs_genl_family);
fs/smb/client/netlink.c-69- if (ret < 0) {
--
fs/smb/server/transport_ipc.c=990=int ksmbd_ipc_init(void)
--
fs/smb/server/transport_ipc.c-996-
fs/smb/server/transport_ipc.c:997: ret = genl_register_family(&ksmbd_genl_family);
fs/smb/server/transport_ipc.c-998- if (ret) {
--
include/linux/drbd_genl.h-70- * and static register/unregister functions to
include/linux/drbd_genl.h:71: * genl_register_family().
include/linux/drbd_genl.h-72- *
--
include/linux/genl_magic_func.h=308=int CONCATENATE(GENL_MAGIC_FAMILY, _genl_register)(void)
include/linux/genl_magic_func.h-309-{
include/linux/genl_magic_func.h:310: return genl_register_family(&ZZZ_genl_family);
include/linux/genl_magic_func.h-311-}
--
include/net/genetlink.h=330=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk);
include/net/genetlink.h:331:int genl_register_family(struct genl_family *family);
include/net/genetlink.h-332-int genl_unregister_family(const struct genl_family *family);
--
kernel/power/em_netlink.c=373=static int __init em_netlink_init(void)
kernel/power/em_netlink.c-374-{
kernel/power/em_netlink.c:375: return genl_register_family(&dev_energymodel_nl_family);
kernel/power/em_netlink.c-376-}
--
kernel/taskstats.c=701=static int __init taskstats_init(void)
--
kernel/taskstats.c-704-
kernel/taskstats.c:705: rc = genl_register_family(&family);
kernel/taskstats.c-706- if (rc)
--
net/batman-adv/netlink.c=1544=void __init batadv_netlink_register(void)
--
net/batman-adv/netlink.c-1547-
net/batman-adv/netlink.c:1548: ret = genl_register_family(&batadv_netlink_family);
net/batman-adv/netlink.c-1549- if (ret)
--
net/core/drop_monitor.c=1725=static int __init init_net_drop_monitor(void)
--
net/core/drop_monitor.c-1746-
net/core/drop_monitor.c:1747: rc = genl_register_family(&net_drop_monitor_family);
net/core/drop_monitor.c-1748- if (rc) {
--
net/core/netdev-genl.c=1427=static int __init netdev_genl_init(void)
--
net/core/netdev-genl.c-1434-
net/core/netdev-genl.c:1435: err = genl_register_family(&netdev_nl_family);
net/core/netdev-genl.c-1436- if (err)
--
net/devlink/core.c=577=static int __init devlink_init(void)
--
net/devlink/core.c-583- goto out;
net/devlink/core.c:584: err = genl_register_family(&devlink_nl_family);
net/devlink/core.c-585- if (err)
--
net/ethtool/netlink.c=1571=static int __init ethnl_init(void)
--
net/ethtool/netlink.c-1574-
net/ethtool/netlink.c:1575: ret = genl_register_family(ðtool_genl_family);
net/ethtool/netlink.c-1576- if (WARN(ret < 0, "ethtool: genetlink family registration failed"))
--
net/handshake/netlink.c=244=static int __init handshake_init(void)
--
net/handshake/netlink.c-253-
net/handshake/netlink.c:254: ret = genl_register_family(&handshake_nl_family);
net/handshake/netlink.c-255- if (ret) {
--
net/hsr/hsr_netlink.c=566=int __init hsr_netlink_init(void)
--
net/hsr/hsr_netlink.c-573-
net/hsr/hsr_netlink.c:574: rc = genl_register_family(&hsr_genl_family);
net/hsr/hsr_netlink.c-575- if (rc)
net/hsr/hsr_netlink.c:576: goto fail_genl_register_family;
net/hsr/hsr_netlink.c-577-
--
net/hsr/hsr_netlink.c-580-
net/hsr/hsr_netlink.c:581:fail_genl_register_family:
net/hsr/hsr_netlink.c-582- rtnl_link_unregister(&hsr_link_ops);
--
net/ieee802154/netlink.c=140=int __init ieee802154_nl_init(void)
net/ieee802154/netlink.c-141-{
net/ieee802154/netlink.c:142: return genl_register_family(&nl802154_family);
net/ieee802154/netlink.c-143-}
--
net/ieee802154/nl802154.c=3100=int __init nl802154_init(void)
net/ieee802154/nl802154.c-3101-{
net/ieee802154/nl802154.c:3102: return genl_register_family(&nl802154_fam);
net/ieee802154/nl802154.c-3103-}
--
net/ipv4/fou_core.c=1244=static int __init fou_init(void)
--
net/ipv4/fou_core.c-1251-
net/ipv4/fou_core.c:1252: ret = genl_register_family(&fou_nl_family);
net/ipv4/fou_core.c-1253- if (ret < 0)
--
net/ipv4/tcp_metrics.c=1046=void __init tcp_metrics_init(void)
--
net/ipv4/tcp_metrics.c-1055-
net/ipv4/tcp_metrics.c:1056: ret = genl_register_family(&tcp_metrics_nl_family);
net/ipv4/tcp_metrics.c-1057- if (ret < 0)
--
net/ipv6/ila/ila_main.c=92=static int __init ila_init(void)
--
net/ipv6/ila/ila_main.c-99-
net/ipv6/ila/ila_main.c:100: ret = genl_register_family(&ila_nl_family);
net/ipv6/ila/ila_main.c-101- if (ret)
--
net/ipv6/ioam6.c=1027=int __init ioam6_init(void)
--
net/ipv6/ioam6.c-1032-
net/ipv6/ioam6.c:1033: err = genl_register_family(&ioam6_genl_family);
net/ipv6/ioam6.c-1034- if (err)
--
net/ipv6/seg6.c=505=int __init seg6_init(void)
--
net/ipv6/seg6.c-512-
net/ipv6/seg6.c:513: err = genl_register_family(&seg6_genl_family);
net/ipv6/seg6.c-514- if (err)
--
net/l2tp/l2tp_netlink.c=1042=static int __init l2tp_nl_init(void)
--
net/l2tp/l2tp_netlink.c-1044- pr_info("L2TP netlink interface\n");
net/l2tp/l2tp_netlink.c:1045: return genl_register_family(&l2tp_nl_family);
net/l2tp/l2tp_netlink.c-1046-}
--
net/mptcp/pm_netlink.c=642=void __init mptcp_pm_nl_init(void)
net/mptcp/pm_netlink.c-643-{
net/mptcp/pm_netlink.c:644: if (genl_register_family(&mptcp_genl_family))
net/mptcp/pm_netlink.c-645- panic("Failed to register MPTCP PM netlink family\n");
--
net/ncsi/ncsi-netlink.c=774=static int __init ncsi_init_netlink(void)
net/ncsi/ncsi-netlink.c-775-{
net/ncsi/ncsi-netlink.c:776: return genl_register_family(&ncsi_genl_family);
net/ncsi/ncsi-netlink.c-777-}
--
net/netfilter/ipvs/ip_vs_ctl.c=4875=static int __init ip_vs_genl_register(void)
net/netfilter/ipvs/ip_vs_ctl.c-4876-{
net/netfilter/ipvs/ip_vs_ctl.c:4877: return genl_register_family(&ip_vs_genl_family);
net/netfilter/ipvs/ip_vs_ctl.c-4878-}
--
net/netlabel/netlabel_calipso.c=386=int __init netlbl_calipso_genl_init(void)
net/netlabel/netlabel_calipso.c-387-{
net/netlabel/netlabel_calipso.c:388: return genl_register_family(&netlbl_calipso_gnl_family);
net/netlabel/netlabel_calipso.c-389-}
--
net/netlabel/netlabel_cipso_v4.c=785=int __init netlbl_cipsov4_genl_init(void)
net/netlabel/netlabel_cipso_v4.c-786-{
net/netlabel/netlabel_cipso_v4.c:787: return genl_register_family(&netlbl_cipsov4_gnl_family);
net/netlabel/netlabel_cipso_v4.c-788-}
--
net/netlabel/netlabel_mgmt.c=839=int __init netlbl_mgmt_genl_init(void)
net/netlabel/netlabel_mgmt.c-840-{
net/netlabel/netlabel_mgmt.c:841: return genl_register_family(&netlbl_mgmt_gnl_family);
net/netlabel/netlabel_mgmt.c-842-}
--
net/netlabel/netlabel_unlabeled.c=1384=int __init netlbl_unlabel_genl_init(void)
net/netlabel/netlabel_unlabeled.c-1385-{
net/netlabel/netlabel_unlabeled.c:1386: return genl_register_family(&netlbl_unlabel_gnl_family);
net/netlabel/netlabel_unlabeled.c-1387-}
--
net/netlink/genetlink.c=737=void *genl_sk_priv_get(struct genl_family *family, struct sock *sk)
--
net/netlink/genetlink.c-763-/**
net/netlink/genetlink.c:764: * genl_register_family - register a generic netlink family
net/netlink/genetlink.c-765- * @family: generic netlink family
--
net/netlink/genetlink.c-774- */
net/netlink/genetlink.c:775:int genl_register_family(struct genl_family *family)
net/netlink/genetlink.c-776-{
--
net/netlink/genetlink.c-839-}
net/netlink/genetlink.c:840:EXPORT_SYMBOL(genl_register_family);
net/netlink/genetlink.c-841-
--
net/netlink/genetlink.c=1910=static int __init genl_init(void)
--
net/netlink/genetlink.c-1913-
net/netlink/genetlink.c:1914: err = genl_register_family(&genl_ctrl);
net/netlink/genetlink.c-1915- if (err < 0)
--
net/nfc/netlink.c=1909=int __init nfc_genl_init(void)
--
net/nfc/netlink.c-1912-
net/nfc/netlink.c:1913: rc = genl_register_family(&nfc_genl_family);
net/nfc/netlink.c-1914- if (rc)
--
net/openvswitch/datapath.c=2672=static int __init dp_register_genl(void)
--
net/openvswitch/datapath.c-2678-
net/openvswitch/datapath.c:2679: err = genl_register_family(dp_genl_families[i]);
net/openvswitch/datapath.c-2680- if (err)
--
net/psample/psample.c=518=static int __init psample_module_init(void)
net/psample/psample.c-519-{
net/psample/psample.c:520: return genl_register_family(&psample_nl_family);
net/psample/psample.c-521-}
--
net/psp/psp_main.c=373=static int __init psp_init(void)
--
net/psp/psp_main.c-376-
net/psp/psp_main.c:377: return genl_register_family(&psp_nl_family);
net/psp/psp_main.c-378-}
--
net/shaper/shaper.c=1529=static int __init shaper_init(void)
net/shaper/shaper.c-1530-{
net/shaper/shaper.c:1531: return genl_register_family(&net_shaper_nl_family);
net/shaper/shaper.c-1532-}
--
net/smc/smc_netlink.c=149=int __init smc_nl_init(void)
net/smc/smc_netlink.c-150-{
net/smc/smc_netlink.c:151: return genl_register_family(&smc_gen_nl_family);
net/smc/smc_netlink.c-152-}
--
net/smc/smc_pnet.c=893=int __init smc_pnet_init(void)
--
net/smc/smc_pnet.c-896-
net/smc/smc_pnet.c:897: rc = genl_register_family(&smc_pnet_nl_family);
net/smc/smc_pnet.c-898- if (rc)
--
net/tipc/netlink.c=300=int __init tipc_netlink_start(void)
--
net/tipc/netlink.c-303-
net/tipc/netlink.c:304: res = genl_register_family(&tipc_genl_family);
net/tipc/netlink.c-305- if (res) {
--
net/tipc/netlink_compat.c=1357=int __init tipc_netlink_compat_start(void)
--
net/tipc/netlink_compat.c-1360-
net/tipc/netlink_compat.c:1361: res = genl_register_family(&tipc_genl_compat_family);
net/tipc/netlink_compat.c-1362- if (res) {
--
net/wireless/nl80211.c=23018=int __init nl80211_init(void)
--
net/wireless/nl80211.c-23021-
net/wireless/nl80211.c:23022: err = genl_register_family(&nl80211_fam);
net/wireless/nl80211.c-23023- if (err)
--
tools/lib/thermal/commands.c=490=thermal_error_t thermal_cmd_init(struct thermal_handler *th)
--
tools/lib/thermal/commands.c-497-
tools/lib/thermal/commands.c:498: ret = genl_register_family(&thermal_cmd_ops);
tools/lib/thermal/commands.c-499- if (ret)
]
|
| 124/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 109160
output: 20
thoughts: 54
Thoughts: **Investigating the `lockd.ko` Module**
Okay, so I'm thinking about how the `fs/lockd/svc.c` source file relates to the `lockd.ko` kernel module. Right, that makes sense – I remember that compilation process. But, a nagging question popped into my head: does `lockd.ko` have any aliases defined? Knowing that could be important for understanding how it's referenced and loaded within the system.
The most straightforward way to find out is to go directly to the source. Let me just take a peek into `fs/lockd/svc.c` itself. I'll search specifically for `MODULE_ALIAS`. That macro would tell me if this module identifies itself with other names. This will tell me everything I need to know.
|
| 125/2 |
2026/05/24 09:12 |
tool |
grepper |
0m
Error:
Args: map[Expression:MODULE_ALIAS.*lockd]
Results:
|
| 126/2 |
2026/05/24 09:12 |
llm |
expert |
0m
Model:
Tokens:
input: 109418
output: 21
thoughts: 736
Thoughts: **Analyzing a Kernel Hang in `request_module`**
Okay, so I'm looking at this bug report and the first thing that jumps out is that `fs/lockd/svc.c` doesn't seem to have a direct alias. But, could something triggered by `xcl_name` be causing `modprobe` to load a module that *depends* on `lockd`? Or, is `modprobe` just getting blocked on `kmod_concurrent_max`? If that's the case, `request_module` will block for 50 seconds when `kmod_concurrent_max` is reached. If syzkaller is hitting `request_module` 50 times concurrently from different threads, the 51st call should block, right? But the bug report says it's blocked for 143 seconds! That's way longer than the 50-second timeout!
Hmm, hold on. `request_module` uses `down_timeout` with `MAX_KMOD_ALL_BUSY_TIMEOUT * HZ`. If it hits the 50-second timeout, it should return `-ETIME`. This means `nfsd_nl_listener_set_doit` returns and releases `nfsd_mutex`. So, it shouldn't block for that long. Unless… unless `modprobe` itself is what's blocking for 143 seconds. But why would `modprobe` block for that long?
Ah, right! `modprobe` could be blocked on `cb_lock`! If `modprobe` is blocked on `cb_lock`, it blocks indefinitely! That explains it, because `request_module` waits for `modprobe` to finish (it uses `UMH_WAIT_PROC`). So, `request_module` blocks indefinitely! That's the key. That clarifies the hang observed in the bug report. But which module is `modprobe` trying to load that's getting stuck on `cb_lock`?
Any module that calls `genl_register_family` could be the culprit. If syzkaller can somehow set `xcl_name` to something that aliases to a module that calls `genl_register_family`, that would do it. Are there any such modules? Let me check the aliases of modules that call `genl_register_family`. For example, `net/openvswitch/datapath.c` calls `genl_register_family`, but it doesn't have an alias starting with "svc".
Wait a second. `modprobe` can load *any* module if the user provides an alias in `/etc/modprobe.d/`! But syzkaller doesn't modify `/etc/modprobe.d/`. However, `request_module("svc%s", xcl_name)` is running `modprobe svc<xcl_name>`. So, if `xcl_name` is `rdma`, it runs `modprobe svcrdma`. And `svcrdma` is an alias for `rpcrdma`. Now we're getting somewhere. Does `rpcrdma` depend on something that calls `genl_register_family`?
Let's check the dependencies of `rpcrdma`. It depends on `ib_core`, `rdma_cm`, `iw_cm`, and `sunrpc`. Hmm, does `ib_core` register a genetlink family? Let's check `drivers/infiniband/core/nldev.c`.
|
| 127/2 |
2026/05/24 09:13 |
tool |
grepper |
0m
Error:
Args: map[Expression:genl_register_family.*]
|
| 128/2 |
2026/05/24 09:13 |
llm |
expert |
0m
Model:
Tokens:
input: 110971
output: 43
thoughts: 1183
Thoughts: **Analyzing a Potential NFSd Deadlock**
Okay, first things first, I needed to figure out why this syzkaller test was hanging. My initial thought was genetlink, so I started with a quick check of `genl_register_family` calls. I recalled `rdma_nl_register` being used by `ib_core`, but that's just using netlink, not genetlink, so that's not it. Then I thought, what if `modprobe` loads a module that *indirectly* calls `genl_register_family`? Or if `modprobe` itself tried to use netlink? Nope, `modprobe` doesn't use genetlink.
I kept thinking... What's this `xcl_name`? Could that be the trigger? Perhaps `xcl_name` is something else entirely? Then I thought, is there any module registered with a genetlink family that has an alias matching "svc*"? Let's search for the `MODULE_ALIAS("svc*")` string again, I know I already did. Only `svcrdma` matches. What if `xcl_name` is `tcp` and `request_module("svctcp")`? Does `svctcp` even exist? No. If it doesn't, `modprobe` returns an error, and `request_module` returns.
So, why was it hanging? Maybe syzkaller was messing with `modprobe`? It could be using `fault injection`, `ptrace`, or even `fuse` to hang `modprobe`. If syzkaller hangs `modprobe`, then `request_module` hangs. And since `request_module` is called with `nfsd_mutex` and `cb_lock` held, this hangs everything! Global lock, that's a known problem. This is a bug, but is it accessible to unprivileged processes?
Now, let's see, `nfsd_nl_listener_set_doit` requires `CAP_NET_ADMIN` in the initial user namespace. This confirms only root can trigger it. If it's only root, then it's not a security vulnerability. But let me double-check `write_ports` and `/proc/fs/nfsd/portlist`. It's owned by root and has `0644` permissions, so root only. Can unprivileged users mount `nfsd` in a user namespace? No, `nfsd_fs_type` doesn't have `FS_USERNS_MOUNT`. And an unprivileged user can't open `/proc/fs/nfsd/portlist` if root mounted it.
So, this bug is **not** accessible from unprivileged processes or user namespaces. It's a Denial of Service (deadlock) issue, but it can only be triggered by root. Since it can only be triggered by root, it's not a security vulnerability.
Just to be absolutely sure, let me confirm the `nfsd_nl_listener_set_doit` permissions again. Yep, `GENL_ADMIN_PERM` requires `CAP_NET_ADMIN` in `init_user_ns`.
What about `write_ports`? It's a write handler for `/proc/fs/nfsd/portlist`. The permissions check out. `S_IWUSR` is `0200` and `S_IRUGO` is `0444`, totaling `0644`. It's owned by root, so only root can write to it.
I needed to make sure, is there any other way to reach `svc_xprt_create_from_sa`? Well, `svc_xprt_create` is called by `create_lockd_listener`, which is called by `create_lockd_family`, which is called by `make_socks`, which is called by `lockd_up_net`, which is called by `lockd_up`. `lockd_up` is called by `nfsd_startup_net` and `nlmclnt_init`. `nfsd_startup_net` is called when starting nfsd, which requires root. `nlmclnt_init` is called when mounting NFS. Mounting NFS requires `CAP_SYS_ADMIN` in `init_user_ns` because NFS doesn't have `FS_USERNS_MOUNT`.
|
| 129/2 |
2026/05/24 09:13 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfs/super.c IncludeLines:true Name:nfs_fs_type]
Results: map[SourceCode:1766: struct file_system_type nfs_fs_type = {
1767: .owner = THIS_MODULE,
1768: .name = "nfs",
1769: .init_fs_context = nfs_init_fs_context,
1770: .parameters = nfs_fs_parameters,
1771: .kill_sb = nfs_kill_super,
1772: .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA,
1773: };
SourceFile:fs/nfs/fs_context.c]
|
| 130/2 |
2026/05/24 09:13 |
llm |
expert |
0m
Model:
Tokens:
input: 113341
output: 44
thoughts: 17
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience:
**Kernel Mount Considerations**
Hmm, no `FS_USERNS_MOUNT` flag... that's a bit of a wrinkle. I'm immediately thinking about the implications for secure user namespaces and delegated mounting in particular. We're obviously missing a crucial capability here if that flag isn't present. The question is, what are the alternatives? Is there some workaround, some subtle detail I'm overlooking in the mount options, some clever combination of features we can leverage without it?
My mind is already racing through the implications. Is this a feature that's intentionally disabled for security reasons in this context, or is it a bug or oversight? What's the kernel version? Could we work around this by using a different approach to mounting altogether, using a FUSE based mount? I need to understand the constraints and the goal of this mount operation to determine how to proceed.
And of course, NFSv4 is in the back of my mind. It’s the obvious next consideration. Does it support the feature directly or is there another way to achieve the desired outcome? I need to think through the client and server side implications carefully. This missing flag is likely a critical piece in the puzzle when it comes to NFS and user namespaces, if they're even relevant in this particular configuration.
|
| 131/2 |
2026/05/24 09:13 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/nfs/super.c IncludeLines:true Name:nfs4_fs_type]
Results: map[SourceCode:1778: struct file_system_type nfs4_fs_type = {
1779: .owner = THIS_MODULE,
1780: .name = "nfs4",
1781: .init_fs_context = nfs_init_fs_context,
1782: .parameters = nfs_fs_parameters,
1783: .kill_sb = nfs_kill_super,
1784: .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA,
1785: };
SourceFile:fs/nfs/fs_context.c]
|
| 132/2 |
2026/05/24 09:13 |
llm |
expert |
0m
Model:
Tokens:
input: 113877
output: 66
thoughts: 392
Thoughts: **My Assessment of the NFS Deadlock Vulnerability**
Okay, so after digging into this, it's clear: there's no way to trigger this with `FS_USERNS_MOUNT`, which immediately limits the scope. All the entry points to the potentially vulnerable function, `svc_xprt_create_from_sa`, *require* root privileges within the initial user namespace. That means this is *not* something an unprivileged process can exploit, and it's also not reachable from a user namespace at all.
Essentially, we're looking at a Denial of Service scenario – a deadlock, specifically – but it's only exploitable by the root user. The crux of the issue boils down to a deadlock that happens when `request_module` is called while holding `nfsd_mutex` and `cb_lock` (with genetlink being a likely vector). `request_module` is waiting on `modprobe`, and if that process hangs, the kernel thread hangs with it. This could happen if syzkaller is intercepting it or if the loaded module also tries to acquire `cb_lock`.
The entry points are the genetlink path, `nfsd_nl_listener_set_doit`, and the `/proc/fs/nfsd/portlist` path via `write_ports`. The genetlink path specifically needs `CAP_NET_ADMIN` in the initial user namespace (`GENL_ADMIN_PERM`), and `/proc/fs/nfsd/portlist` needs root access to write (given the `0644` permissions). Other paths like mounting NFS, also need `CAP_SYS_ADMIN` in the initial user namespace.
Given that this is restricted to root within the initial namespace, I'm confident in classifying this as a denial of service, but not a security vulnerability. My conclusions will be documented accordingly.
|
| 133/2 |
2026/05/24 09:13 |
tool |
set-results |
0m
Args: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 134/2 |
2026/05/24 09:13 |
llm |
expert |
0m
Model:
Tokens:
input: 114798
output: 644
thoughts: 384
Thoughts: **My Analysis of the NFS Deadlock Vulnerability**
Okay, the analysis is complete, and it's time to craft the final response. My focus needs to be on explaining the mechanism of the deadlock and why its impact is limited to root-level access.
Here’s how it unfolds: I've observed that the `nfsd_nl_listener_set_doit` function, triggered through genetlink, is the key. It's initially called with `cb_lock` held in read mode, courtesy of `genl_rcv`. This is step one.
Then, the critical step: inside `nfsd_nl_listener_set_doit`, the code acquires `nfsd_mutex`. After that, the `svc_xprt_create_from_sa` function is called, which then invokes `request_module("svc%s", xcl_name)`. Now, here's where things get interesting. `request_module`, as we know, spawns a user-mode helper, namely `modprobe`, and importantly, it waits for `modprobe` to complete.
The crux of the problem lies in `modprobe` hanging. This could happen if, for instance, a fuzzer like syzkaller intercepts it, or, more insidiously, if `modprobe` attempts to load a module that, in turn, calls `genl_register_family`. This call might try to acquire `cb_lock` in write mode, resulting in a classic deadlock scenario, and bringing down the kernel thread. This effectively freezes all subsequent genetlink and NFS daemon operations.
Now, concerning the privilege requirements, this is critical to avoid any mischaracterization. `nfsd_nl_listener_set_doit` is registered with `GENL_ADMIN_PERM`, which translates to needing `CAP_NET_ADMIN` within the initial user namespace. The alternative route, using `/proc/fs/nfsd/portlist`, requires root privileges for write access (given its permissions). Other NFS operations, such as mounting, require `CAP_SYS_ADMIN`, also within the initial namespace.
Therefore, despite the potential Denial of Service (DoS) from the deadlock, this vulnerability is only exploitable by root-level users within the initial user namespace. Thus, while problematic in terms of availability, it doesn't represent a direct security breach allowing privilege escalation or other unauthorized access.
|
| 135/1 |
2026/05/24 09:13 |
action |
format-explanation |
0m
Results: map[Explanation:Based on the analysis of the bug report and the kernel source code, here is the
assessment of the security impact:
### Bug Mechanism
The bug is a deadlock caused by calling `request_module()` while holding global
locks.
1. The task `syz.0.496/8229` processes a generic netlink message and enters
`nfsd_nl_listener_set_doit()`. At this point, it holds the genetlink `cb_lock`
(acquired for reading in `genl_rcv()`).
2. `nfsd_nl_listener_set_doit()` acquires the global `nfsd_mutex`.
3. It then calls `svc_xprt_create_from_sa()`, which attempts to load a transport
module based on the user-provided name by calling `request_module("svc%s",
xcl_name)`.
4. `request_module()` spawns a user-mode helper (`modprobe`) and waits for it to
finish.
5. If the user-mode helper hangs (e.g., if it is intercepted/ptraced by a
malicious root user, or if it attempts to load a module that calls
`genl_register_family()` which blocks waiting for `cb_lock` for writing), the
kernel thread will hang indefinitely.
6. This results in a deadlock, holding both `cb_lock` and `nfsd_mutex`, which
blocks all subsequent genetlink operations and nfsd operations (as seen in the
bug report where other tasks are blocked on `nfsd_mutex`).
### Privilege Requirements
While this is a valid Denial of Service (deadlock), it is **not accessible to
unprivileged users**:
1. **Genetlink Path**: The `NFSD_CMD_LISTENER_SET` command is registered in
`nfsd_nl_ops` with the `GENL_ADMIN_PERM` flag. The genetlink core checks this
flag using `netlink_capable(skb, CAP_NET_ADMIN)`, which strictly requires
`CAP_NET_ADMIN` in the **initial user namespace**.
2. **Procfs Path**: The alternative way to reach this code is by writing to
`/proc/fs/nfsd/portlist`. This file is created with `0644` permissions and is
owned by root. Furthermore, the `nfsd` filesystem lacks the `FS_USERNS_MOUNT`
flag, meaning it cannot be mounted inside an unprivileged user namespace.
3. **NFS Mounts**: Other indirect paths (like mounting NFS or NFSv4) require
`CAP_SYS_ADMIN` in the initial user namespace.
### Conclusion
The bug results in a Denial of Service (deadlock) but is strictly limited to the
root user (or a user with `CAP_NET_ADMIN` in the initial user namespace). Since
an attacker must already possess root privileges to trigger the vulnerability,
it does not cross any security boundaries and is not considered a security
vulnerability.]
|