| 0/0 |
2026/08/14 00:06 |
flow |
assessment-security |
6m
Results: map[DenialOfService:true Explanation:**Analysis of the Bug**
The bug report indicates a hung task timeout (task blocked for more than 143
seconds) in `afs_wait_for_call_to_complete()`. The stack trace shows that the
kernel is attempting to mount an AFS (Andrew File System) volume and is waiting
for a synchronous RxRPC network call to complete (`afs_vl_get_entry_by_name_u`).
**Root Cause:**
The hang is caused by a design flaw in the `rxrpc` subsystem's channel
allocation and timeout handling.
When an AFS client makes an RPC call, `rxrpc` assigns it to a connection bundle.
A bundle can have a maximum of 4 connections, each with 4 channels, allowing up
to 16 concurrent active calls to the same server. If the client makes a 17th
concurrent call, `rxrpc` queues it in `bundle->waiting_calls` because there are
no available channels.
Crucially, the timeout timer for a call (`call->hard_timo`) is **not started**
while the call is sitting in the `waiting_calls` queue. It is only started once
a channel becomes available and the call is activated.
If the AFS server is slow or malicious and drops packets, the first 16 active
calls will eventually time out (e.g., after `AFS_VL_MAX_LIFESPAN` which is 120
seconds). Once they time out, the channels are freed, and the 17th queued call
is activated. Its timer is then started for another 120 seconds.
As a result, the 17th call will wait for 120s (in the queue) + 120s (active) =
240 seconds. Because `afs_wait_for_call_to_complete()` waits in the
`TASK_UNINTERRUPTIBLE` state, this 240-second wait exceeds the kernel's hung
task watchdog timeout (typically 120 or 143 seconds), triggering the hung task
warning and potentially a kernel panic (if `kernel.hung_task_panic` is enabled).
**Security Impact Assessment:**
* **Exploitable:** **False**. This is a pure Denial of Service (DoS) issue
caused by a delayed timeout. There is no memory corruption, use-after-free, or
information leak involved.
* **Denial Of Service:** **True**. The bug causes tasks to hang in
`TASK_UNINTERRUPTIBLE` indefinitely (or long enough to trigger the hung task
watchdog), which can lead to a system crash if `hung_task_panic` is enabled, or
resource exhaustion.
* **Accessible From Unprivileged Processes & User Namespaces:** **False**. The
bug is located in the AFS filesystem client. The `afs` filesystem type does not
have the `FS_USERNS_MOUNT` flag, meaning it cannot be mounted by unprivileged
users, even within a user namespace. It strictly requires `CAP_SYS_ADMIN` in the
initial network/user namespace. While an unprivileged user could theoretically
trigger this DoS by accessing files on an *already mounted* AFS share, the bug
is unreachable in a default, unconfigured system.
* **Network Trigger:** **True**. A malicious or unresponsive AFS server can
intentionally ignore requests to exhaust the client's RxRPC channels, forcing
subsequent calls into the waiting queue and triggering the hung task watchdog on
the client.
* **Filesystem Trigger:** **False**. Although the bug is triggered during a
`mount()` syscall, the root cause is a network timeout issue with the remote
server, not the parsing of a malicious local filesystem image. Exploitable:false FilesystemTrigger:false NetworkTrigger:true PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 1/1 |
2026/08/14 00:06 |
action |
syz-repro-to-c-repro |
0m
Results:
|
| 2/1 |
2026/08/14 00:06 |
action |
kernel-checkouter |
0m
Results: map[KernelSrc:/app/workdir/cache/src/1a0aec36943dd0206494f9376d07cfbf81ffc6ec]
|
| 3/1 |
2026/08/14 00:06 |
action |
kernel-builder |
0m
Results: map[KernelObj:/app/workdir/cache/build/08334821d8d80cb6f47ee2b4101b354a0ad47823]
|
| 4/1 |
2026/08/14 00:06 |
action |
codesearch-prepare |
0m
Results: map[Index:codesearch-index]
|
| 5/1 |
2026/08/14 00:06 |
agent |
expert |
5m
Model:
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:true 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 grepping
".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, elevated privileges, or an information leak.
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 completely 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 transfers, that 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 exploitability depends on how exactly the uninit value
is used in the code, and what it affects.
Information leaks are exploitable on their own and should be classified as such. A bug that copies kernel
memory contents to userspace (e.g. an out-of-bounds read whose result is returned to the caller, or
uninitialized stack/heap bytes written to a user buffer) is exploitable: it can reveal kernel pointer
values and defeat KASLR, expose sensitive data such as cryptographic keys or other processes' memory, and
serves as a necessary building block in most modern kernel privilege-escalation exploit chains. Do not classify
an information leak as non-exploitable solely because it does not directly cause a memory write or control-flow
hijack; the leak itself is the exploit primitive.
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 Confidential 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.0.3232:18856 blocked for more than 143 seconds.
Tainted: G L syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.0.3232 state:D stack:27528 pid:18856 tgid:18853 ppid:13150 task_flags:0x400140 flags:0x00080002
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5510 [inline]
__schedule+0x17d9/0x56c0 kernel/sched/core.c:7234
__schedule_loop kernel/sched/core.c:7311 [inline]
schedule+0x164/0x2b0 kernel/sched/core.c:7326
afs_wait_for_call_to_complete+0x3a3/0xb20 fs/afs/rxrpc.c:662
afs_vl_get_entry_by_name_u+0x3aa/0x6a0 fs/afs/vlclient.c:152
afs_vl_lookup_vldb fs/afs/volume.c:167 [inline]
afs_create_volume+0x1fe/0x1170 fs/afs/volume.c:204
afs_sample_volume fs/afs/vl_alias.c:30 [inline]
afs_do_cell_detect_alias fs/afs/vl_alias.c:295 [inline]
afs_cell_detect_alias+0x52a/0x1160 fs/afs/vl_alias.c:327
afs_validate_fc fs/afs/super.c:388 [inline]
afs_get_tree+0x245/0x12c0 fs/afs/super.c:555
vfs_get_tree+0x92/0x2a0 fs/super.c:1700
fc_mount fs/namespace.c:1198 [inline]
do_new_mount_fc fs/namespace.c:3765 [inline]
do_new_mount+0x319/0xdc0 fs/namespace.c:3841
do_mount fs/namespace.c:4174 [inline]
__do_sys_mount fs/namespace.c:4390 [inline]
__se_sys_mount+0x31d/0x420 fs/namespace.c:4367
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc431d9e0d9
RSP: 002b:00007fc42fff6028 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fc432025fa0 RCX: 00007fc431d9e0d9
RDX: 0000200000000c00 RSI: 0000200000000b00 RDI: 0000200000000d00
RBP: 00007fc431e35024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc432026038 R14: 00007fc432025fa0 R15: 00007fff9ac944d8
</TASK>
Showing all locks held in the system:
2 locks held by kworker/u8:0/12:
#0: ffff88801b064140 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff88801b064140 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffff8880b8724440 (psi_seq){-.-.}-{0:0}, at: psi_task_switch+0x57/0x7d0 kernel/sched/psi.c:933
1 lock held by khungtaskd/31:
#0: ffffffff8eb59c60 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:300 [inline]
#0: ffffffff8eb59c60 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:840 [inline]
#0: ffffffff8eb59c60 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180 kernel/locking/lockdep.c:6775
3 locks held by kworker/u8:3/47:
#0: ffff88801b064140 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff88801b064140 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffffc90000b77c40 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#1: ffffc90000b77c40 ((linkwatch_work).work){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#2: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: linkwatch_event+0xe/0x60 net/core/link_watch.c:313
1 lock held by dhcpcd/5273:
#0: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_net_lock include/linux/rtnetlink.h:130 [inline]
#0: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: inet_rtm_deladdr+0x1c1/0x790 net/ipv4/devinet.c:670
2 locks held by getty/5367:
#0: ffff8880358d80a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
#1: ffffc9000322b2e8 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x45a/0x1360 drivers/tty/n_tty.c:2211
2 locks held by dhcpcd/5419:
#0: ffff8880768b6f80 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline]
#0: ffff8880768b6f80 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: __sock_release net/socket.c:709 [inline]
#0: ffff8880768b6f80 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: sock_close+0x82/0x220 net/socket.c:1501
#1: ffffffff8eb5ff68 (rcu_state.exp_mutex){+.+.}-{4:4}, at: exp_funnel_lock kernel/rcu/tree_exp.h:343 [inline]
#1: ffffffff8eb5ff68 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x38d/0x770 kernel/rcu/tree_exp.h:961
3 locks held by kworker/1:3/5728:
#0: ffff888021ecf940 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff888021ecf940 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffffc90003dc7c40 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#1: ffffc90003dc7c40 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#2: ffff8880294691d8 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1104 [inline]
#2: ffff8880294691d8 (&dev->mutex){....}-{4:4}, at: hub_event+0x184/0x4d30 drivers/usb/core/hub.c:5907
3 locks held by kworker/1:5/5757:
#0: ffff88801b02b140 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff88801b02b140 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffffc90004ac7c40 (netdev_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#1: ffffc90004ac7c40 (netdev_work){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#2: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: netdev_work_proc+0x6f/0x770 net/core/netdev_work.c:132
3 locks held by kworker/0:2/17891:
#0: ffff88801b02b140 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#0: ffff88801b02b140 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#1: ffffc9000df1fc40 ((work_completion)(&aux->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3297 [inline]
#1: ffffc9000df1fc40 ((work_completion)(&aux->work)){+.+.}-{0:0}, at: process_scheduled_works+0xa20/0x14e0 kernel/workqueue.c:3405
#2: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: bpf_prog_dev_bound_destroy+0x29/0x3f0 kernel/bpf/offload.c:377
1 lock held by syz.0.3232/18856:
#0: ffff88807c0262b0 (&net->cells_alias_lock){+.+.}-{4:4}, at: afs_cell_detect_alias+0xf1/0x1160 fs/afs/vl_alias.c:323
4 locks held by syz-executor/18931:
1 lock held by syz.6.3659/20703:
#0: ffffffff8eb5fe38 (rcu_state.barrier_mutex){+.+.}-{4:4}, at: rcu_barrier+0x4c/0x530 kernel/rcu/tree.c:3857
3 locks held by syz.7.3665/20727:
#0: ffffffff8f76ac08 (&ops->srcu#2){.+.+}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:300 [inline]
#0: ffffffff8f76ac08 (&ops->srcu#2){.+.+}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:840 [inline]
#0: ffffffff8f76ac08 (&ops->srcu#2){.+.+}-{0:0}, at: rtnl_link_ops_get+0x23/0x250 net/core/rtnetlink.c:570
#1: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_lock net/core/rtnetlink.c:80 [inline]
#1: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_nets_lock net/core/rtnetlink.c:341 [inline]
#1: ffffffff90027f40 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_newlink+0x8a3/0x1bd0 net/core/rtnetlink.c:4158
#2: ffffffff8eb5ff68 (rcu_state.exp_mutex){+.+.}-{4:4}, at: exp_funnel_lock kernel/rcu/tree_exp.h:311 [inline]
#2: ffffffff8eb5ff68 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x2d0/0x770 kernel/rcu/tree_exp.h:961
=============================================
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 31 Comm: khungtaskd Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
nmi_cpu_backtrace+0x274/0x2d0 lib/nmi_backtrace.c:122
nmi_trigger_cpumask_backtrace+0x17a/0x380 lib/nmi_backtrace.c:65
trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline]
__sys_info lib/sys_info.c:157 [inline]
sys_info+0x135/0x170 lib/sys_info.c:165
check_hung_uninterruptible_tasks kernel/hung_task.c:353 [inline]
watchdog+0xfd7/0x1030 kernel/hung_task.c:561
kthread+0x388/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
RIP: 0010:pv_native_safe_halt+0xf/0x20 arch/x86/kernel/paravirt.c:64
Code: cb 7e 02 e9 9e 8f 3f f5 cc cc cc 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 b3 be 18 00 fb f4 <e9> 77 8f 3f f5 cc cc cc cc cc cc cc cc cc cc cc cc 90 90 90 90 90
RSP: 0018:ffffffff8e807de0 EFLAGS: 00000246
RAX: 00000000038675b1 RBX: ffffffff819b4450 RCX: 0000000080000001
RDX: 0000000000000001 RSI: ffffffff8e228edb RDI: ffffffff8c4bbf80
RBP: ffffffff8e807eb8 R08: ffff8880b86338db R09: 1ffff110170c671b
R10: dffffc0000000000 R11: ffffed10170c671c R12: 0000000000000000
R13: 1ffffffff1d11de8 R14: 1ffffffff1d00fc4 R15: dffffc0000000000
FS: 0000000000000000(0000) GS:ffff888124f55000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3d7b9ef2f8 CR3: 000000007a00c000 CR4: 0000000000350ef0
Call Trace:
<TASK>
arch_safe_halt arch/x86/kernel/process.c:767 [inline]
default_idle+0x9/0x20 arch/x86/kernel/process.c:768
default_idle_call+0x72/0xb0 kernel/sched/idle.c:122
cpuidle_idle_call kernel/sched/idle.c:199 [inline]
do_idle+0x2e0/0x540 kernel/sched/idle.c:355
cpu_startup_entry+0x43/0x60 kernel/sched/idle.c:454
rest_init+0x2de/0x300 init/main.c:717
start_kernel+0x392/0x3e0 init/main.c:1175
x86_64_start_reservations+0x24/0x30 arch/x86/kernel/head64.c:310
x86_64_start_kernel+0x137/0x1b0 arch/x86/kernel/head64.c:291
common_startup_64+0x13e/0x157
</TASK>
Reply: **Analysis of the Bug**
The bug report indicates a hung task timeout (task blocked for more than 143 seconds) in `afs_wait_for_call_to_complete()`. The stack trace shows that the kernel is attempting to mount an AFS (Andrew File System) volume and is waiting for a synchronous RxRPC network call to complete (`afs_vl_get_entry_by_name_u`).
**Root Cause:**
The hang is caused by a design flaw in the `rxrpc` subsystem's channel allocation and timeout handling.
When an AFS client makes an RPC call, `rxrpc` assigns it to a connection bundle. A bundle can have a maximum of 4 connections, each with 4 channels, allowing up to 16 concurrent active calls to the same server. If the client makes a 17th concurrent call, `rxrpc` queues it in `bundle->waiting_calls` because there are no available channels.
Crucially, the timeout timer for a call (`call->hard_timo`) is **not started** while the call is sitting in the `waiting_calls` queue. It is only started once a channel becomes available and the call is activated.
If the AFS server is slow or malicious and drops packets, the first 16 active calls will eventually time out (e.g., after `AFS_VL_MAX_LIFESPAN` which is 120 seconds). Once they time out, the channels are freed, and the 17th queued call is activated. Its timer is then started for another 120 seconds.
As a result, the 17th call will wait for 120s (in the queue) + 120s (active) = 240 seconds. Because `afs_wait_for_call_to_complete()` waits in the `TASK_UNINTERRUPTIBLE` state, this 240-second wait exceeds the kernel's hung task watchdog timeout (typically 120 or 143 seconds), triggering the hung task warning and potentially a kernel panic (if `kernel.hung_task_panic` is enabled).
**Security Impact Assessment:**
* **Exploitable:** **False**. This is a pure Denial of Service (DoS) issue caused by a delayed timeout. There is no memory corruption, use-after-free, or information leak involved.
* **Denial Of Service:** **True**. The bug causes tasks to hang in `TASK_UNINTERRUPTIBLE` indefinitely (or long enough to trigger the hung task watchdog), which can lead to a system crash if `hung_task_panic` is enabled, or resource exhaustion.
* **Accessible From Unprivileged Processes & User Namespaces:** **False**. The bug is located in the AFS filesystem client. The `afs` filesystem type does not have the `FS_USERNS_MOUNT` flag, meaning it cannot be mounted by unprivileged users, even within a user namespace. It strictly requires `CAP_SYS_ADMIN` in the initial network/user namespace. While an unprivileged user could theoretically trigger this DoS by accessing files on an *already mounted* AFS share, the bug is unreachable in a default, unconfigured system.
* **Network Trigger:** **True**. A malicious or unresponsive AFS server can intentionally ignore requests to exhaust the client's RxRPC channels, forcing subsequent calls into the waiting queue and triggering the hung task watchdog on the client.
* **Filesystem Trigger:** **False**. Although the bug is triggered during a `mount()` syscall, the root cause is a network timeout issue with the remote server, not the parsing of a malicious local filesystem image.
|
| 6/2 |
2026/08/14 00:06 |
llm |
expert |
0m
Model:
Tokens:
input: 11328
output: 19
thoughts: 418
Thoughts: **AFS Mount Blocking Bug Analysis**
Okay, so I've got this bug report, "INFO: task syz.0.3232:18856 blocked for more than 143 seconds." That's a classic sign of something holding up a task, and the clue is it's blocked in `afs_wait_for_call_to_complete`. Looking at the stack trace, it's clear the problem is within the AFS filesystem code, specifically while trying to mount. It seems to be getting stuck in `afs_cell_detect_alias`, which is called from `afs_validate_fc`, and eventually leads up to `afs_get_tree` β the mount point itself.
The stack shows it's going through `afs_vl_get_entry_by_name_u`, and then `afs_create_volume`, which is where things seem to be getting stuck. So it's trying to validate something about the volume. `afs_wait_for_call_to_complete` suggests it's waiting on a network call or I/O. So it's very likely blocked on a RPC call, either on a volume server or VLDB server.
The immediate question that pops into my head is, can an unprivileged user even trigger an AFS mount? I need to check the filesystem's context and permissioning. I'll need to dig into `fs/afs/super.c` to see how the mount process is handled. I need to look for `fs_context_operations` and `file_system_type` to see the permissioning and configuration. If it's something that an unprivileged user can do, this could be a nasty DoS vulnerability. If not, it could still be a problem, but it's probably related to a race condition or some other resource contention. This looks like a network hang or a deadlock in the AFS RPC layer.
|
| 7/2 |
2026/08/14 00:06 |
tool |
grepper |
0m
Args: map[Expression:afs_fs_type]
Results: map[Output:fs/afs/internal.h=256=static inline struct afs_super_info *AFS_FS_S(struct super_block *sb)
--
fs/afs/internal.h-260-
fs/afs/internal.h:261:extern struct file_system_type afs_fs_type;
fs/afs/internal.h-262-
--
fs/afs/mntpt.c=159=static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
--
fs/afs/mntpt.c-166-
fs/afs/mntpt.c:167: fc = fs_context_for_submount(&afs_fs_type, mntpt);
fs/afs/mntpt.c-168- if (IS_ERR(fc))
--
fs/afs/super.c=41=static const struct fs_parameter_spec afs_fs_parameters[];
fs/afs/super.c-42-
fs/afs/super.c:43:struct file_system_type afs_fs_type = {
fs/afs/super.c-44- .owner = THIS_MODULE,
--
fs/afs/super.c=96=int __init afs_fs_init(void)
--
fs/afs/super.c-116- /* now export our filesystem to lesser mortals */
fs/afs/super.c:117: ret = register_filesystem(&afs_fs_type);
fs/afs/super.c-118- if (ret < 0) {
--
fs/afs/super.c=131=void afs_fs_exit(void)
--
fs/afs/super.c-135- afs_mntpt_kill_timer();
fs/afs/super.c:136: unregister_filesystem(&afs_fs_type);
fs/afs/super.c-137-
]
|
| 8/2 |
2026/08/14 00:06 |
llm |
expert |
0m
Model:
Tokens:
input: 12669
output: 34
thoughts: 22
Thoughts: **Checking the `afs_fs_type` Definition**
Alright, let's get down to brass tacks. I need to refresh my memory on how AFS filesystems are handled at the kernel level. First step is to zero in on the `afs_fs_type` definition. Specifically, I need to jump into `fs/afs/super.c`. This is where the core filesystem superblock operations should be defined, including the fundamental structure that describes how the kernel interacts with the AFS filesystem. I want to see how this thing is initialized, what flags are set, and how it's linked into the VFS. Let's see what we've got.
|
| 9/2 |
2026/08/14 00:07 |
tool |
read-file |
0m
Args: map[File:fs/afs/super.c FirstLine:40 LineCount:20]
Results: map[Contents: 40: static int afs_init_fs_context(struct fs_context *fc);
41: static const struct fs_parameter_spec afs_fs_parameters[];
42:
43: struct file_system_type afs_fs_type = {
44: .owner = THIS_MODULE,
45: .name = "afs",
46: .init_fs_context = afs_init_fs_context,
47: .parameters = afs_fs_parameters,
48: .kill_sb = afs_kill_super,
49: .fs_flags = FS_RENAME_DOES_D_MOVE,
50: };
51: MODULE_ALIAS_FS("afs");
52:
53: int afs_net_id;
54:
55: static const struct super_operations afs_super_ops = {
56: .statfs = afs_statfs,
57: .alloc_inode = afs_alloc_inode,
58: .write_inode = netfs_unpin_writeback,
59: .drop_inode = afs_drop_inode,
]
|
| 10/2 |
2026/08/14 00:07 |
llm |
expert |
0m
Model:
Tokens:
input: 13204
output: 43
thoughts: 292
Thoughts: **Analyzing the AFS Mount Vulnerability**
Okay, so I'm looking at this `afs_fs_type` thing, and it doesn't seem to have `FS_USERNS_MOUNT`. That means, right off the bat, unprivileged users can't mount it, even within a user namespace. Let's just confirm that... Yup, no `FS_USERNS_MOUNT`. So, no unprivileged AFS mounting. Simple enough.
But wait, is there some other way this could be triggered? Let's see... `afs_mntpt_do_automount` uses `fs_context_for_submount`. Automounts are triggered by accessing an AFS mountpoint, interesting. But to *get* to an AFS mountpoint, you need an AFS filesystem mounted first. And, since unprivileged users can't mount AFS, they can't create that initial mountpoint. Unless, of course, there's a pre-existing AFS filesystem mounted by root, which unprivileged users can then access. But, hold on, we're focusing on the *exploitability* of the bug, so that scenario isn't directly relevant.
The bug itself is a hang in `afs_wait_for_call_to_complete`, specifically blocked for over 143 seconds. That means it's waiting for an rxrpc call to complete and it's not. This is either a network timeout or a missed wakeup, that's what we need to trace. Let's dive deeper into how `afs_wait_for_call_to_complete` actually works...
|
| 11/2 |
2026/08/14 00:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/rxrpc.c Name:afs_wait_for_call_to_complete]
Results: map[SourceCode: 628: /*
629: * Wait synchronously for a call to complete.
630: */
631: void afs_wait_for_call_to_complete(struct afs_call *call)
632: {
633: bool rxrpc_complete = false;
634:
635: _enter("");
636:
637: if (!afs_check_call_state(call, AFS_CALL_COMPLETE)) {
638: DECLARE_WAITQUEUE(myself, current);
639:
640: add_wait_queue(&call->waitq, &myself);
641: for (;;) {
642: set_current_state(TASK_UNINTERRUPTIBLE);
643:
644: /* deliver any messages that are in the queue */
645: if (!afs_check_call_state(call, AFS_CALL_COMPLETE) &&
646: call->need_attention) {
647: call->need_attention = false;
648: __set_current_state(TASK_RUNNING);
649: afs_deliver_to_call(call);
650: continue;
651: }
652:
653: if (afs_check_call_state(call, AFS_CALL_COMPLETE))
654: break;
655:
656: if (!rxrpc_kernel_check_life(call->net->socket, call->rxcall)) {
657: /* rxrpc terminated the call. */
658: rxrpc_complete = true;
659: break;
660: }
661:
662: schedule();
663: }
664:
665: remove_wait_queue(&call->waitq, &myself);
666: __set_current_state(TASK_RUNNING);
667: }
668:
669: if (!afs_check_call_state(call, AFS_CALL_COMPLETE)) {
670: if (rxrpc_complete) {
671: afs_set_call_complete(call, call->error, call->abort_code);
672: } else {
673: /* Kill off the call if it's still live. */
674: _debug("call interrupted");
675: if (rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
676: RX_USER_ABORT, -EINTR,
677: afs_abort_interrupted))
678: afs_set_call_complete(call, -EINTR, 0);
679: }
680: }
681: }
SourceFile:fs/afs/rxrpc.c]
|
| 12/2 |
2026/08/14 00:07 |
llm |
expert |
0m
Model:
Tokens:
input: 14701
output: 42
thoughts: 545
Thoughts: **Analyzing a Potential Denial of Service Vulnerability in AFS/rxrpc**
Okay, so I'm looking at this task, and it's stuck in `TASK_UNINTERRUPTIBLE`. It's waiting for a specific condition β `afs_check_call_state` to become true, or a check on the rxrpc kernel's life. If neither happens, it just keeps scheduling itself, which is a classic recipe for a hang. Since it's uninterruptible, itβs susceptible to indefinite blocking if a network packet gets lost or there's some kind of bug in the rxrpc/AFS state machine. This is a clear Denial of Service (DoS) situation.
The key question is, can an unprivileged user trigger this? I immediately think, AFS mounts are typically restricted, so they can't. However, what if they're interacting with rxrpc directly? The stack trace is what's telling. Let me trace this out: `afs_wait_for_call_to_complete` is triggered through a series of calls that begin from `afs_vl_get_entry_by_name_u` and end in `__do_sys_mount`. Aha, that's a mount syscall!
But the critical check is the `afs_fs_type`. If it doesn't have `FS_USERNS_MOUNT`, an unprivileged user shouldnβt be able to mount it, right? Okay, but what else could call `afs_wait_for_call_to_complete`? Well, any AFS operation on an *already* mounted filesystem β reading a file, listing a directory β would trigger a call and potentially wait for completion. But again, if it's not mounted, an unprivileged user shouldn't be able to do anything.
Hmm... but syzkaller triggered this. And syzkaller usually runs as root within a VM, or it's making use of user namespaces. If syzkaller is mounting, it would require `CAP_SYS_ADMIN` in the initial namespace, which checks out because it's what syzkaller has. This means syzkaller, running with elevated privileges, can trigger the code path.
So it could be running as root.
Let me verify if `afs_fs_type` has been recently changed to include `FS_USERNS_MOUNT`, this is a very important check.
|
| 13/2 |
2026/08/14 00:07 |
tool |
git-log |
0m
Args: map[CodeRegexp:FS_USERNS_MOUNT Count:10 PathPrefix:fs/afs/super.c]
Results:
|
| 14/2 |
2026/08/14 00:07 |
llm |
expert |
0m
Model:
Tokens:
input: 15815
output: 39
thoughts: 135
Thoughts: **Investigating a Potential Vulnerability**
Okay, so the initial assumption was incorrect, that's clear. But wait, what if the real problem lies within `rxrpc` itself, and it's being exposed through the `AF_RXRPC` sockets? The bug report specifically points to a hang within `afs_wait_for_call_to_complete`, which is AFS code, which *could* mean the bug is elsewhere. Perhaps `rxrpc` is failing to complete a call properly, or the timeouts aren't working as they should.
If that's the case, an unprivileged user might be able to exploit this simply by crafting an `AF_RXRPC` socket and sending or receiving data in a specific way. That's a definite vulnerability vector. The next logical step is to verify whether unprivileged users *can* create these `AF_RXRPC` sockets. That's where I need to start.
|
| 15/2 |
2026/08/14 00:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/af_rxrpc.c Name:rxrpc_create]
Results: map[SourceCode: 799: /*
800: * create an RxRPC socket
801: */
802: static int rxrpc_create(struct net *net, struct socket *sock, int protocol,
803: int kern)
804: {
805: struct rxrpc_net *rxnet;
806: struct rxrpc_sock *rx;
807: struct sock *sk;
808:
809: _enter("%p,%d", sock, protocol);
810:
811: /* we support transport protocol UDP/UDP6 only */
812: if (protocol != PF_INET &&
813: IS_ENABLED(CONFIG_AF_RXRPC_IPV6) && protocol != PF_INET6)
814: return -EPROTONOSUPPORT;
815:
816: if (sock->type != SOCK_DGRAM)
817: return -ESOCKTNOSUPPORT;
818:
819: sock->ops = &rxrpc_rpc_ops;
820: sock->state = SS_UNCONNECTED;
821:
822: sk = sk_alloc(net, PF_RXRPC, GFP_KERNEL, &rxrpc_proto, kern);
823: if (!sk)
824: return -ENOMEM;
825:
826: sock_init_data(sock, sk);
827: sock_set_flag(sk, SOCK_RCU_FREE);
828: sk->sk_state = RXRPC_UNBOUND;
829: sk->sk_write_space = rxrpc_write_space;
830: sk->sk_max_ack_backlog = 0;
831: sk->sk_destruct = rxrpc_sock_destructor;
832:
833: rx = rxrpc_sk(sk);
834: rx->family = protocol;
835: rx->calls = RB_ROOT;
836:
837: spin_lock_init(&rx->incoming_lock);
838: skb_queue_head_init(&rx->recvmsg_oobq);
839: rx->pending_oobq = RB_ROOT;
840: INIT_LIST_HEAD(&rx->sock_calls);
841: INIT_LIST_HEAD(&rx->to_be_accepted);
842: INIT_LIST_HEAD(&rx->recvmsg_q);
843: spin_lock_init(&rx->recvmsg_lock);
844: rwlock_init(&rx->call_lock);
845: memset(&rx->srx, 0, sizeof(rx->srx));
846:
847: rxnet = rxrpc_net(sock_net(&rx->sk));
848: timer_reduce(&rxnet->peer_keepalive_timer, jiffies + 1);
849:
850: _leave(" = 0 [%p]", rx);
851: return 0;
852: }
SourceFile:net/rxrpc/af_rxrpc.c]
|
| 16/2 |
2026/08/14 00:07 |
llm |
expert |
0m
Model:
Tokens:
input: 17078
output: 38
thoughts: 90
Thoughts: Okay, here's my take on those thoughts, framed from my own perspective:
**Investigating a Potential RxRPC Vulnerability**
Right, so `rxrpc_create`... I see it doesn't bother checking for any privileges whatsoever. That means anyone, even Joe Average user, can spin up an `AF_RXRPC` socket. Okay, that's not ideal, but where's the real problem? The hang isn't in my part of the code, it's deep in AFS, specifically `afs_wait_for_call_to_complete`. That suggests the issue might not be directly in `rxrpc`.
But... Could *I* trigger something similar within the `rxrpc` core? Is there a wait state *I* can instigate? I need to check the receive path, primarily. Let's dig into `rxrpc_recvmsg` and related functions. See if I can find a vulnerability there. If I can get it to block or hang in a similar way, I might have found a means to exploit the unchecked socket creation.
|
| 17/2 |
2026/08/14 00:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/recvmsg.c Name:rxrpc_recvmsg]
Results: map[SourceCode: 402: /*
403: * Receive a message from an RxRPC socket
404: * - we need to be careful about two or more threads calling recvmsg
405: * simultaneously
406: */
407: int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
408: int flags)
409: {
410: struct rxrpc_call *call;
411: struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
412: struct list_head *l;
413: unsigned int call_debug_id = 0;
414: size_t copied = 0;
415: long timeo;
416: int ret;
417:
418: DEFINE_WAIT(wait);
419:
420: trace_rxrpc_recvmsg(0, rxrpc_recvmsg_enter, 0);
421:
422: if (flags & (MSG_OOB | MSG_TRUNC))
423: return -EOPNOTSUPP;
424:
425: timeo = sock_rcvtimeo(&rx->sk, flags & MSG_DONTWAIT);
426:
427: try_again:
428: lock_sock(&rx->sk);
429:
430: /* Return immediately if a client socket has no outstanding calls */
431: if (RB_EMPTY_ROOT(&rx->calls) &&
432: list_empty(&rx->recvmsg_q) &&
433: skb_queue_empty_lockless(&rx->recvmsg_oobq) &&
434: rx->sk.sk_state != RXRPC_SERVER_LISTENING) {
435: release_sock(&rx->sk);
436: return -EAGAIN;
437: }
438:
439: if (list_empty(&rx->recvmsg_q) &&
440: skb_queue_empty_lockless(&rx->recvmsg_oobq)) {
441: ret = -EWOULDBLOCK;
442: if (timeo == 0) {
443: call = NULL;
444: goto error_no_call;
445: }
446:
447: release_sock(&rx->sk);
448:
449: /* Wait for something to happen */
450: prepare_to_wait_exclusive(sk_sleep(&rx->sk), &wait,
451: TASK_INTERRUPTIBLE);
452: ret = sock_error(&rx->sk);
453: if (ret)
454: goto wait_error;
455:
456: if (list_empty(&rx->recvmsg_q) &&
457: skb_queue_empty_lockless(&rx->recvmsg_oobq)) {
458: if (signal_pending(current))
459: goto wait_interrupted;
460: trace_rxrpc_recvmsg(0, rxrpc_recvmsg_wait, 0);
461: timeo = schedule_timeout(timeo);
462: }
463: finish_wait(sk_sleep(&rx->sk), &wait);
464: goto try_again;
465: }
466:
467: /* Deal with OOB messages before we consider getting normal data. */
468: if (!skb_queue_empty_lockless(&rx->recvmsg_oobq)) {
469: ret = rxrpc_recvmsg_oob(sock, msg, flags);
470: release_sock(&rx->sk);
471: if (ret == -EAGAIN)
472: goto try_again;
473: goto error_trace;
474: }
475:
476: /* Find the next call and dequeue it if we're not just peeking. If we
477: * do dequeue it, that comes with a ref that we will need to release.
478: * We also want to weed out calls that got requeued whilst we were
479: * shovelling data out.
480: */
481: spin_lock_irq(&rx->recvmsg_lock);
482: l = rx->recvmsg_q.next;
483: call = list_entry(l, struct rxrpc_call, recvmsg_link);
484:
485: if (!rxrpc_call_is_complete(call) &&
486: skb_queue_empty(&call->recvmsg_queue) &&
487: skb_queue_empty(&rx->recvmsg_oobq)) {
488: list_del_init(&call->recvmsg_link);
489: spin_unlock_irq(&rx->recvmsg_lock);
490: release_sock(&rx->sk);
491: trace_rxrpc_recvmsg(call->debug_id, rxrpc_recvmsg_unqueue, 0);
492: rxrpc_put_call(call, rxrpc_call_put_recvmsg);
493: goto try_again;
494: }
495:
496: rxrpc_see_call(call, rxrpc_call_see_recvmsg);
497: if (test_bit(RXRPC_CALL_RELEASED, &call->flags)) {
498: rxrpc_see_call(call, rxrpc_call_see_already_released);
499: list_del_init(&call->recvmsg_link);
500: spin_unlock_irq(&rx->recvmsg_lock);
501: release_sock(&rx->sk);
502: trace_rxrpc_recvmsg(call->debug_id, rxrpc_recvmsg_unqueue, 0);
503: rxrpc_put_call(call, rxrpc_call_put_recvmsg);
504: goto try_again;
505: }
506: if (!(flags & MSG_PEEK))
507: list_del_init(&call->recvmsg_link);
508: else
509: rxrpc_get_call(call, rxrpc_call_get_recvmsg);
510: spin_unlock_irq(&rx->recvmsg_lock);
511:
512: call_debug_id = call->debug_id;
513: trace_rxrpc_recvmsg(call_debug_id, rxrpc_recvmsg_dequeue, 0);
514:
515: /* We're going to drop the socket lock, so we need to lock the call
516: * against interference by sendmsg.
517: */
518: if (!mutex_trylock(&call->user_mutex)) {
519: ret = -EWOULDBLOCK;
520: if (flags & MSG_DONTWAIT)
521: goto error_requeue_call;
522: ret = -ERESTARTSYS;
523: if (mutex_lock_interruptible(&call->user_mutex) < 0)
524: goto error_requeue_call;
525: }
526:
527: release_sock(&rx->sk);
528:
529: if (test_bit(RXRPC_CALL_RELEASED, &call->flags)) {
530: rxrpc_see_call(call, rxrpc_call_see_already_released);
531: mutex_unlock(&call->user_mutex);
532: rxrpc_put_call(call, rxrpc_call_put_recvmsg);
533: goto try_again;
534: }
535:
536: ret = rxrpc_recvmsg_user_id(call, msg, flags);
537: if (ret < 0)
538: goto error_unlock_call;
539:
540: if (msg->msg_name && call->peer) {
541: size_t len = sizeof(call->dest_srx);
542:
543: memcpy(msg->msg_name, &call->dest_srx, len);
544: msg->msg_namelen = len;
545: }
546:
547: ret = rxrpc_recvmsg_data(sock, call, msg, &msg->msg_iter, len,
548: flags, &copied);
549: if (ret == -EAGAIN)
550: ret = 0;
551: if (ret == -EIO)
552: goto call_failed;
553: if (ret < 0)
554: goto error_unlock_call;
555:
556: if (rxrpc_call_is_complete(call) &&
557: skb_queue_empty(&call->recvmsg_queue))
558: goto call_complete;
559: if (rxrpc_call_has_failed(call))
560: goto call_failed;
561:
562: if (!(flags & MSG_PEEK) &&
563: !skb_queue_empty(&call->recvmsg_queue))
564: rxrpc_notify_socket(call);
565: goto not_yet_complete;
566:
567: call_failed:
568: rxrpc_purge_queue(&call->recvmsg_queue);
569: call_complete:
570: ret = rxrpc_recvmsg_term(call, msg);
571: if (ret < 0)
572: goto error_unlock_call;
573: if (!(flags & MSG_PEEK))
574: rxrpc_release_call(rx, call);
575: msg->msg_flags |= MSG_EOR;
576: ret = 1;
577:
578: not_yet_complete:
579: if (ret == 0)
580: msg->msg_flags |= MSG_MORE;
581: else
582: msg->msg_flags &= ~MSG_MORE;
583: ret = copied;
584:
585: error_unlock_call:
586: mutex_unlock(&call->user_mutex);
587: rxrpc_put_call(call, rxrpc_call_put_recvmsg);
588: trace_rxrpc_recvmsg(call_debug_id, rxrpc_recvmsg_return, ret);
589: return ret;
590:
591: error_requeue_call:
592: if (!(flags & MSG_PEEK)) {
593: spin_lock_irq(&rx->recvmsg_lock);
594: if (list_empty(&call->recvmsg_link)) {
595: list_add(&call->recvmsg_link, &rx->recvmsg_q);
596: rxrpc_see_call(call, rxrpc_call_see_recvmsg_requeue);
597: spin_unlock_irq(&rx->recvmsg_lock);
598: } else if (list_is_first(&call->recvmsg_link, &rx->recvmsg_q)) {
599: spin_unlock_irq(&rx->recvmsg_lock);
600: rxrpc_put_call(call, rxrpc_call_see_recvmsg_requeue_first);
601: } else {
602: list_move(&call->recvmsg_link, &rx->recvmsg_q);
603: spin_unlock_irq(&rx->recvmsg_lock);
604: rxrpc_put_call(call, rxrpc_call_see_recvmsg_requeue_move);
605: }
606: trace_rxrpc_recvmsg(call_debug_id, rxrpc_recvmsg_requeue, 0);
607: } else {
608: rxrpc_put_call(call, rxrpc_call_put_recvmsg_peek_nowait);
609: }
610: error_no_call:
611: release_sock(&rx->sk);
612: error_trace:
613: trace_rxrpc_recvmsg(call_debug_id, rxrpc_recvmsg_return, ret);
614: return ret;
615:
616: wait_interrupted:
617: ret = sock_intr_errno(timeo);
618: wait_error:
619: finish_wait(sk_sleep(&rx->sk), &wait);
620: call = NULL;
621: goto error_trace;
622: }
SourceFile:net/rxrpc/recvmsg.c]
|
| 18/2 |
2026/08/14 00:07 |
llm |
expert |
0m
Model:
Tokens:
input: 21088
output: 43
thoughts: 377
Thoughts: **Analyzing a Potential Hang in AFS**
Okay, so I'm digging into this potential hang, specifically focusing on how AFS behaves. The `rxrpc_recvmsg` function uses `prepare_to_wait_exclusive` with `TASK_INTERRUPTIBLE`, which means it *shouldn't* cause a hung task timeout, because that timeout specifically looks for `TASK_UNINTERRUPTIBLE` tasks. But, the problem seems to be originating from `afs_wait_for_call_to_complete`, which *does* use `TASK_UNINTERRUPTIBLE`. That's the crux of it.
So, the theory is that `afs_wait_for_call_to_complete` can hang indefinitely. Now, AFS mounts seem like a likely trigger, especially since mounting initially requires `CAP_SYS_ADMIN` in the initial namespace. But, here's the crucial question: can an unprivileged user somehow reach this problematic code path through a different route? It's essential to understand if there's an unprivileged way to trigger the behavior.
Let's check. My next step is to examine the call graph to see if other callers of `afs_wait_for_call_to_complete` or even `afs_make_call` can be reached by a regular user. If AFS *isn't* mounted, the only obvious path into AFS code seems to be through a mount. But, what if AFS *is* already mounted by root? Can an unprivileged user still trigger this hang scenario?
Yes, that's it! If they access a file on the mounted AFS filesystem, AFS operations will get initiated, which leads to `afs_wait_for_call_to_complete`. If the AFS server is unresponsive and there's no inherent timeout, that unprivileged user's task will get stuck in `TASK_UNINTERRUPTIBLE`. This is bad.
But hold on... does `afs_wait_for_call_to_complete` actually *have* a timeout mechanism? I should check that again. Let me revisit that function. Ah, yes, it checks `rxrpc_kernel_check_life(call->net->socket, call->rxcall)`. That's the key. I need to understand what `rxrpc_kernel_check_life` does in this context, and whether it's sufficient to prevent this indefinite hang.
|
| 19/2 |
2026/08/14 00:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/af_rxrpc.c Name:rxrpc_kernel_check_life]
Results: map[SourceCode: 445: /**
446: * rxrpc_kernel_check_life - Check to see whether a call is still alive
447: * @sock: The socket the call is on
448: * @call: The call to check
449: *
450: * Allow a kernel service to find out whether a call is still alive - whether
451: * it has completed successfully and all received data has been consumed.
452: *
453: * Return: %true if the call is still ongoing and %false if it has completed.
454: */
455: bool rxrpc_kernel_check_life(const struct socket *sock,
456: const struct rxrpc_call *call)
457: {
458: if (!rxrpc_call_is_complete(call))
459: return true;
460: if (call->completion != RXRPC_CALL_SUCCEEDED)
461: return false;
462: return !skb_queue_empty(&call->recvmsg_queue);
463: }
SourceFile:net/rxrpc/af_rxrpc.c]
|
| 20/2 |
2026/08/14 00:07 |
llm |
expert |
0m
Model:
Tokens:
input: 22363
output: 41
thoughts: 595
Thoughts: **My Analysis of the RXRPC Hang Vulnerability**
Okay, so `rxrpc_kernel_check_life` is just checking call completion, which makes me think this might be related to the timeout mechanism in RXRPC. Does it have timeouts? Yes, but something's clearly going wrong with them. Perhaps a timeout isn't triggering, or the call itself isn't finishing properly.
The scenario described, where an unprivileged user can trigger this hang when accessing an AFS mount, is concerning. At first glance, it seems like a localized denial-of-service, just hanging the specific task, but the implications are broader. If the hang happens in `TASK_UNINTERRUPTIBLE`, the hung task watchdog will kick in. This could lead to a kernel panic if `kernel.hung_task_panic` is set to 1. Even if it doesn't cause a panic, indefinitely hanging a task in `TASK_UNINTERRUPTIBLE` is definitely a DoS since the task can't be killed, not even with `SIGKILL`. Plus, it could be holding locks.
Looking at the syzkaller report, the lock in question is `net->cells_alias_lock`. This is a per-network-namespace lock. If that lock is held indefinitely, any other AFS mount or cell access in the *same* network namespace will also stall. The catch is, this requires AFS to be mounted or in the process of being mounted.
The key question is, can an unprivileged user initiate an AFS mount? We've already checked and `afs_fs_type` doesn't have `FS_USERNS_MOUNT`. So, the typical `mount` command isn't the problem. But what about automounts? If a user accesses an existing AFS mountpoint, does that trigger the problematic code path? Thinking about it, `afs_mntpt_do_automount` is indeed called when an AFS mountpoint is accessed. We need to check if `afs_mntpt_do_automount` calls `afs_get_tree` or similar, which then calls `afs_validate_fc` then `afs_cell_detect_alias` so we can see if that is the route to trigger the same hang. That's the key: is there an automount-related path that leads to this vulnerability?
|
| 21/2 |
2026/08/14 00:07 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/mntpt.c Name:afs_mntpt_do_automount]
Results: map[SourceCode: 156: /*
157: * create a vfsmount to be automounted
158: */
159: static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
160: {
161: struct fs_context *fc;
162: struct vfsmount *mnt;
163: int ret;
164:
165: BUG_ON(!d_inode(mntpt));
166:
167: fc = fs_context_for_submount(&afs_fs_type, mntpt);
168: if (IS_ERR(fc))
169: return ERR_CAST(fc);
170:
171: ret = afs_mntpt_set_params(fc, mntpt);
172: if (!ret)
173: mnt = fc_mount(fc);
174: else
175: mnt = ERR_PTR(ret);
176:
177: put_fs_context(fc);
178: return mnt;
179: }
SourceFile:fs/afs/mntpt.c]
|
| 22/2 |
2026/08/14 00:07 |
llm |
expert |
0m
Model:
Tokens:
input: 23853
output: 37
thoughts: 309
Thoughts: **My Analysis of the AFS Automount Bug**
Okay, so `afs_mntpt_do_automount` calls `fc_mount(fc)`, which, as I suspected, leads to `afs_get_tree`. So, if an AFS filesystem is *already* mounted, and an unprivileged user accesses an AFS mountpoint, that automount is triggered. That's a given. And since automounts run in the context of the accessing user, an unprivileged user *can* trigger this. The critical preconditions are a pre-existing AFS mount and access to a valid mountpoint.
But the big question: Is it exploitable beyond a simple hang? This is a hang, a task blocked for over 143 seconds. That's a Denial of Service, plain and simple. No memory corruption, no privilege escalation, no info leak. So, by the strictest definition: **Exploitable: False. Denial of Service: True.**
Now, let's think about the triggers. Can a *malicious* filesystem initiate this? AFS is network-based, parsing data from the AFS server, so if the AFS server is compromised, it could *definitely* trigger the hang. I'm wondering though, is the hang due to server non-response or a bug in the rxrpc state machine? If the server just doesn't respond, then rxrpc *should* timeout. I need to verify if rxrpc actually *has* a timeout configured here. I need to dig into the rxrpc implementation details.
|
| 23/2 |
2026/08/14 00:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/rxrpc.c Name:afs_make_call]
Results: map[SourceCode: 341: /*
342: * Initiate a call and synchronously queue up the parameters for dispatch. Any
343: * error is stored into the call struct, which the caller must check for.
344: */
345: void afs_make_call(struct afs_call *call, gfp_t gfp)
346: {
347: struct rxrpc_call *rxcall;
348: struct msghdr msg;
349: struct kvec iov[1];
350: size_t len;
351: s64 tx_total_len;
352: int ret;
353:
354: _enter(",{%pISp+%u},", rxrpc_kernel_remote_addr(call->peer), call->service_id);
355:
356: ASSERT(call->type != NULL);
357: ASSERT(call->type->name != NULL);
358:
359: _debug("____MAKE %p{%s,%x} [%d]____",
360: call, call->type->name, key_serial(call->key),
361: atomic_read(&call->net->nr_outstanding_calls));
362:
363: trace_afs_make_call(call);
364:
365: /* Work out the length we're going to transmit. This is awkward for
366: * calls such as FS.StoreData where there's an extra injection of data
367: * after the initial fixed part.
368: */
369: tx_total_len = call->request_size;
370: if (call->write_iter)
371: tx_total_len += iov_iter_count(call->write_iter);
372:
373: /* If the call is going to be asynchronous, we need an extra ref for
374: * the call to hold itself so the caller need not hang on to its ref.
375: */
376: if (call->async) {
377: afs_get_call(call, afs_call_trace_get);
378: call->drop_ref = true;
379: }
380:
381: /* create a call */
382: rxcall = rxrpc_kernel_begin_call(call->net->socket, call->peer, call->key,
383: (unsigned long)call,
384: tx_total_len,
385: call->max_lifespan,
386: gfp,
387: (call->async ?
388: afs_wake_up_async_call :
389: afs_wake_up_call_waiter),
390: call->service_id,
391: call->upgrade,
392: (call->intr ? RXRPC_PREINTERRUPTIBLE :
393: RXRPC_UNINTERRUPTIBLE),
394: call->debug_id);
395: if (IS_ERR(rxcall)) {
396: ret = PTR_ERR(rxcall);
397: call->error = ret;
398: goto error_kill_call;
399: }
400:
401: call->rxcall = rxcall;
402: call->issue_time = ktime_get_real();
403:
404: /* send the request */
405: iov[0].iov_base = call->request;
406: iov[0].iov_len = call->request_size;
407:
408: msg.msg_name = NULL;
409: msg.msg_namelen = 0;
410: iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, iov, 1, call->request_size);
411: msg.msg_control = NULL;
412: msg.msg_controllen = 0;
413: msg.msg_flags = MSG_WAITALL | (call->write_iter ? MSG_MORE : 0);
414:
415: ret = rxrpc_kernel_send_data(call->net->socket, rxcall,
416: &msg, call->request_size,
417: afs_notify_end_request_tx);
418: if (ret < 0)
419: goto error_do_abort;
420:
421: if (call->write_iter) {
422: msg.msg_iter = *call->write_iter;
423: msg.msg_flags &= ~MSG_MORE;
424: trace_afs_send_data(call, &msg);
425:
426: ret = rxrpc_kernel_send_data(call->net->socket,
427: call->rxcall, &msg,
428: iov_iter_count(&msg.msg_iter),
429: afs_notify_end_request_tx);
430: *call->write_iter = msg.msg_iter;
431:
432: trace_afs_sent_data(call, &msg, ret);
433: if (ret < 0)
434: goto error_do_abort;
435: }
436:
437: /* Note that at this point, we may have received the reply or an abort
438: * - and an asynchronous call may already have completed.
439: *
440: * afs_wait_for_call_to_complete(call)
441: * must be called to synchronously clean up.
442: */
443: return;
444:
445: error_do_abort:
446: if (ret != -ECONNABORTED)
447: rxrpc_kernel_abort_call(call->net->socket, rxcall,
448: RX_USER_ABORT, ret,
449: afs_abort_send_data_error);
450: if (call->async) {
451: afs_see_call(call, afs_call_trace_async_abort);
452: return;
453: }
454:
455: if (ret == -ECONNABORTED) {
456: len = 0;
457: iov_iter_kvec(&msg.msg_iter, ITER_DEST, NULL, 0, 0);
458: rxrpc_kernel_recv_data(call->net->socket, rxcall,
459: &msg.msg_iter, &len, false,
460: &call->abort_code, &call->service_id);
461: call->responded = true;
462: }
463: call->error = ret;
464: trace_afs_call_done(call);
465: error_kill_call:
466: if (call->async)
467: afs_see_call(call, afs_call_trace_async_kill);
468: if (call->type->immediate_cancel)
469: call->type->immediate_cancel(call);
470:
471: /* We need to dispose of the extra ref we grabbed for an async call.
472: * The call, however, might be queued on afs_async_calls and we need to
473: * make sure we don't get any more notifications that might requeue it.
474: */
475: if (call->rxcall)
476: rxrpc_kernel_shutdown_call(call->net->socket, call->rxcall);
477: if (call->async) {
478: if (cancel_work_sync(&call->async_work))
479: afs_put_call(call);
480: afs_set_call_complete(call, ret, 0);
481: }
482:
483: call->error = ret;
484: call->state = AFS_CALL_COMPLETE;
485: _leave(" = %d", ret);
486: }
SourceFile:fs/afs/rxrpc.c]
|
| 24/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 26886
output: 54
thoughts: 37
Thoughts: Here's my analysis of the provided snippet, rendered as though I'm thinking it:
**Deconstructing `rxrpc_kernel_begin_call` and `max_lifespan`**
Okay, so I'm looking at `rxrpc_kernel_begin_call`. The first thing that catches my eye is that it's taking `call->max_lifespan` as a parameter. Intriguing. `max_lifespan`... that's clearly related to the duration for which this RPC call is considered valid. I need to understand how this `max_lifespan` value is *set* before I can understand its implications, so let's dig into where this particular field is populated. I should also investigate what happens after the call and how that uses the `max_lifespan` value. Is it used to clean up state? Enforce timeouts? What are the possible values for `max_lifespan` and how do those influence call behaviour? This is the starting point for understanding the call's behaviour over time.
|
| 25/2 |
2026/08/14 00:08 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile:fs/afs/rxrpc.c IncludeSnippetLines:2 Name:max_lifespan SourceTreePrefix:fs/afs/]
Results: map[References:<nil> TruncatedOutput:false]
|
| 26/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 27223
output: 29
thoughts: 39
Thoughts: Here's my thought process, as if I were analyzing that code:
**Digging into the `afs_call` Structure**
Okay, so `max_lifespan` is tucked away in the `afs_call` structure. That's a good starting point. Let's see what else might be influenced by it. Since this is related to AFS (Andrew File System), a quick search in the `fs/afs/` directory is the logical next step. I need to understand the context of `max_lifespan` within the overall AFS implementation to understand its implications for the system. I want to see how this value is used. Is it a server-side parameter? Is it client-side? How does it relate to caching, security, or other critical AFS functions? Time to get the grep tool ready.
|
| 27/2 |
2026/08/14 00:08 |
tool |
grepper |
0m
Args: map[Expression:max_lifespan PathPrefix:fs/afs/]
Results: map[Output:fs/afs/fsclient.c=1752=bool afs_fs_get_capabilities(struct afs_net *net, struct afs_server *server,
--
fs/afs/fsclient.c-1772- call->async = true;
fs/afs/fsclient.c:1773: call->max_lifespan = AFS_PROBE_MAX_LIFESPAN;
fs/afs/fsclient.c-1774-
--
fs/afs/internal.h=128=struct afs_call {
--
fs/afs/internal.h-166- unsigned long long remaining; /* How much is left to receive */
fs/afs/internal.h:167: unsigned int max_lifespan; /* Maximum lifespan in secs to set if not 0 */
fs/afs/internal.h-168- unsigned request_size; /* size of request data */
--
fs/afs/rxrpc.c=345=void afs_make_call(struct afs_call *call, gfp_t gfp)
--
fs/afs/rxrpc.c-384- tx_total_len,
fs/afs/rxrpc.c:385: call->max_lifespan,
fs/afs/rxrpc.c-386- gfp,
--
fs/afs/vlclient.c=110=struct afs_vldb_entry *afs_vl_get_entry_by_name_u(struct afs_vl_cursor *vc,
--
fs/afs/vlclient.c-137- call->ret_vldb = entry;
fs/afs/vlclient.c:138: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-139- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
--
fs/afs/vlclient.c=258=struct afs_addr_list *afs_vl_get_addrs_u(struct afs_vl_cursor *vc,
--
fs/afs/vlclient.c-278- call->ret_alist = NULL;
fs/afs/vlclient.c:279: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-280- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
--
fs/afs/vlclient.c=385=struct afs_call *afs_vl_get_capabilities(struct afs_net *net,
--
fs/afs/vlclient.c-409- call->async = true;
fs/afs/vlclient.c:410: call->max_lifespan = AFS_PROBE_MAX_LIFESPAN;
fs/afs/vlclient.c-411-
--
fs/afs/vlclient.c=634=struct afs_addr_list *afs_yfsvl_get_endpoints(struct afs_vl_cursor *vc,
--
fs/afs/vlclient.c-651- call->ret_alist = NULL;
fs/afs/vlclient.c:652: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-653- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
--
fs/afs/vlclient.c=756=char *afs_yfsvl_get_cell_name(struct afs_vl_cursor *vc)
--
fs/afs/vlclient.c-770- call->ret_str = NULL;
fs/afs/vlclient.c:771: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-772- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
]
|
| 28/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 28521
output: 34
thoughts: 38
Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue:
**Investigating `AFS_VL_MAX_LIFESPAN` Usage**
Alright, I see `AFS_VL_MAX_LIFESPAN` is involved with `afs_vl_get_entry_by_name_u`. That function, if I recall correctly, is used to retrieve volume entries, specifically by name, and the "u" likely signifies something about Unicode handling. So, `AFS_VL_MAX_LIFESPAN`β¦ must be related to the *lifetime* or, more precisely, the maximum permissible lifespan of a volume entry within the retrieval process. The question now is: What does it specifically represent? Is it a timeout value, a cache duration, or something else entirely? Time to dig into the definition and documentation for this constant. I'll need to understand how this lifespan impacts the accuracy and performance of volume lookups. I need to understand this to make sure the process doesn't cause any problems.
|
| 29/2 |
2026/08/14 00:08 |
tool |
grepper |
0m
Args: map[Expression:AFS_VL_MAX_LIFESPAN PathPrefix:fs/afs/]
Results: map[Output:fs/afs/afs.h-21-
fs/afs/afs.h:22:#define AFS_VL_MAX_LIFESPAN 120
fs/afs/afs.h-23-#define AFS_PROBE_MAX_LIFESPAN 30
--
fs/afs/vlclient.c=110=struct afs_vldb_entry *afs_vl_get_entry_by_name_u(struct afs_vl_cursor *vc,
--
fs/afs/vlclient.c-137- call->ret_vldb = entry;
fs/afs/vlclient.c:138: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-139- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
--
fs/afs/vlclient.c=258=struct afs_addr_list *afs_vl_get_addrs_u(struct afs_vl_cursor *vc,
--
fs/afs/vlclient.c-278- call->ret_alist = NULL;
fs/afs/vlclient.c:279: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-280- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
--
fs/afs/vlclient.c=634=struct afs_addr_list *afs_yfsvl_get_endpoints(struct afs_vl_cursor *vc,
--
fs/afs/vlclient.c-651- call->ret_alist = NULL;
fs/afs/vlclient.c:652: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-653- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
--
fs/afs/vlclient.c=756=char *afs_yfsvl_get_cell_name(struct afs_vl_cursor *vc)
--
fs/afs/vlclient.c-770- call->ret_str = NULL;
fs/afs/vlclient.c:771: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
fs/afs/vlclient.c-772- call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
]
|
| 30/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 29486
output: 42
thoughts: 74
Thoughts: **Investigating a Timeout Discrepancy**
Okay, here's the puzzle: `AFS_VL_MAX_LIFESPAN` is explicitly defined as 120 seconds. And, we're working with a hung task timeout of 143 seconds. That leads me to expect the call to have timed out at the 120-second mark, no question. But, clearly, something went sideways. The timeout didn't trigger when it should have.
So, the obvious next step is to drill down into the `rxrpc` implementation and figure out exactly how the `max_lifespan` parameter is being handled. I need to understand the logic flow, the interactions, and where a potential delay could be introduced, or where a miscalculation may have occurred. Let's see how they actually handle `max_lifespan` in the code. I'm assuming there's either a bug in the code or I am missing an important interaction.
|
| 31/2 |
2026/08/14 00:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_object.c Name:rxrpc_kernel_begin_call]
Results: map[SourceCode: 316: /**
317: * rxrpc_kernel_begin_call - Allow a kernel service to begin a call
318: * @sock: The socket on which to make the call
319: * @peer: The peer to contact
320: * @key: The security context to use (defaults to socket setting)
321: * @user_call_ID: The ID to use
322: * @tx_total_len: Total length of data to transmit during the call (or -1)
323: * @hard_timeout: The maximum lifespan of the call in sec
324: * @gfp: The allocation constraints
325: * @notify_rx: Where to send notifications instead of socket queue
326: * @service_id: The ID of the service to contact
327: * @upgrade: Request service upgrade for call
328: * @interruptibility: The call is interruptible, or can be canceled.
329: * @debug_id: The debug ID for tracing to be assigned to the call
330: *
331: * Allow a kernel service to begin a call on the nominated socket. This just
332: * sets up all the internal tracking structures and allocates connection and
333: * call IDs as appropriate.
334: *
335: * The default socket destination address and security may be overridden by
336: * supplying @srx and @key.
337: *
338: * Return: The new call or an error code.
339: */
340: struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
341: struct rxrpc_peer *peer,
342: struct key *key,
343: unsigned long user_call_ID,
344: s64 tx_total_len,
345: u32 hard_timeout,
346: gfp_t gfp,
347: rxrpc_notify_rx_t notify_rx,
348: u16 service_id,
349: bool upgrade,
350: enum rxrpc_interruptibility interruptibility,
351: unsigned int debug_id)
352: {
353: struct rxrpc_conn_parameters cp;
354: struct rxrpc_call_params p;
355: struct rxrpc_call *call;
356: struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
357:
358: _enter(",,%x,%lx", key_serial(key), user_call_ID);
359:
360: if (WARN_ON_ONCE(peer->local != rx->local))
361: return ERR_PTR(-EIO);
362:
363: lock_sock(&rx->sk);
364:
365: if (!key)
366: key = rx->key;
367: if (key && !key->payload.data[0])
368: key = NULL; /* a no-security key */
369:
370: memset(&p, 0, sizeof(p));
371: p.user_call_ID = user_call_ID;
372: p.tx_total_len = tx_total_len;
373: p.interruptibility = interruptibility;
374: p.kernel = true;
375: p.timeouts.hard = hard_timeout;
376:
377: memset(&cp, 0, sizeof(cp));
378: cp.local = rx->local;
379: cp.peer = peer;
380: cp.key = key;
381: cp.security_level = rx->min_sec_level;
382: cp.exclusive = false;
383: cp.upgrade = upgrade;
384: cp.service_id = service_id;
385: call = rxrpc_new_client_call(rx, &cp, &p, gfp, debug_id);
386: /* The socket has been unlocked. */
387: if (!IS_ERR(call)) {
388: call->notify_rx = notify_rx;
389: mutex_unlock(&call->user_mutex);
390: }
391:
392: _leave(" = %p", call);
393: return call;
394: }
SourceFile:net/rxrpc/af_rxrpc.c]
|
| 32/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 31109
output: 42
thoughts: 38
Thoughts: Okay, here's my interpretation of this code snippet, expressed as if it's my own thought process:
**Diving into Timeout Configuration**
Right, so I'm looking at this line: `p.timeouts.hard = hard_timeout;` It's clear enough what's happening on the surface: we're assigning a value, `hard_timeout`, to the `hard` member within a `timeouts` structure, which itself is a member of the structure `p`. But the real question is *why* and *where* this is being done.
This `p` is likely some kind of context or parameters object. The fact that timeouts are involved tells me it's probably related to network communication, RPC, or some kind of I/O operation. The `hard_timeout` indicates this timeout value will likely kill whatever it is connected to if triggered.
My next immediate step is to trace back and understand where and how `p` is being used, especially within the context of `rxrpc_new_client_call`. That's where I need to look to truly understand the implication of setting this `hard_timeout`. I need to see what `rxrpc_new_client_call` does with this `p.timeouts.hard` value. Does it pass it along to some lower level system calls? Is it used in a select call? Does it just get used for an error log? The details are in that function and how it uses `p`. Is it part of the overall timeout policy or is it just used to kill connections? The next step is clear. Time to inspect that function.
|
| 33/2 |
2026/08/14 00:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_object.c Name:rxrpc_new_client_call]
Results: map[SourceCode: 318: /*
319: * Set up a call for the given parameters.
320: * - Called with the socket lock held, which it must release.
321: * - If it returns a call, the call's lock will need releasing by the caller.
322: */
323: struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,
324: struct rxrpc_conn_parameters *cp,
325: struct rxrpc_call_params *p,
326: gfp_t gfp,
327: unsigned int debug_id)
328: __releases(&rx->sk.sk_lock)
329: __acquires(&call->user_mutex)
330: {
331: struct rxrpc_call *call, *xcall;
332: struct rxrpc_net *rxnet;
333: struct semaphore *limiter;
334: struct rb_node *parent, **pp;
335: int ret;
336:
337: _enter("%p,%lx", rx, p->user_call_ID);
338:
339: if (WARN_ON_ONCE(!cp->peer)) {
340: release_sock(&rx->sk);
341: return ERR_PTR(-EIO);
342: }
343:
344: limiter = rxrpc_get_call_slot(p, gfp);
345: if (!limiter) {
346: release_sock(&rx->sk);
347: return ERR_PTR(-ERESTARTSYS);
348: }
349:
350: call = rxrpc_alloc_client_call(rx, cp, p, gfp, debug_id);
351: if (IS_ERR(call)) {
352: release_sock(&rx->sk);
353: up(limiter);
354: _leave(" = %ld", PTR_ERR(call));
355: return call;
356: }
357:
358: /* We need to protect a partially set up call against the user as we
359: * will be acting outside the socket lock.
360: */
361: mutex_lock(&call->user_mutex);
362:
363: /* Publish the call, even though it is incompletely set up as yet */
364: write_lock(&rx->call_lock);
365:
366: pp = &rx->calls.rb_node;
367: parent = NULL;
368: while (*pp) {
369: parent = *pp;
370: xcall = rb_entry(parent, struct rxrpc_call, sock_node);
371:
372: if (p->user_call_ID < xcall->user_call_ID)
373: pp = &(*pp)->rb_left;
374: else if (p->user_call_ID > xcall->user_call_ID)
375: pp = &(*pp)->rb_right;
376: else
377: goto error_dup_user_ID;
378: }
379:
380: rcu_assign_pointer(call->socket, rx);
381: call->user_call_ID = p->user_call_ID;
382: __set_bit(RXRPC_CALL_HAS_USERID, &call->flags);
383: rxrpc_get_call(call, rxrpc_call_get_userid);
384: rb_link_node(&call->sock_node, parent, pp);
385: rb_insert_color(&call->sock_node, &rx->calls);
386: list_add(&call->sock_link, &rx->sock_calls);
387:
388: write_unlock(&rx->call_lock);
389:
390: rxnet = call->rxnet;
391: spin_lock(&rxnet->call_lock);
392: list_add_tail_rcu(&call->link, &rxnet->calls);
393: spin_unlock(&rxnet->call_lock);
394:
395: /* From this point on, the call is protected by its own lock. */
396: release_sock(&rx->sk);
397:
398: /* Set up or get a connection record and set the protocol parameters,
399: * including channel number and call ID.
400: */
401: ret = rxrpc_connect_call(call, gfp);
402: if (ret < 0)
403: goto error_attached_to_socket;
404:
405: _leave(" = %p [new]", call);
406: return call;
407:
408: /* We unexpectedly found the user ID in the list after taking
409: * the call_lock. This shouldn't happen unless the user races
410: * with itself and tries to add the same user ID twice at the
411: * same time in different threads.
412: */
413: error_dup_user_ID:
414: write_unlock(&rx->call_lock);
415: release_sock(&rx->sk);
416: rxrpc_prefail_call(call, RXRPC_CALL_LOCAL_ERROR, -EEXIST);
417: trace_rxrpc_call(call->debug_id, refcount_read(&call->ref), 0,
418: rxrpc_call_see_userid_exists);
419: mutex_unlock(&call->user_mutex);
420: rxrpc_put_call(call, rxrpc_call_put_userid_exists);
421: _leave(" = -EEXIST");
422: return ERR_PTR(-EEXIST);
423:
424: /* We got an error, but the call is attached to the socket and is in
425: * need of release. However, we might now race with recvmsg() when it
426: * completion notifies the socket. Return 0 from sys_sendmsg() and
427: * leave the error to recvmsg() to deal with.
428: */
429: error_attached_to_socket:
430: trace_rxrpc_call(call->debug_id, refcount_read(&call->ref), ret,
431: rxrpc_call_see_connect_failed);
432: rxrpc_set_call_completion(call, RXRPC_CALL_LOCAL_ERROR, 0, ret);
433: _leave(" = c=%08x [err]", call->debug_id);
434: return call;
435: }
SourceFile:net/rxrpc/call_object.c]
|
| 34/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 33491
output: 42
thoughts: 12
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm deeply familiar with distributed systems and the complexities of remote procedure calls (RPC):
**Initial Call Allocation**
Okay, so I see the system is about to kick off a remote call. The very first indication I'm getting is that it's going to hit `rxrpc_alloc_client_call`. That's the entry point, the critical first step. It signifies that we're about to allocate the resources necessary for a client-side RPC invocation. This function is the gatekeeper. It's where the data structures for the call are set up, memory is likely allocated, and potentially, some initial connection/socket information is arranged. It also likely initializes the call context or client object that will be used. It's the groundwork; the prelude to the actual communication. I need to understand what that function does in detail, to assess what comes next.
|
| 35/2 |
2026/08/14 00:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_object.c Name:rxrpc_alloc_client_call]
Results: map[SourceCode: 188: /*
189: * Allocate a new client call.
190: */
191: static struct rxrpc_call *rxrpc_alloc_client_call(struct rxrpc_sock *rx,
192: struct rxrpc_conn_parameters *cp,
193: struct rxrpc_call_params *p,
194: gfp_t gfp,
195: unsigned int debug_id)
196: {
197: struct rxrpc_call *call;
198: ktime_t now;
199: int ret;
200:
201: _enter("");
202:
203: call = rxrpc_alloc_call(rx, gfp, debug_id);
204: if (!call)
205: return ERR_PTR(-ENOMEM);
206: now = ktime_get_real();
207: call->acks_latest_ts = now;
208: call->cong_tstamp = now;
209: call->dest_srx = cp->peer->srx;
210: call->dest_srx.srx_service = cp->service_id;
211: call->interruptibility = p->interruptibility;
212: call->tx_total_len = p->tx_total_len;
213: call->key = key_get(cp->key);
214: call->peer = rxrpc_get_peer(cp->peer, rxrpc_peer_get_call);
215: call->local = rxrpc_get_local(cp->local, rxrpc_local_get_call);
216: call->security_level = cp->security_level;
217: if (p->kernel)
218: __set_bit(RXRPC_CALL_KERNEL, &call->flags);
219: if (cp->upgrade)
220: __set_bit(RXRPC_CALL_UPGRADE, &call->flags);
221: if (cp->exclusive)
222: __set_bit(RXRPC_CALL_EXCLUSIVE, &call->flags);
223:
224: if (p->timeouts.normal)
225: call->next_rx_timo = umin(p->timeouts.normal, 1);
226: if (p->timeouts.idle)
227: call->next_req_timo = umin(p->timeouts.idle, 1);
228: if (p->timeouts.hard)
229: call->hard_timo = p->timeouts.hard;
230:
231: ret = rxrpc_init_client_call_security(call);
232: if (ret < 0) {
233: rxrpc_prefail_call(call, RXRPC_CALL_LOCAL_ERROR, ret);
234: rxrpc_put_call(call, rxrpc_call_put_discard_error);
235: return ERR_PTR(ret);
236: }
237:
238: rxrpc_set_call_state(call, RXRPC_CALL_CLIENT_AWAIT_CONN);
239:
240: trace_rxrpc_call(call->debug_id, refcount_read(&call->ref),
241: p->user_call_ID, rxrpc_call_new_client);
242:
243: _leave(" = %p", call);
244: return call;
245: }
SourceFile:net/rxrpc/call_object.c]
|
| 36/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 34768
output: 56
thoughts: 26
Thoughts: Here's my summary, as if I were thinking these thoughts:
**Deciphering Timeout Structures in Kernel Code**
Okay, so I'm looking at this line: `call->hard_timo = p->timeouts.hard;`. Immediately, I see we're dealing with a structure assignment, likely within some kernel code. The code is taking the `hard` timeout value from a structure named `timeouts`, likely specific to some process `p`, and assigning it to a field called `hard_timo` within another structure, probably `call`. The implication here is that this `hard_timo` value is a configurable value, being set from elsewhere. The question that immediately pops into my head is: Where is this `hard_timo` value *used*? What's the context? Is it used in interrupt handling, for signal delivery, or for something else entirely? Knowing where `hard_timo` is used will clarify its significance. I need to trace the references to `call->hard_timo` next to understand the control flow and potential impact of this timeout value.
|
| 37/2 |
2026/08/14 00:08 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile:net/rxrpc/call_object.c IncludeSnippetLines:2 Name:hard_timo SourceTreePrefix:net/rxrpc/]
Results: map[References:<nil> TruncatedOutput:false]
|
| 38/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 35103
output: 29
thoughts: 38
Thoughts: Here's my thought process, summarized as you requested:
**Deconstructing `hard_timo` in the RxRPC Context**
Okay, so `hard_timo`...that's a field within the `rxrpc_call` struct, right? My mental map says that's where I should be looking for it. Since it's RxRPC specific, the next logical step is to dive into the `net/rxrpc/` directory. That's the core of the RxRPC implementation in the kernel. I need to understand what `hard_timo` represents in that context. Is it a timeout value, a flag, or something else entirely? Time to dig. Let's see what the code around that field reveals. I'll probably be looking for its usage in timers, error handling, or connection management within the RxRPC protocol.
|
| 39/2 |
2026/08/14 00:08 |
tool |
grepper |
0m
Args: map[Expression:hard_timo PathPrefix:net/rxrpc/]
Results: map[Output:net/rxrpc/ar-internal.h=713=struct rxrpc_call {
--
net/rxrpc/ar-internal.h-733- u32 next_req_timo; /* Timeout for next Rx request packet (ms) */
net/rxrpc/ar-internal.h:734: u32 hard_timo; /* Maximum lifetime or 0 (s) */
net/rxrpc/ar-internal.h-735- struct timer_list timer; /* Combined event timer */
--
net/rxrpc/call_object.c=191=static struct rxrpc_call *rxrpc_alloc_client_call(struct rxrpc_sock *rx,
--
net/rxrpc/call_object.c-228- if (p->timeouts.hard)
net/rxrpc/call_object.c:229: call->hard_timo = p->timeouts.hard;
net/rxrpc/call_object.c-230-
--
net/rxrpc/call_object.c=250=void rxrpc_start_call_timer(struct rxrpc_call *call)
net/rxrpc/call_object.c-251-{
net/rxrpc/call_object.c:252: if (call->hard_timo) {
net/rxrpc/call_object.c:253: ktime_t delay = ms_to_ktime(call->hard_timo * 1000);
net/rxrpc/call_object.c-254-
]
|
| 40/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 35748
output: 42
thoughts: 14
Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:
**Initial Thoughts on `rxrpc_start_call_timer`**
Alright, so the first thing that pops into my head is `rxrpc_start_call_timer`. No need to go into the obvious, but that means we're looking at a function within the RxRPC (likely the Reliable XDR RPC) framework, and it's dealing with a timer β probably related to call timeout management. My mind immediately starts running through the implications: is this the main timer initiation function? Does it handle the various timer modes (e.g., initial setup, reset on progress, etc.)? I'm already anticipating questions about its interaction with other timer mechanisms in the system, and how it handles potential races and edge cases. What about signal handling? Does it deal with that in the kernel or does it pass that on to userland? I want to see how robust the design is, especially around situations where a call might get wedged or hangs. Does it offer any way to cancel or modify a timer after starting it? And what about the granularity of the timer and its impact on performance?
|
| 41/2 |
2026/08/14 00:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_object.c Name:rxrpc_start_call_timer]
Results: map[SourceCode: 247: /*
248: * Initiate the call ack/resend/expiry timer.
249: */
250: void rxrpc_start_call_timer(struct rxrpc_call *call)
251: {
252: if (call->hard_timo) {
253: ktime_t delay = ms_to_ktime(call->hard_timo * 1000);
254:
255: call->expect_term_by = ktime_add(ktime_get_real(), delay);
256: trace_rxrpc_timer_set(call, delay, rxrpc_timer_trace_hard);
257: }
258: call->timer.expires = jiffies;
259: }
SourceFile:net/rxrpc/call_object.c]
|
| 42/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 36307
output: 30
thoughts: 22
Thoughts: Here's my summary, as though I'm thinking through this myself:
**Tracing the `expect_term_by` Variable**
Okay, so `expect_term_by` is set. That's the starting point. My immediate question is: *where* does this variable actually get checked? Knowing where it's used is absolutely crucial to understanding its role and impact. I need to pinpoint every location in the code where this variable is referenced, evaluated, or modified. Are there conditional statements using it? Function calls that depend on its value? Perhaps it's passed as an argument to other functions? I need to build a mental map of its usage throughout the codebase, considering all possibilities. Only then can I truly grasp its purpose and potential implications. This is going to be my key focus for the next few minutes. I'll start by doing a quick search for its usage, and then I'll use that as the basis for a more detailed review of the surrounding logic.
|
| 43/2 |
2026/08/14 00:08 |
tool |
grepper |
0m
Args: map[Expression:expect_term_by PathPrefix:net/rxrpc/]
Results: map[Output:net/rxrpc/ar-internal.h=713=struct rxrpc_call {
--
net/rxrpc/ar-internal.h-730- ktime_t expect_req_by; /* When we expect to get a request DATA packet by */
net/rxrpc/ar-internal.h:731: ktime_t expect_term_by; /* When we expect call termination by */
net/rxrpc/ar-internal.h-732- u32 next_rx_timo; /* Timeout for next Rx packet (ms) */
--
net/rxrpc/call_event.c=303=bool rxrpc_input_call_event(struct rxrpc_call *call)
--
net/rxrpc/call_event.c-369-
net/rxrpc/call_event.c:370: t = ktime_sub(READ_ONCE(call->expect_term_by), now);
net/rxrpc/call_event.c-371- if (t <= 0) {
--
net/rxrpc/call_event.c-444- if (!__rxrpc_call_is_complete(call)) {
net/rxrpc/call_event.c:445: ktime_t next = READ_ONCE(call->expect_term_by), delay;
net/rxrpc/call_event.c-446-
--
net/rxrpc/call_object.c=123=struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *rx, gfp_t gfp,
--
net/rxrpc/call_object.c-169- call->expect_req_by = KTIME_MAX;
net/rxrpc/call_object.c:170: call->expect_term_by = KTIME_MAX;
net/rxrpc/call_object.c-171-
--
net/rxrpc/call_object.c=250=void rxrpc_start_call_timer(struct rxrpc_call *call)
--
net/rxrpc/call_object.c-254-
net/rxrpc/call_object.c:255: call->expect_term_by = ktime_add(ktime_get_real(), delay);
net/rxrpc/call_object.c-256- trace_rxrpc_timer_set(call, delay, rxrpc_timer_trace_hard);
--
net/rxrpc/sendmsg.c=660=int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
--
net/rxrpc/sendmsg.c-748-
net/rxrpc/sendmsg.c:749: WRITE_ONCE(call->expect_term_by,
net/rxrpc/sendmsg.c-750- ktime_add(p.call.timeouts.hard,
]
|
| 44/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 37304
output: 42
thoughts: 49
Thoughts: Here's my take on those thoughts:
**Analyzing RXRPC Send and Call Events**
Okay, hold on a second. I just realized that `rxrpc_do_sendmsg` *also* manipulates `expect_term_by`. This is important, I need to check how it interacts with the other functions in the RXRPC process. Alright, let's dive into `rxrpc_input_call_event` in `net/rxrpc/call_event.c`. I need to understand how the setting of this `expect_term_by` variable is handled, and how it effects the RXRPC call flow. I bet there's some interesting interplay between these two functions that I need to clarify. This is potentially where a subtle, yet critical, issue might be hiding.
|
| 45/2 |
2026/08/14 00:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_event.c Name:rxrpc_input_call_event]
Results: map[SourceCode: 300: /*
301: * Handle retransmission and deferred ACK/abort generation.
302: */
303: bool rxrpc_input_call_event(struct rxrpc_call *call)
304: {
305: struct sk_buff *skb;
306: ktime_t now, t;
307: bool did_receive = false, saw_ack = false;
308: s32 abort_code;
309:
310: rxrpc_see_call(call, rxrpc_call_see_input);
311:
312: //printk("\n--------------------\n");
313: _enter("{%d,%s,%lx}",
314: call->debug_id, rxrpc_call_states[__rxrpc_call_state(call)],
315: call->events);
316:
317: /* Handle abort request locklessly, vs rxrpc_propose_abort(). */
318: abort_code = smp_load_acquire(&call->send_abort);
319: if (abort_code) {
320: rxrpc_abort_call(call, 0, call->send_abort, call->send_abort_err,
321: call->send_abort_why);
322: goto out;
323: }
324:
325: do {
326: skb = __skb_dequeue(&call->rx_queue);
327: if (skb) {
328: struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
329:
330: if (__rxrpc_call_is_complete(call) ||
331: skb->mark == RXRPC_SKB_MARK_ERROR) {
332: rxrpc_free_skb(skb, rxrpc_skb_put_call_rx);
333: goto out;
334: }
335:
336: saw_ack |= sp->hdr.type == RXRPC_PACKET_TYPE_ACK;
337:
338: rxrpc_input_call_packet(call, skb);
339: rxrpc_free_skb(skb, rxrpc_skb_put_call_rx);
340: did_receive = true;
341: }
342:
343: t = ktime_sub(call->rack_timo_at, ktime_get_real());
344: if (t <= 0) {
345: trace_rxrpc_timer_exp(call, t,
346: rxrpc_timer_trace_rack_off + call->rack_timer_mode);
347: call->rack_timo_at = KTIME_MAX;
348: rxrpc_rack_timer_expired(call, t);
349: }
350:
351: } while (!skb_queue_empty(&call->rx_queue));
352:
353: /* If we see our async-event poke, check for timeout trippage. */
354: now = ktime_get_real();
355: t = ktime_sub(call->expect_rx_by, now);
356: if (t <= 0) {
357: trace_rxrpc_timer_exp(call, t, rxrpc_timer_trace_expect_rx);
358: goto expired;
359: }
360:
361: t = ktime_sub(call->expect_req_by, now);
362: if (t <= 0) {
363: call->expect_req_by = KTIME_MAX;
364: if (__rxrpc_call_state(call) == RXRPC_CALL_SERVER_RECV_REQUEST) {
365: trace_rxrpc_timer_exp(call, t, rxrpc_timer_trace_idle);
366: goto expired;
367: }
368: }
369:
370: t = ktime_sub(READ_ONCE(call->expect_term_by), now);
371: if (t <= 0) {
372: trace_rxrpc_timer_exp(call, t, rxrpc_timer_trace_hard);
373: goto expired;
374: }
375:
376: t = ktime_sub(call->delay_ack_at, now);
377: if (t <= 0) {
378: trace_rxrpc_timer_exp(call, t, rxrpc_timer_trace_delayed_ack);
379: call->delay_ack_at = KTIME_MAX;
380: rxrpc_send_ACK(call, RXRPC_ACK_DELAY, 0,
381: rxrpc_propose_ack_delayed_ack);
382: }
383:
384: t = ktime_sub(call->ping_at, now);
385: if (t <= 0) {
386: trace_rxrpc_timer_exp(call, t, rxrpc_timer_trace_ping);
387: call->ping_at = KTIME_MAX;
388: rxrpc_send_ACK(call, RXRPC_ACK_PING, 0,
389: rxrpc_propose_ack_ping_for_keepalive);
390: }
391:
392: now = ktime_get_real();
393: t = ktime_sub(call->keepalive_at, now);
394: if (t <= 0) {
395: trace_rxrpc_timer_exp(call, t, rxrpc_timer_trace_keepalive);
396: call->keepalive_at = KTIME_MAX;
397: rxrpc_send_ACK(call, RXRPC_ACK_PING, 0,
398: rxrpc_propose_ack_ping_for_keepalive);
399: }
400:
401: if (test_and_clear_bit(RXRPC_CALL_EV_INITIAL_PING, &call->events))
402: rxrpc_send_initial_ping(call);
403:
404: rxrpc_transmit_some_data(call, UINT_MAX, rxrpc_txdata_new_data);
405:
406: if (saw_ack)
407: rxrpc_congestion_degrade(call);
408:
409: if (did_receive &&
410: (__rxrpc_call_state(call) == RXRPC_CALL_CLIENT_SEND_REQUEST ||
411: __rxrpc_call_state(call) == RXRPC_CALL_SERVER_SEND_REPLY)) {
412: t = ktime_sub(call->rack_timo_at, ktime_get_real());
413: trace_rxrpc_rack(call, t);
414: }
415:
416: /* Process events */
417: if (test_and_clear_bit(RXRPC_CALL_EV_ACK_LOST, &call->events))
418: rxrpc_send_ACK(call, RXRPC_ACK_PING, 0,
419: rxrpc_propose_ack_ping_for_lost_ack);
420:
421: if (call->tx_nr_lost > 0 &&
422: __rxrpc_call_state(call) != RXRPC_CALL_CLIENT_RECV_REPLY &&
423: !test_bit(RXRPC_CALL_TX_ALL_ACKED, &call->flags))
424: rxrpc_resend(call);
425:
426: if (test_and_clear_bit(RXRPC_CALL_RX_IS_IDLE, &call->flags))
427: rxrpc_send_ACK(call, RXRPC_ACK_IDLE, 0,
428: rxrpc_propose_ack_rx_idle);
429:
430: if (call->ackr_nr_unacked > 2) {
431: if (call->rtt_count < 3)
432: rxrpc_send_ACK(call, RXRPC_ACK_PING, 0,
433: rxrpc_propose_ack_ping_for_rtt);
434: else if (ktime_before(ktime_add_ms(call->rtt_last_req, 1000),
435: ktime_get_real()))
436: rxrpc_send_ACK(call, RXRPC_ACK_PING, 0,
437: rxrpc_propose_ack_ping_for_old_rtt);
438: else
439: rxrpc_send_ACK(call, RXRPC_ACK_IDLE, 0,
440: rxrpc_propose_ack_input_data);
441: }
442:
443: /* Make sure the timer is restarted */
444: if (!__rxrpc_call_is_complete(call)) {
445: ktime_t next = READ_ONCE(call->expect_term_by), delay;
446:
447: #define set(T) { ktime_t _t = (T); if (ktime_before(_t, next)) next = _t; }
448:
449: set(call->expect_req_by);
450: set(call->expect_rx_by);
451: set(call->delay_ack_at);
452: set(call->rack_timo_at);
453: set(call->keepalive_at);
454: set(call->ping_at);
455:
456: now = ktime_get_real();
457: delay = ktime_sub(next, now);
458: if (delay <= 0) {
459: rxrpc_poke_call(call, rxrpc_call_poke_timer_now);
460: } else {
461: unsigned long nowj = jiffies, delayj, nextj;
462:
463: delayj = umax(nsecs_to_jiffies(delay), 1);
464: nextj = nowj + delayj;
465: if (time_before(nextj, call->timer.expires) ||
466: !timer_pending(&call->timer)) {
467: trace_rxrpc_timer_restart(call, delay, delayj);
468: timer_reduce(&call->timer, nextj);
469: }
470: }
471: }
472:
473: out:
474: if (__rxrpc_call_is_complete(call)) {
475: timer_delete_sync(&call->timer);
476: if (!test_bit(RXRPC_CALL_DISCONNECTED, &call->flags))
477: rxrpc_disconnect_call(call);
478: if (call->security)
479: call->security->free_call_crypto(call);
480: } else {
481: if (did_receive &&
482: call->peer->ackr_adv_pmtud &&
483: call->peer->pmtud_pending)
484: rxrpc_send_probe_for_pmtud(call);
485: }
486: _leave("");
487: return true;
488:
489: expired:
490: if (test_bit(RXRPC_CALL_RX_HEARD, &call->flags) &&
491: (int)call->conn->hi_serial - (int)call->rx_serial > 0) {
492: trace_rxrpc_call_reset(call);
493: rxrpc_abort_call(call, 0, RX_CALL_DEAD, -ECONNRESET,
494: rxrpc_abort_call_reset);
495: } else {
496: rxrpc_abort_call(call, 0, RX_CALL_TIMEOUT, -ETIME,
497: rxrpc_abort_call_timeout);
498: }
499: goto out;
500: }
SourceFile:net/rxrpc/call_event.c]
|
| 46/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 41090
output: 42
thoughts: 182
Thoughts: **Debugging a Hanging Task**
Okay, so I'm looking at this piece of code, and I see a call that's supposed to timeout. The logic says: if the timeout (`t <= 0`) hits, we jump to `expired:` and execute `rxrpc_abort_call`. This should, in theory, abort the call, trigger a signal, and wake up any waiting tasks, specifically the one in `afs_wait_for_call_to_complete`. But the task *hung* for a significant 143 seconds. That's a problem.
The immediate question is: why didn't the task wake up? Did `rxrpc_input_call_event` not get called? That function handles events for the call, and I believe it gets called from a workqueue or similar asynchronous context. Wait a second, yes, it's the event handler for the `rxrpc_call` object! The timeout *should* trigger it to queue the call for processing.
Okay, so the timer expires, which should trigger the workqueue processing. Let me shift my focus to `rxrpc_call_timer_expired`. I'll start by digging into that function to understand what's happening *after* the timer fires, as that's where the breakdown seems to be. I need to figure out what could prevent the task from being woken up once the timeout is hit.
|
| 47/2 |
2026/08/14 00:08 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_event.c Name:rxrpc_call_timer_expired]
Results: map[SourceCode: 67: static void rxrpc_call_timer_expired(struct timer_list *t)
68: {
69: struct rxrpc_call *call = timer_container_of(call, t, timer);
70:
71: _enter("%d", call->debug_id);
72:
73: if (!__rxrpc_call_is_complete(call)) {
74: trace_rxrpc_timer_expired(call);
75: rxrpc_poke_call(call, rxrpc_call_poke_timer);
76: }
77: }
SourceFile:net/rxrpc/call_object.c]
|
| 48/2 |
2026/08/14 00:08 |
llm |
expert |
0m
Model:
Tokens:
input: 41806
output: 40
thoughts: 62
Thoughts: **Diving into the RxRPC Timer Expiry**
Okay, so the timer expired for an RxRPC call, and I need to figure out what happens next. Looks like the function responsible for this is `rxrpc_call_timer_expired`, and, naturally, it resides in `net/rxrpc/call_object.c`. That makes sense; it's all about the call object. I see that `rxrpc_call_timer_expired` then calls `rxrpc_poke_call`, passing the call object and `rxrpc_call_poke_timer` as arguments. So, `rxrpc_poke_call` is the critical function here; it's where the actual "poking" of the call happens in response to the timer event. Now, let's drill down into `rxrpc_poke_call` to understand what that entails.
|
| 49/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_object.c Name:rxrpc_poke_call]
Results: map[SourceCode: 47: void rxrpc_poke_call(struct rxrpc_call *call, enum rxrpc_call_poke_trace what)
48: {
49: struct rxrpc_local *local = call->local;
50: bool busy;
51:
52: if (!test_bit(RXRPC_CALL_DISCONNECTED, &call->flags)) {
53: spin_lock_irq(&local->lock);
54: busy = !list_empty(&call->attend_link);
55: trace_rxrpc_poke_call(call, busy, what);
56: if (!busy && !rxrpc_try_get_call(call, rxrpc_call_get_poke))
57: busy = true;
58: if (!busy) {
59: list_add_tail(&call->attend_link, &local->call_attend_q);
60: }
61: spin_unlock_irq(&local->lock);
62: if (!busy)
63: rxrpc_wake_up_io_thread(local);
64: }
65: }
SourceFile:net/rxrpc/call_object.c]
|
| 50/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 42429
output: 40
thoughts: 47
Thoughts: **Analyzing the Wake-Up Mechanism**
Okay, so this code segment is dealing with the mechanism to signal and activate the I/O thread, specifically related to something called `rxrpc`. I see that the action involves a call to `local->call_attend_q`, and this action wakes up the I/O thread. Now, the I/O thread in question is named `rxrpc_io_thread`. I need to understand what this thread does. The next logical step is to dive into the definition and functionality of `rxrpc_io_thread`. I want to understand how the queue interacts with the thread.
|
| 51/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/io_thread.c Name:rxrpc_io_thread]
Results: map[SourceCode: 427: /*
428: * I/O and event handling thread.
429: */
430: int rxrpc_io_thread(void *data)
431: {
432: struct rxrpc_connection *conn;
433: struct sk_buff_head rx_queue;
434: struct rxrpc_local *local = data;
435: struct rxrpc_call *call;
436: struct sk_buff *skb;
437: #ifdef CONFIG_AF_RXRPC_INJECT_RX_DELAY
438: ktime_t now;
439: #endif
440: bool should_stop;
441: LIST_HEAD(conn_attend_q);
442: LIST_HEAD(call_attend_q);
443:
444: complete(&local->io_thread_ready);
445:
446: skb_queue_head_init(&rx_queue);
447:
448: set_user_nice(current, MIN_NICE);
449:
450: for (;;) {
451: rxrpc_inc_stat(local->rxnet, stat_io_loop);
452:
453: /* Inject a delay into packets if requested. */
454: #ifdef CONFIG_AF_RXRPC_INJECT_RX_DELAY
455: now = ktime_get_real();
456: while ((skb = skb_peek(&local->rx_delay_queue))) {
457: if (ktime_before(now, skb->tstamp))
458: break;
459: skb = skb_dequeue(&local->rx_delay_queue);
460: skb_queue_tail(&local->rx_queue, skb);
461: }
462: #endif
463:
464: if (!skb_queue_empty(&local->rx_queue)) {
465: spin_lock_irq(&local->rx_queue.lock);
466: skb_queue_splice_tail_init(&local->rx_queue, &rx_queue);
467: spin_unlock_irq(&local->rx_queue.lock);
468: trace_rxrpc_iothread_rx(local, skb_queue_len(&rx_queue));
469: }
470:
471: /* Distribute packets and errors. */
472: while ((skb = __skb_dequeue(&rx_queue))) {
473: struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
474: switch (skb->mark) {
475: case RXRPC_SKB_MARK_PACKET:
476: skb->priority = 0;
477: if (!rxrpc_input_packet(local, skb))
478: rxrpc_reject_packet(local, skb);
479: trace_rxrpc_rx_done(skb->mark, skb->priority);
480: rxrpc_free_skb(skb, rxrpc_skb_put_input);
481: break;
482: case RXRPC_SKB_MARK_ERROR:
483: rxrpc_input_error(local, skb);
484: rxrpc_free_skb(skb, rxrpc_skb_put_error_report);
485: break;
486: case RXRPC_SKB_MARK_SERVICE_CONN_SECURED:
487: rxrpc_input_conn_event(sp->poke_conn, skb);
488: rxrpc_put_connection(sp->poke_conn, rxrpc_conn_put_poke);
489: rxrpc_free_skb(skb, rxrpc_skb_put_conn_secured);
490: break;
491: default:
492: WARN_ON_ONCE(1);
493: rxrpc_free_skb(skb, rxrpc_skb_put_unknown);
494: break;
495: }
496: }
497:
498: /* Deal with connections that want immediate attention. */
499: if (!list_empty_careful(&local->conn_attend_q)) {
500: spin_lock_irq(&local->lock);
501: list_splice_tail_init(&local->conn_attend_q, &conn_attend_q);
502: spin_unlock_irq(&local->lock);
503: }
504:
505: while ((conn = list_first_entry_or_null(&conn_attend_q,
506: struct rxrpc_connection,
507: attend_link))) {
508: spin_lock_irq(&local->lock);
509: list_del_init(&conn->attend_link);
510: spin_unlock_irq(&local->lock);
511: rxrpc_input_conn_event(conn, NULL);
512: rxrpc_put_connection(conn, rxrpc_conn_put_poke);
513: }
514:
515: if (test_and_clear_bit(RXRPC_CLIENT_CONN_REAP_TIMER,
516: &local->client_conn_flags))
517: rxrpc_discard_expired_client_conns(local);
518:
519: /* Deal with calls that want immediate attention. */
520: spin_lock_irq(&local->lock);
521: list_splice_tail_init(&local->call_attend_q, &call_attend_q);
522: spin_unlock_irq(&local->lock);
523:
524: while ((call = list_first_entry_or_null(&call_attend_q,
525: struct rxrpc_call,
526: attend_link))) {
527: spin_lock_irq(&local->lock);
528: list_del_init(&call->attend_link);
529: spin_unlock_irq(&local->lock);
530: trace_rxrpc_call_poked(call);
531: rxrpc_input_call_event(call);
532: rxrpc_put_call(call, rxrpc_call_put_poke);
533: }
534:
535: if (!list_empty(&local->new_client_calls))
536: rxrpc_connect_client_calls(local);
537:
538: set_current_state(TASK_INTERRUPTIBLE);
539: should_stop = kthread_should_stop();
540: if (!skb_queue_empty(&local->rx_queue) ||
541: !list_empty(&local->call_attend_q) ||
542: !list_empty(&local->conn_attend_q) ||
543: !list_empty(&local->new_client_calls) ||
544: test_bit(RXRPC_CLIENT_CONN_REAP_TIMER,
545: &local->client_conn_flags)) {
546: __set_current_state(TASK_RUNNING);
547: continue;
548: }
549:
550: if (should_stop)
551: break;
552:
553: #ifdef CONFIG_AF_RXRPC_INJECT_RX_DELAY
554: skb = skb_peek(&local->rx_delay_queue);
555: if (skb) {
556: unsigned long timeout;
557: ktime_t tstamp = skb->tstamp;
558: ktime_t now = ktime_get_real();
559: s64 delay_ns = ktime_to_ns(ktime_sub(tstamp, now));
560:
561: if (delay_ns <= 0) {
562: __set_current_state(TASK_RUNNING);
563: continue;
564: }
565:
566: timeout = nsecs_to_jiffies(delay_ns);
567: timeout = umax(timeout, 1);
568: schedule_timeout(timeout);
569: __set_current_state(TASK_RUNNING);
570: continue;
571: }
572: #endif
573:
574: schedule();
575: }
576:
577: __set_current_state(TASK_RUNNING);
578: rxrpc_see_local(local, rxrpc_local_stop);
579: rxrpc_destroy_local(local);
580: WRITE_ONCE(local->io_thread, NULL);
581: rxrpc_see_local(local, rxrpc_local_stopped);
582: return 0;
583: }
SourceFile:net/rxrpc/io_thread.c]
|
| 52/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 45238
output: 42
thoughts: 351
Thoughts: **Debugging a Hang in RxRPC Call Completion**
Okay, so I'm tracing this RxRPC hang, and here's my line of thought. The `rxrpc_io_thread` is supposed to process the `call_attend_q` and call `rxrpc_input_call_event` for each call. That `rxrpc_input_call_event` is supposed to abort the call, then wake up `afs_wait_for_call_to_complete`.
The system's hanging. My first thought is: Is `rxrpc_io_thread` blocked? Let's check the bug report, specifically looking for `rxrpc_io_thread` blocked. Aha! The bug report shows a task (syz.0.3232) blocked, but not the `rxrpc_io_thread` itself.
Alright, if `rxrpc_io_thread` isn't blocked, then the timer should have fired, or the task should have been woken up. That means I need to re-examine `afs_wait_for_call_to_complete`. It's waiting on `afs_check_call_state(call, AFS_CALL_COMPLETE)`. `afs_check_call_state` is looking at `call->state == AFS_CALL_COMPLETE`.
`rxrpc_abort_call` sets the *RxRPC* call's completion state, but it doesn't directly touch the `afs_call->state`. So, the question becomes: how is `afs_call` notified? Going back to `rxrpc_kernel_begin_call`, it takes a `notify_rx` callback. And for synchronous calls, that callback is `afs_wake_up_call_waiter`. That's where I need to focus my attention. It looks like the notification mechanism is the key to understand why the completion state isn't being reflected correctly.
|
| 53/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/rxrpc.c Name:afs_wake_up_call_waiter]
Results: map[SourceCode: 683: /*
684: * wake up a waiting call
685: */
686: static void afs_wake_up_call_waiter(struct sock *sk, struct rxrpc_call *rxcall,
687: unsigned long call_user_ID)
688: {
689: struct afs_call *call = (struct afs_call *)call_user_ID;
690:
691: call->need_attention = true;
692: wake_up(&call->waitq);
693: }
SourceFile:fs/afs/rxrpc.c]
|
| 54/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 46235
output: 39
thoughts: 76
Thoughts: Here's my understanding of that process:
**My Internal Processing of the AFS Wake-Up Sequence**
Okay, so I'm seeing a clear handoff happening here. `afs_wake_up_call_waiter` is essentially saying, "Hey, this call needs my attention! I'm marking it so and nudging the waiter." It's setting the `need_attention` flag to `true` and immediately using `wake_up` on the `call->waitq`. Think of this `waitq` like a waiting room for the call.
Then, `afs_wait_for_call_to_complete` comes to life. It must have been sleeping (blocking) on that very `waitq`. Now, because the waiter was poked, it sees `call->need_attention` is true. My job now, as the process woken, is to clear this up. So I set that flag to `false`. But more importantly, now I actually *do* something with the call, which I do by calling `afs_deliver_to_call(call)`. That's where the *real* work is likely happening, right? This entire sequence is almost like a signal-and-wait construct, where the first function raises a flag and wakes the second, which sees and then acts on the flag. This is a very clean way to signal attention and ensure asynchronous delivery. It's a textbook wake-up and deliver mechanism.
|
| 55/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/rxrpc.c Name:afs_deliver_to_call]
Results: map[SourceCode: 521: /*
522: * deliver messages to a call
523: */
524: void afs_deliver_to_call(struct afs_call *call)
525: {
526: enum afs_call_state state;
527: size_t len;
528: u32 abort_code, remote_abort = 0;
529: int ret;
530:
531: _enter("%s", call->type->name);
532:
533: while (state = READ_ONCE(call->state),
534: state == AFS_CALL_CL_AWAIT_REPLY ||
535: state == AFS_CALL_SV_AWAIT_OP_ID ||
536: state == AFS_CALL_SV_AWAIT_REQUEST ||
537: state == AFS_CALL_SV_AWAIT_ACK
538: ) {
539: if (state == AFS_CALL_SV_AWAIT_ACK) {
540: len = 0;
541: iov_iter_kvec(&call->def_iter, ITER_DEST, NULL, 0, 0);
542: ret = rxrpc_kernel_recv_data(call->net->socket,
543: call->rxcall, &call->def_iter,
544: &len, false, &remote_abort,
545: &call->service_id);
546: trace_afs_receive_data(call, &call->def_iter, false, ret);
547:
548: if (ret == -EINPROGRESS || ret == -EAGAIN)
549: return;
550: if (ret < 0 || ret == 1) {
551: if (ret == 1)
552: ret = 0;
553: goto call_complete;
554: }
555: return;
556: }
557:
558: ret = call->type->deliver(call);
559: state = READ_ONCE(call->state);
560: if (ret == 0 && call->unmarshalling_error)
561: ret = -EBADMSG;
562: switch (ret) {
563: case 0:
564: call->responded = true;
565: afs_queue_call_work(call);
566: if (state == AFS_CALL_CL_PROC_REPLY) {
567: if (call->op)
568: set_bit(AFS_SERVER_FL_MAY_HAVE_CB,
569: &call->op->server->flags);
570: goto call_complete;
571: }
572: ASSERTCMP(state, >, AFS_CALL_CL_PROC_REPLY);
573: goto done;
574: case -EINPROGRESS:
575: case -EAGAIN:
576: goto out;
577: case -ECONNABORTED:
578: ASSERTCMP(state, ==, AFS_CALL_COMPLETE);
579: call->responded = true;
580: afs_log_error(call, call->abort_code);
581: goto done;
582: case -ENOTSUPP:
583: call->responded = true;
584: abort_code = RXGEN_OPCODE;
585: rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
586: abort_code, ret,
587: afs_abort_op_not_supported);
588: goto local_abort;
589: case -EIO:
590: pr_err("kAFS: Call %u in bad state %u\n",
591: call->debug_id, state);
592: fallthrough;
593: case -ENODATA:
594: case -EBADMSG:
595: case -EMSGSIZE:
596: case -ENOMEM:
597: case -EFAULT:
598: abort_code = RXGEN_CC_UNMARSHAL;
599: if (state != AFS_CALL_CL_AWAIT_REPLY)
600: abort_code = RXGEN_SS_UNMARSHAL;
601: rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
602: abort_code, ret,
603: afs_abort_unmarshal_error);
604: goto local_abort;
605: default:
606: abort_code = RX_CALL_DEAD;
607: rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
608: abort_code, ret,
609: afs_abort_general_error);
610: goto local_abort;
611: }
612: }
613:
614: done:
615: if (call->type->done)
616: call->type->done(call);
617: out:
618: _leave("");
619: return;
620:
621: local_abort:
622: abort_code = 0;
623: call_complete:
624: afs_set_call_complete(call, ret, remote_abort);
625: goto done;
626: }
SourceFile:fs/afs/rxrpc.c]
|
| 56/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 48281
output: 40
thoughts: 38
Thoughts: Okay, let me think this through.
**Investigating Timeout Handling in `rxrpc_abort_call`**
Hmm, now that I'm looking at this code, it's occurring to me that if `rxrpc_abort_call` is triggered by a timeout, it *absolutely* needs to communicate that state back to the socket. A timeout represents a critical failure on the connection, and the socket needs to know about this to take appropriate action β perhaps to re-establish the connection, log an error, or at least signal the application that something went wrong. So the critical question here is: how, specifically, does `rxrpc_abort_call` manage to notify the socket about this timeout condition? Does it set a flag? Does it call a dedicated socket function? Does it modify the call state in some subtle way the socket is watching? I need to understand the mechanism here to be certain the system handles timeouts correctly and that the socket layer responds appropriately to this critical event. I need to trace this function call and see what interactions take place.
|
| 57/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_event.c Name:rxrpc_abort_call]
Results: map[SourceCode: 40: /*
41: * Record that a call is locally aborted.
42: */
43: bool rxrpc_abort_call(struct rxrpc_call *call, rxrpc_seq_t seq,
44: u32 abort_code, int error, enum rxrpc_abort_reason why)
45: {
46: trace_rxrpc_abort(call->debug_id, why, call->cid, call->call_id, seq,
47: abort_code, error);
48: if (!rxrpc_set_call_completion(call, RXRPC_CALL_LOCALLY_ABORTED,
49: abort_code, error))
50: return false;
51: if (test_bit(RXRPC_CALL_EXPOSED, &call->flags))
52: rxrpc_send_abort_packet(call);
53: return true;
54: }
SourceFile:net/rxrpc/call_state.c]
|
| 58/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 48863
output: 42
thoughts: 15
Thoughts: Here's my take on that, from an expert's perspective:
**Setting the Stage for Call Completion in RXRPC**
Okay, so I'm thinking about `rxrpc_set_call_completion`. What's happening here is the core of finalizing an RXRPC call. This isn't just about setting a flag or a bit; it's the culmination of everything that's happened on the wire, in terms of data transfer and error handling, to determine the *state* of a remote procedure call's completion. It's the moment when the system declares, "Yes, this call is done, one way or another." I'm mentally parsing where this hook sits in the greater scheme of RXRPC, considering how it integrates with the error path management, retry logic, and potential for partial successes. Ultimately, itβs a critical piece of the puzzle.
|
| 59/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_state.c Name:rxrpc_set_call_completion]
Results: map[SourceCode: 10: /*
11: * Transition a call to the complete state.
12: */
13: bool rxrpc_set_call_completion(struct rxrpc_call *call,
14: enum rxrpc_call_completion compl,
15: u32 abort_code,
16: int error)
17: {
18: if (__rxrpc_call_state(call) == RXRPC_CALL_COMPLETE)
19: return false;
20:
21: call->abort_code = abort_code;
22: call->error = error;
23: call->completion = compl;
24: /* Allow reader of completion state to operate locklessly */
25: rxrpc_set_call_state(call, RXRPC_CALL_COMPLETE);
26: trace_rxrpc_call_complete(call);
27: wake_up(&call->waitq);
28: rxrpc_notify_socket(call);
29: return true;
30: }
SourceFile:net/rxrpc/call_state.c]
|
| 60/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 49419
output: 40
thoughts: 16
Thoughts: Okay, here's my interpretation of that thought process, from an expert's perspective:
**My Perspective on `rxrpc_notify_socket` and `call->notify_rx`**
Right, so, `rxrpc_notify_socket` calls `call->notify_rx`. Simple enough, but the implications are key here. I'm immediately thinking about the signaling path, the critical points where events are communicated. This suggests that the socket level, *that* specific `rxrpc` socket, is responsible for triggering a notification β probably an event β to the receiving side of a particular `rxrpc` call.
`call->notify_rx`, that pointer, is the crucial interface. I'm assuming this is a function pointer or a similar mechanism, and within the `call` structure, which I understand would contain information such as the connection, call ID, sequence numbers, and buffer state. So `call->notify_rx` is a *callback* or *handler*. It's a way for the low-level socket code to inform the higher layers of the stack about something important happening on the receive side of this specific call.
I'm making a mental note that this is probably triggered when data is received, or a FIN/RST is observed, or maybe a timeout occurs. Depending on what `notify_rx` is programmed to do, it could do things like: signal a wait queue, wake up a task, decrement a counter, update some shared state, or pass the data up the stack. This is a vital communication point, and how well this is designed, the synchronization, and the atomicity here are very important for performance and correctness.
The structure of the RxRPC system, specifically the event propagation, has to be understood if I ever needed to debug why the system is not getting information or not propagating the information correctly. This is one of the places where failures might manifest, or where performance bottlenecks would be, or where synchronization errors might hide.
Essentially, `rxrpc_notify_socket` is the agent, and `call->notify_rx` is the function to get the message across the entire system.
|
| 61/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_state.c Name:rxrpc_notify_socket]
Results: map[SourceCode: 19: /*
20: * Post a call for attention by the socket or kernel service. Further
21: * notifications are suppressed by putting recvmsg_link on a dummy queue.
22: */
23: void rxrpc_notify_socket(struct rxrpc_call *call)
24: {
25: struct rxrpc_sock *rx;
26: struct sock *sk;
27:
28: _enter("%d", call->debug_id);
29:
30: if (test_bit(RXRPC_CALL_RELEASED, &call->flags)) {
31: rxrpc_see_call(call, rxrpc_call_see_notify_released);
32: return;
33: }
34:
35: rcu_read_lock();
36:
37: rx = rcu_dereference(call->socket);
38: sk = &rx->sk;
39: if (rx && sk->sk_state < RXRPC_CLOSE) {
40: if (call->notify_rx) {
41: spin_lock_irq(&call->notify_lock);
42: call->notify_rx(sk, call, call->user_call_ID);
43: spin_unlock_irq(&call->notify_lock);
44: } else {
45: spin_lock_irq(&rx->recvmsg_lock);
46: if (list_empty(&call->recvmsg_link)) {
47: rxrpc_get_call(call, rxrpc_call_get_notify_socket);
48: list_add_tail(&call->recvmsg_link, &rx->recvmsg_q);
49: }
50: spin_unlock_irq(&rx->recvmsg_lock);
51:
52: if (!sock_flag(sk, SOCK_DEAD)) {
53: _debug("call %ps", sk->sk_data_ready);
54: sk->sk_data_ready(sk);
55: }
56: }
57: }
58:
59: rcu_read_unlock();
60: _leave("");
61: }
SourceFile:net/rxrpc/recvmsg.c]
|
| 62/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 50564
output: 40
thoughts: 405
Thoughts: **Debugging a Potential RXRPC Hang**
Okay, so I'm tracing this RXRPC call's lifecycle, trying to understand why it hung for a significant amount of time, a rather long 143 seconds. It appears that `rxrpc_notify_socket` kicks off `call->notify_rx`, which is aliased to `afs_wake_up_call_waiter`. That wakes up the `afs_wait_for_call_to_complete` function. Then, within that function, we have a check: `rxrpc_kernel_check_life` on the call's socket. And that check returns false specifically because the `call->completion` isn't `RXRPC_CALL_SUCCEEDED`; it's `RXRPC_CALL_LOCALLY_ABORTED`. So, `rxrpc_complete` is set to true, and the loop breaks, ending in a call to `afs_set_call_complete`. Then the task should be unblocked and proceed to completion.
But the 143 second hang? That's what I don't get. My first thought was maybe the `rxrpc_io_thread` wasn't running, which would mean the timer wouldn't fire. But then, if that kthread was blocked, we'd probably see it in the hung task report. And the report only shows 'syz.0.3232:18856'. Also, the `rxrpc_io_thread` is per local endpoint. If it wasn't blocked, that suggests the timer itself might not have been set properly.
So, when is the timer set? I remember `rxrpc_start_call_timer` is called when the call is connected. Now let me think about the connection process... Looking back at `afs_make_call`, it calls `rxrpc_kernel_begin_call`, which in turn calls `rxrpc_new_client_call`, and that calls `rxrpc_connect_call`. Does `rxrpc_connect_call` start the timer? That's the key question now. I need to dig into the internals of `rxrpc_connect_call` to understand when, and under what conditions, that call timer gets initiated.
|
| 63/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/call_object.c Name:rxrpc_connect_call]
Results: map[SourceCode: 289: /*
290: * Start the process of connecting a call. We obtain a peer and a connection
291: * bundle, but the actual association of a call with a connection is offloaded
292: * to the I/O thread to simplify locking.
293: */
294: static int rxrpc_connect_call(struct rxrpc_call *call, gfp_t gfp)
295: {
296: struct rxrpc_local *local = call->local;
297: int ret = -ENOMEM;
298:
299: _enter("{%d,%lx},", call->debug_id, call->user_call_ID);
300:
301: ret = rxrpc_look_up_bundle(call, gfp);
302: if (ret < 0)
303: goto error;
304:
305: trace_rxrpc_client(NULL, -1, rxrpc_client_queue_new_call);
306: rxrpc_get_call(call, rxrpc_call_get_io_thread);
307: spin_lock_irq(&local->client_call_lock);
308: list_add_tail(&call->wait_link, &local->new_client_calls);
309: spin_unlock_irq(&local->client_call_lock);
310: rxrpc_wake_up_io_thread(local);
311: return 0;
312:
313: error:
314: __set_bit(RXRPC_CALL_DISCONNECTED, &call->flags);
315: return ret;
316: }
SourceFile:net/rxrpc/call_object.c]
|
| 64/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 51998
output: 42
thoughts: 46
Thoughts: Okay, here's my interpretation of that process, explained as if it's running through *my* thought process:
**Connecting the Dots in RXRPC Client Calls**
Alright, so here's what's happening. When a new RXRPC client call comes in, the `rxrpc_connect_call` function is the gatekeeper. My first job is to add this new call to `local->new_client_calls`. This is the queue, the holding pen, if you will, for these fresh connection attempts. The immediate follow-up is to wake up the IO thread β that's the crucial signal to get things moving. I need to get the attention of the responsible party.
Once the IO thread is alerted and ready, it jumps into action, calling `rxrpc_connect_client_calls(local)`. That's where the real magic happens, where the connections are made, negotiated, and set up. So, my initial step sets the stage, and the IO thread takes the baton and runs with it to handle the heavy lifting of establishing the client communication.
|
| 65/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/conn_client.c Name:rxrpc_connect_client_calls]
Results: map[SourceCode: 505: /*
506: * Connect waiting channels (called from the I/O thread).
507: */
508: void rxrpc_connect_client_calls(struct rxrpc_local *local)
509: {
510: struct rxrpc_call *call;
511: LIST_HEAD(new_client_calls);
512:
513: spin_lock_irq(&local->client_call_lock);
514: list_splice_tail_init(&local->new_client_calls, &new_client_calls);
515: spin_unlock_irq(&local->client_call_lock);
516:
517: while ((call = list_first_entry_or_null(&new_client_calls,
518: struct rxrpc_call, wait_link))) {
519: struct rxrpc_bundle *bundle = call->bundle;
520:
521: list_move_tail(&call->wait_link, &bundle->waiting_calls);
522: rxrpc_see_call(call, rxrpc_call_see_waiting_call);
523:
524: if (rxrpc_bundle_has_space(bundle))
525: rxrpc_activate_channels(bundle);
526: }
527: }
SourceFile:net/rxrpc/conn_client.c]
|
| 66/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 52719
output: 40
thoughts: 22
Thoughts: Okay, here's my interpretation of that thought process, summarized as you requested:
**My Activation Process**
Right, so I'm handling a new piece of work here. My first step is to add the current call to the `bundle->waiting_calls` queue. This tells the system that this particular task is waiting to be processed. Think of it like adding a new request to a holding area. Then, and this is crucial, I need to kick-start things. I then call `rxrpc_activate_channels`. This is the signal. This function is my trigger to get the network channels up and ready to go so that the work I just added to the queue can be handled. So first, I note the work, then I get the system moving to do the work. The activation call is the go ahead to actually start handling things.
|
| 67/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/conn_client.c Name:rxrpc_activate_channels]
Results: map[SourceCode: 467: /*
468: * Assign channels and callNumbers to waiting calls.
469: */
470: static void rxrpc_activate_channels(struct rxrpc_bundle *bundle)
471: {
472: struct rxrpc_connection *conn;
473: unsigned long avail, mask;
474: unsigned int channel, slot;
475:
476: trace_rxrpc_client(NULL, -1, rxrpc_client_activate_chans);
477:
478: if (bundle->try_upgrade)
479: mask = 1;
480: else
481: mask = ULONG_MAX;
482:
483: while (!list_empty(&bundle->waiting_calls)) {
484: avail = bundle->avail_chans & mask;
485: if (!avail)
486: break;
487: channel = __ffs(avail);
488: clear_bit(channel, &bundle->avail_chans);
489:
490: slot = channel / RXRPC_MAXCALLS;
491: conn = bundle->conns[slot];
492: if (!conn)
493: break;
494:
495: if (bundle->try_upgrade)
496: set_bit(RXRPC_CONN_PROBING_FOR_UPGRADE, &conn->flags);
497: rxrpc_unidle_conn(conn);
498:
499: channel &= (RXRPC_MAXCALLS - 1);
500: conn->act_chans |= 1 << channel;
501: rxrpc_activate_one_channel(conn, channel);
502: }
503: }
SourceFile:net/rxrpc/conn_client.c]
|
| 68/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 53506
output: 42
thoughts: 22
Thoughts: Here's my take on those thoughts, from my perspective as an expert:
**Investigating the Activation Process of an RxRPC Channel**
Okay, so I'm digging into the RxRPC code, and I see that `rxrpc_activate_one_channel` is calling `rxrpc_start_call_timer`. Interesting. My initial thought is to figure out *why* it's doing that. What's the connection? Is the timer solely used for monitoring call initiation, perhaps to detect stalled connections or issues with the initial handshake? Or does this timer function as a broader mechanism, involved in various aspects of the call lifecycle? I need to understand if this is a critical dependency, a performance optimization, or perhaps even related to congestion control or retransmission strategy during call setup. Understanding this interplay between channel activation and timer initiation is crucial for grasping the overall reliability and performance characteristics of the RxRPC system. I'll need to trace the call timer's functionality to pinpoint its impact on channel activation specifically.
|
| 69/2 |
2026/08/14 00:09 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/conn_client.c Name:rxrpc_activate_one_channel]
Results: map[SourceCode: 407: /*
408: * Assign a channel to the call at the front of the queue and wake the call up.
409: * We don't increment the callNumber counter until this number has been exposed
410: * to the world.
411: */
412: static void rxrpc_activate_one_channel(struct rxrpc_connection *conn,
413: unsigned int channel)
414: {
415: struct rxrpc_channel *chan = &conn->channels[channel];
416: struct rxrpc_bundle *bundle = conn->bundle;
417: struct rxrpc_call *call = list_entry(bundle->waiting_calls.next,
418: struct rxrpc_call, wait_link);
419: u32 call_id = chan->call_counter + 1;
420:
421: _enter("C=%x,%u", conn->debug_id, channel);
422:
423: list_del_init(&call->wait_link);
424:
425: trace_rxrpc_client(conn, channel, rxrpc_client_chan_activate);
426:
427: /* Cancel the final ACK on the previous call if it hasn't been sent yet
428: * as the DATA packet will implicitly ACK it.
429: */
430: clear_bit(RXRPC_CONN_FINAL_ACK_0 + channel, &conn->flags);
431: clear_bit(conn->bundle_shift + channel, &bundle->avail_chans);
432:
433: rxrpc_see_call(call, rxrpc_call_see_activate_client);
434: call->conn = rxrpc_get_connection(conn, rxrpc_conn_get_activate_call);
435: call->cid = conn->proto.cid | channel;
436: call->call_id = call_id;
437: call->dest_srx.srx_service = conn->service_id;
438: call->cong_ssthresh = call->peer->cong_ssthresh;
439: if (call->cong_cwnd >= call->cong_ssthresh)
440: call->cong_ca_state = RXRPC_CA_CONGEST_AVOIDANCE;
441: else
442: call->cong_ca_state = RXRPC_CA_SLOW_START;
443:
444: chan->call_id = call_id;
445: chan->call_debug_id = call->debug_id;
446: chan->call = call;
447:
448: rxrpc_see_call(call, rxrpc_call_see_connected);
449: trace_rxrpc_connect_call(call);
450: call->tx_last_sent = ktime_get_real();
451: rxrpc_start_call_timer(call);
452: rxrpc_set_call_state(call, RXRPC_CALL_CLIENT_PRE_SEND);
453: wake_up(&call->waitq);
454: }
SourceFile:net/rxrpc/conn_client.c]
|
| 70/2 |
2026/08/14 00:09 |
llm |
expert |
0m
Model:
Tokens:
input: 54690
output: 42
thoughts: 640
Thoughts: **My Analysis of a Potential Deadlock in RXRPC**
Okay, so I'm looking at this code, and it's pretty clear that `rxrpc_start_call_timer(call)` is supposed to be called. But what if `rxrpc_activate_channels` *doesn't* find an available channel? The code checks `bundle->avail_chans`. If it's zero, the loop breaks, and the call sits in `bundle->waiting_calls`. That's the key. If the call's in `bundle->waiting_calls`, `rxrpc_start_call_timer` *never* gets called.
And if `rxrpc_start_call_timer` isn't called, the timer's never started, `expect_term_by` isn't set, and, critically, this call *won't* timeout! It just hangs there. Now, the code I'm looking at, `afs_wait_for_call_to_complete`, waits for `afs_check_call_state(call, AFS_CALL_COMPLETE)`. If this call is stuck in `bundle->waiting_calls`, it *will* never complete and `afs_wait_for_call_to_complete` will hang. That's a classic deadlock! Missing timeout, right there.
So, why would `bundle->avail_chans` be zero in the first place? My initial thought is that all the channels are in use by other calls. Can an unprivileged user do something to make this happen? Can they create a bunch of calls and exhaust the channels? Well, yes, they *can* create AF_RXRPC sockets and send messages and exhaust the channels, but there's a problem here.
Wait, `bundle` is defined per `rxrpc_local`, `rxrpc_peer`, `key`, and `security_level`. So, if an unprivileged user creates AF_RXRPC sockets, they'd either be using their own `rxrpc_local` (if they bind to a different port) or the same `rxrpc_local` but a different `key`. Even if they *did* exhaust the channels with their own calls, their own calls would hang.
Could they cause *AFS* calls to hang? Ah, AFS uses its own `rxrpc_local` (bound to a specific port) and its own `key`. So AFS calls would use a *different* `bundle` than the user's AF_RXRPC sockets. But wait... unless the user can trigger AFS to make a lot of calls simultaneously!
Can an unprivileged user do *that*? If AFS is mounted, yes! They can access files on AFS. Each file access (read, write, stat, etc.) *might* trigger an AFS call. If they spawn many threads to access different files, that could trigger a lot of concurrent AFS calls. If the AFS server is slow, or worse, malicious and doesn't respond promptly, those channels will remain occupied. AFS calls, especially from unprivileged users, will be hanging.
The default number of channels is 4, but RXRPC can also create multiple connections per bundle, but I need to check how that works. That's something I need to look into more, but it seems there's a clear vulnerability here.
|
| 71/2 |
2026/08/14 00:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/conn_client.c Name:rxrpc_bundle_has_space]
Results: map[SourceCode: 368: /*
369: * Add a connection to a bundle if there are no usable connections or we have
370: * connections waiting for extra capacity.
371: */
372: static bool rxrpc_bundle_has_space(struct rxrpc_bundle *bundle)
373: {
374: int slot = -1, i, usable;
375:
376: _enter("");
377:
378: bundle->alloc_error = 0;
379:
380: /* See if there are any usable connections. */
381: usable = 0;
382: for (i = 0; i < ARRAY_SIZE(bundle->conns); i++) {
383: if (rxrpc_may_reuse_conn(bundle->conns[i]))
384: usable++;
385: else if (slot == -1)
386: slot = i;
387: }
388:
389: if (!usable && bundle->upgrade)
390: bundle->try_upgrade = true;
391:
392: if (!usable)
393: goto alloc_conn;
394:
395: if (!bundle->avail_chans &&
396: !bundle->try_upgrade &&
397: usable < ARRAY_SIZE(bundle->conns))
398: goto alloc_conn;
399:
400: _leave("");
401: return usable;
402:
403: alloc_conn:
404: return slot >= 0 ? rxrpc_add_conn_to_bundle(bundle, slot) : false;
405: }
SourceFile:net/rxrpc/conn_client.c]
|
| 72/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 56625
output: 37
thoughts: 61
Thoughts: Here's my understanding of the situation, presented from my perspective as an expert:
**Analyzing `rxrpc_bundle_has_space`**
Okay, so I'm looking at `rxrpc_bundle_has_space`. Basically, the code is checking for available resources to handle a new connection within an RxRPC bundle. The logic is straightforward: I need to allocate a new connection if I don't already have any available channels to reuse. The critical condition for allocation is ensuring that the number of usable connections, represented by the `usable` variable, is less than the maximum capacity of the bundle's connection array. Essentially, the function `rxrpc_bundle_has_space` will allocate a new connection when I, the connection manager, have run out of available channels and I can still add more to the connection array. I need to make sure I don't exceed the defined maximum number of connections per bundle. `ARRAY_SIZE(bundle->conns)` translates directly to `RXRPC_MAX_CONNS_PER_BUNDLE`, which is the hard limit on the connections I can hold in this bundle. It's a fundamental check to prevent exceeding the designated storage allocation.
|
| 73/2 |
2026/08/14 00:10 |
tool |
grepper |
0m
Error:
Args: map[Expression:RXRPC_MAX_CONNS_PER_BUNDLE PathPrefix:net/rxrpc/]
Results:
|
| 74/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 56988
output: 38
thoughts: 11
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Diving into `rxrpc_bundle`**
Okay, time to get my hands dirty. Let's start with a deep dive into the `struct rxrpc_bundle`. I need to refresh my understanding of how this structure functions in the grand scheme of RxRPC. I know it's a key element, but a quick review never hurts. I need to be sure the data it encapsulates still lines up with my mental model of the RxRPC architecture, especially with the latest changes in the kernel. Let's see how the packet bundling mechanism is currently implemented. It's time to check the internals.
|
| 75/2 |
2026/08/14 00:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/ar-internal.h Name:rxrpc_bundle]
Results: map[SourceCode: 512: /*
513: * RxRPC client connection bundle.
514: */
515: struct rxrpc_bundle {
516: struct rxrpc_local *local; /* Representation of local endpoint */
517: struct rxrpc_peer *peer; /* Remote endpoint */
518: struct key *key; /* Security details */
519: struct list_head proc_link; /* Link in net->bundle_proc_list */
520: const struct rxrpc_security *security; /* applied security module */
521: refcount_t ref;
522: atomic_t active; /* Number of active users */
523: unsigned int debug_id;
524: u32 security_level; /* Security level selected */
525: u16 service_id; /* Service ID for this connection */
526: bool try_upgrade; /* True if the bundle is attempting upgrade */
527: bool exclusive; /* T if conn is exclusive */
528: bool upgrade; /* T if service ID can be upgraded */
529: unsigned short alloc_error; /* Error from last conn allocation */
530: struct rb_node local_node; /* Node in local->client_conns */
531: struct list_head waiting_calls; /* Calls waiting for channels */
532: unsigned long avail_chans; /* Mask of available channels */
533: unsigned int conn_ids[4]; /* Connection IDs. */
534: struct rxrpc_connection *conns[4]; /* The connections in the bundle (max 4) */
535: };
SourceFile:net/rxrpc/ar-internal.h]
|
| 76/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 57681
output: 32
thoughts: 26
Thoughts: Here's my take on the situation:
**Understanding Connection Limits**
Okay, so I'm looking at this structure, and I'm immediately thinking about its limitations. The fundamental constraint seems to be that a "bundle" β whatever that represents β tops out at just four connections. That's the hard ceiling, I need to keep that in mind. Each of these connections, in turn, can handle a specific number of channels, defined by this `RXRPC_MAXCALLS` constant. So, for every one of these maximum of four possible connections I have to keep track of the channels the connection is capable of supporting. I'll need to remember that these are separate considerations - the bundle's connection limit and then the connection's channels limit. It is clear that the lower of the two limits applies. This impacts how I design the data flow and how I can scale this architecture.
|
| 77/2 |
2026/08/14 00:10 |
tool |
grepper |
0m
Args: map[Expression:RXRPC_MAXCALLS PathPrefix:net/rxrpc/]
Results: map[Output:net/rxrpc/ar-internal.h=542=struct rxrpc_connection {
--
net/rxrpc/ar-internal.h-567- };
net/rxrpc/ar-internal.h:568: } channels[RXRPC_MAXCALLS];
net/rxrpc/ar-internal.h-569-
--
net/rxrpc/conn_client.c=338=static bool rxrpc_add_conn_to_bundle(struct rxrpc_bundle *bundle,
--
net/rxrpc/conn_client.c-341- struct rxrpc_connection *conn, *old;
net/rxrpc/conn_client.c:342: unsigned int shift = slot * RXRPC_MAXCALLS;
net/rxrpc/conn_client.c-343- unsigned int i;
--
net/rxrpc/conn_client.c-362- bundle->conn_ids[slot] = conn->debug_id;
net/rxrpc/conn_client.c:363: for (i = 0; i < RXRPC_MAXCALLS; i++)
net/rxrpc/conn_client.c-364- set_bit(shift + i, &bundle->avail_chans);
--
net/rxrpc/conn_client.c=470=static void rxrpc_activate_channels(struct rxrpc_bundle *bundle)
--
net/rxrpc/conn_client.c-489-
net/rxrpc/conn_client.c:490: slot = channel / RXRPC_MAXCALLS;
net/rxrpc/conn_client.c-491- conn = bundle->conns[slot];
--
net/rxrpc/conn_client.c-498-
net/rxrpc/conn_client.c:499: channel &= (RXRPC_MAXCALLS - 1);
net/rxrpc/conn_client.c-500- conn->act_chans |= 1 << channel;
--
net/rxrpc/conn_client.c=674=static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
--
net/rxrpc/conn_client.c-684-
net/rxrpc/conn_client.c:685: bindex = conn->bundle_shift / RXRPC_MAXCALLS;
net/rxrpc/conn_client.c-686- if (bundle->conns[bindex] == conn) {
--
net/rxrpc/conn_client.c-689- bundle->conn_ids[bindex] = 0;
net/rxrpc/conn_client.c:690: for (i = 0; i < RXRPC_MAXCALLS; i++)
net/rxrpc/conn_client.c-691- clear_bit(conn->bundle_shift + i, &bundle->avail_chans);
--
net/rxrpc/conn_event.c=211=static void rxrpc_abort_calls(struct rxrpc_connection *conn)
--
net/rxrpc/conn_event.c-217-
net/rxrpc/conn_event.c:218: for (i = 0; i < RXRPC_MAXCALLS; i++) {
net/rxrpc/conn_event.c-219- call = conn->channels[i].call;
--
net/rxrpc/conn_event.c=344=void rxrpc_process_delayed_final_acks(struct rxrpc_connection *conn, bool force)
--
net/rxrpc/conn_event.c-352- set = false;
net/rxrpc/conn_event.c:353: for (channel = 0; channel < RXRPC_MAXCALLS; channel++) {
net/rxrpc/conn_event.c-354- struct rxrpc_channel *chan = &conn->channels[channel];
--
net/rxrpc/conn_event.c=536=void rxrpc_input_conn_event(struct rxrpc_connection *conn, struct sk_buff *skb)
--
net/rxrpc/conn_event.c-561-
net/rxrpc/conn_event.c:562: for (loop = 0; loop < RXRPC_MAXCALLS; loop++)
net/rxrpc/conn_event.c-563- rxrpc_call_is_secure(conn->channels[loop].call);
--
net/rxrpc/protocol.h=21=struct rxrpc_wire_header {
--
net/rxrpc/protocol.h-25- __be32 cid; /* connection and channel ID */
net/rxrpc/protocol.h:26:#define RXRPC_MAXCALLS 4 /* max active calls per conn */
net/rxrpc/protocol.h:27:#define RXRPC_CHANNELMASK (RXRPC_MAXCALLS-1) /* mask for channel ID */
net/rxrpc/protocol.h-28-#define RXRPC_CIDMASK (~RXRPC_CHANNELMASK) /* mask for connection ID */
net/rxrpc/protocol.h:29:#define RXRPC_CIDSHIFT ilog2(RXRPC_MAXCALLS) /* shift for connection ID */
net/rxrpc/protocol.h-30-#define RXRPC_CID_INC (1 << RXRPC_CIDSHIFT) /* connection ID increment */
--
net/rxrpc/rxkad.c=937=static int rxkad_verify_response(struct rxrpc_connection *conn,
--
net/rxrpc/rxkad.c-1036-
net/rxrpc/rxkad.c:1037: for (i = 0; i < RXRPC_MAXCALLS; i++) {
net/rxrpc/rxkad.c-1038- u32 call_id = ntohl(response->encrypted.call_id[i]);
]
|
| 78/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 59389
output: 39
thoughts: 723
Thoughts: **My Analysis of a Potential AFS Denial-of-Service Vulnerability**
Okay, let me break this down. It looks like `RXRPC_MAXCALLS` limits a bundle to 4 connections, and each connection can handle 4 channels. That puts a hard cap on 16 active calls per bundle. So, if AFS tries to make more than 16 concurrent calls to the same server, that 17th call gets queued in `bundle->waiting_calls`. The thing is, while it's in `waiting_calls`, its timer isn't running. This is where things get interesting.
If the server is slow or, worse, malicious, the first 16 calls will eventually timeout, and that's after `AFS_VL_MAX_LIFESPAN`, which we know is 120 seconds. The timeouts will abort those calls, freeing up the channels. Then, that 17th call gets activated, its timer *does* start, and it times out after *another* 120 seconds. So the 17th call will effectively hang for 240 seconds! This scales: the Nth call will be delayed `(N/16) * 120` seconds.
Now, the hung task watchdog timeout is, as we know, 143 seconds. If an unprivileged user triggers, say, 17 concurrent AFS calls to a sluggish server, that 17th call will block for 240 seconds, exceeding the hung task watchdog limit! The question is, can an unprivileged user actually *do* this?
Yes, they can. They can trigger AFS calls by having AFS mounted and then running something like `stat()` on a file requiring network access. They could even spawn 17 threads, each doing a `stat()` call on a network-backed resource. If that server is slow, the first 16 calls will timeout after 120 seconds. Then that 17th call will sit in `waiting_calls` (no timer), then the active state with the 120-second timer. Since `afs_wait_for_call_to_complete` uses `TASK_UNINTERRUPTIBLE`, that 17th call *will* trigger a hung task.
Wait, confirmation is needed on that, but it looks like `afs_wait_for_call_to_complete` is indeed waiting in `TASK_UNINTERRUPTIBLE`. Yep, saw it uses `set_current_state(TASK_UNINTERRUPTIBLE)`. This means it *is* a Denial-of-Service vulnerability that can trigger a hung task panic. This is exploitable by an unprivileged user, *if* AFS is mounted, or if they can trigger an automount.
Can they trigger an automount? Automounts are triggered by accessing a mountpoint. If the system admin has configured AFS automounts (e.g., `/afs/...`), then *any* user can potentially access them. So, the system has to have AFS configured to be vulnerable, though.
But what if they don't have AFS mounted at all? Can they still trigger this? What about AF_RXRPC sockets directly? If they use those sockets, they'd use `sendmsg` and `recvmsg`. Hmmm, `rxrpc_recvmsg` uses `TASK_INTERRUPTIBLE`. That's good; it won't trigger the watchdog. And `rxrpc_sendmsg` looks like it's interruptible too. Okay, so direct AF_RXRPC socket usage is likely not exploitable.
|
| 79/2 |
2026/08/14 00:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/sendmsg.c Name:rxrpc_send_data]
Results: map[SourceCode: 315: /*
316: * send data through a socket
317: * - must be called in process context
318: * - The caller holds the call user access mutex, but not the socket lock.
319: */
320: static int rxrpc_send_data(struct rxrpc_sock *rx,
321: struct rxrpc_call *call,
322: struct msghdr *msg, size_t len,
323: rxrpc_notify_end_tx_t notify_end_tx,
324: bool *_dropped_lock)
325: {
326: struct rxrpc_txbuf *txb;
327: struct sock *sk = &rx->sk;
328: enum rxrpc_call_state state;
329: long timeo;
330: bool more = msg->msg_flags & MSG_MORE;
331: int ret, copied = 0;
332:
333: if (test_bit(RXRPC_CALL_TX_NO_MORE, &call->flags)) {
334: trace_rxrpc_abort(call->debug_id, rxrpc_sendmsg_late_send,
335: call->cid, call->call_id, call->rx_consumed,
336: 0, -EPROTO);
337: return -EPROTO;
338: }
339:
340: timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
341:
342: ret = rxrpc_wait_to_be_connected(call, &timeo);
343: if (ret < 0)
344: return ret;
345:
346: if (call->conn->state == RXRPC_CONN_CLIENT_UNSECURED) {
347: ret = rxrpc_init_client_conn_security(call->conn);
348: if (ret < 0)
349: return ret;
350: }
351:
352: /* this should be in poll */
353: sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
354:
355: reload:
356: txb = call->tx_pending;
357: call->tx_pending = NULL;
358: if (txb)
359: rxrpc_see_txbuf(txb, rxrpc_txbuf_see_send_more);
360:
361: ret = -EPIPE;
362: if (sk->sk_shutdown & SEND_SHUTDOWN)
363: goto maybe_error;
364: state = rxrpc_call_state(call);
365: ret = -ESHUTDOWN;
366: if (state >= RXRPC_CALL_COMPLETE)
367: goto maybe_error;
368: ret = -EPROTO;
369: if (state != RXRPC_CALL_CLIENT_PRE_SEND &&
370: state != RXRPC_CALL_CLIENT_SEND_REQUEST &&
371: state != RXRPC_CALL_SERVER_ACK_REQUEST &&
372: state != RXRPC_CALL_SERVER_SEND_REPLY) {
373: /* Request phase complete for this client call */
374: trace_rxrpc_abort(call->debug_id, rxrpc_sendmsg_late_send,
375: call->cid, call->call_id, call->rx_consumed,
376: 0, -EPROTO);
377: goto maybe_error;
378: }
379:
380: ret = -EMSGSIZE;
381: if (call->tx_total_len != -1) {
382: if (len - copied > call->tx_total_len)
383: goto maybe_error;
384: if (!more && len - copied != call->tx_total_len)
385: goto maybe_error;
386: }
387:
388: do {
389: if (!txb) {
390: size_t remain;
391:
392: _debug("alloc");
393:
394: if (!rxrpc_check_tx_space(call, NULL))
395: goto wait_for_space;
396:
397: /* See if we need to begin/extend the Tx queue. */
398: if (!call->send_queue || !((call->send_top + 1) & RXRPC_TXQ_MASK)) {
399: ret = rxrpc_alloc_txqueue(sk, call);
400: if (ret < 0)
401: goto maybe_error;
402: }
403:
404: /* Work out the maximum size of a packet. Assume that
405: * the security header is going to be in the padded
406: * region (enc blocksize), but the trailer is not.
407: */
408: remain = more ? INT_MAX : msg_data_left(msg);
409: txb = call->conn->security->alloc_txbuf(call, remain, sk->sk_allocation);
410: if (!txb) {
411: ret = -ENOMEM;
412: goto maybe_error;
413: }
414: }
415:
416: _debug("append");
417:
418: /* append next segment of data to the current buffer */
419: if (msg_data_left(msg) > 0) {
420: size_t copy = umin(txb->space, msg_data_left(msg));
421:
422: _debug("add %zu", copy);
423: if (!copy_from_iter_full(txb->data + txb->offset,
424: copy, &msg->msg_iter))
425: goto efault;
426: _debug("added");
427: txb->space -= copy;
428: txb->len += copy;
429: txb->offset += copy;
430: copied += copy;
431: if (call->tx_total_len != -1)
432: call->tx_total_len -= copy;
433: }
434:
435: /* check for the far side aborting the call or a network error
436: * occurring */
437: if (rxrpc_call_is_complete(call))
438: goto call_terminated;
439:
440: /* add the packet to the send queue if it's now full */
441: if (!txb->space ||
442: (msg_data_left(msg) == 0 && !more)) {
443: if (msg_data_left(msg) == 0 && !more)
444: txb->flags |= RXRPC_LAST_PACKET;
445:
446: ret = call->security->secure_packet(call, txb);
447: if (ret < 0)
448: goto out;
449: rxrpc_queue_packet(rx, call, txb, notify_end_tx);
450: txb = NULL;
451: }
452: } while (msg_data_left(msg) > 0);
453:
454: success:
455: ret = copied;
456: if (rxrpc_call_is_complete(call) &&
457: call->error < 0)
458: ret = call->error;
459: out:
460: call->tx_pending = txb;
461: _leave(" = %d", ret);
462: return ret;
463:
464: call_terminated:
465: rxrpc_put_txbuf(txb, rxrpc_txbuf_put_send_aborted);
466: _leave(" = %d", call->error);
467: return call->error;
468:
469: maybe_error:
470: if (copied)
471: goto success;
472: goto out;
473:
474: efault:
475: ret = -EFAULT;
476: goto out;
477:
478: wait_for_space:
479: ret = -EAGAIN;
480: if (msg->msg_flags & MSG_DONTWAIT)
481: goto maybe_error;
482: mutex_unlock(&call->user_mutex);
483: *_dropped_lock = true;
484: ret = rxrpc_wait_for_tx_window(rx, call, &timeo,
485: msg->msg_flags & MSG_WAITALL);
486: if (ret < 0)
487: goto maybe_error;
488: if (call->interruptibility == RXRPC_INTERRUPTIBLE) {
489: if (mutex_lock_interruptible(&call->user_mutex) < 0) {
490: ret = sock_intr_errno(timeo);
491: goto maybe_error;
492: }
493: } else {
494: mutex_lock(&call->user_mutex);
495: }
496: *_dropped_lock = false;
497: goto reload;
498: }
SourceFile:net/rxrpc/sendmsg.c]
|
| 80/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 63725
output: 43
thoughts: 20
Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it were my own:
**Waiting for Connection Establishment: `rxrpc_wait_to_be_connected`**
Right, so I'm thinking about connection management here. Specifically, `rxrpc_wait_to_be_connected`. The core concept is obvious; this function, or the logic behind it, is blocking or at least *synchronously checking* for the completion of the connection establishment phase. It's a fundamental part of reliable RPC.
Now, I need to consider the nuances. Am I dealing with a simple blocking wait, perhaps with a timeout? Or is this more sophisticated, using a condition variable or a similar mechanism to signal the completion asynchronously? Knowing the implementation details, I can deduce if it is a polling loop, a proper event-driven approach, or something in between. How is this integrated with the underlying transport layer? Is it tied to socket options, connection timeouts, or even retransmission strategies?
Furthermore, I have to think about what "connected" actually *means* in this context. Is it simply a successful TCP handshake? Or does it also encompass authentication, session key exchange, or other RPC-specific setup? Any failure needs to be considered. What is the error handling strategy? Are there retry mechanisms? If the function returns, what error codes are possible, and how are they propagated up the call stack? It's essential to understand the implications of this waiting period on the overall RPC call latency and resource utilization. We need to be able to reason about deadlock scenarios too, obviously.
|
| 81/2 |
2026/08/14 00:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/sendmsg.c Name:rxrpc_wait_to_be_connected]
Results: map[SourceCode: 42: /*
43: * Wait for a call to become connected. Interruption here doesn't cause the
44: * call to be aborted.
45: */
46: static int rxrpc_wait_to_be_connected(struct rxrpc_call *call, long *timeo)
47: {
48: DECLARE_WAITQUEUE(myself, current);
49: int ret = 0;
50:
51: _enter("%d", call->debug_id);
52:
53: if (rxrpc_call_state(call) != RXRPC_CALL_CLIENT_AWAIT_CONN)
54: goto no_wait;
55:
56: add_wait_queue_exclusive(&call->waitq, &myself);
57:
58: for (;;) {
59: switch (call->interruptibility) {
60: case RXRPC_INTERRUPTIBLE:
61: case RXRPC_PREINTERRUPTIBLE:
62: set_current_state(TASK_INTERRUPTIBLE);
63: break;
64: case RXRPC_UNINTERRUPTIBLE:
65: default:
66: set_current_state(TASK_UNINTERRUPTIBLE);
67: break;
68: }
69:
70: if (rxrpc_call_state(call) != RXRPC_CALL_CLIENT_AWAIT_CONN)
71: break;
72: if ((call->interruptibility == RXRPC_INTERRUPTIBLE ||
73: call->interruptibility == RXRPC_PREINTERRUPTIBLE) &&
74: signal_pending(current)) {
75: ret = sock_intr_errno(*timeo);
76: break;
77: }
78: *timeo = schedule_timeout(*timeo);
79: }
80:
81: remove_wait_queue(&call->waitq, &myself);
82: __set_current_state(TASK_RUNNING);
83:
84: no_wait:
85: if (ret == 0 && rxrpc_call_is_complete(call))
86: ret = call->error;
87:
88: _leave(" = %d", ret);
89: return ret;
90: }
SourceFile:net/rxrpc/sendmsg.c]
|
| 82/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 64812
output: 40
thoughts: 56
Thoughts: Okay, here's my interpretation of those thoughts, summarized from my perspective as a networking expert:
**Investigating `rxrpc_wait_to_be_connected` and Interruptibility**
Right, so I'm looking at how `rxrpc_wait_to_be_connected` handles blocking calls, and specifically, how it manages interruptibility. The core observation is that it leverages `TASK_UNINTERRUPTIBLE` when the `call->interruptibility` flag is set to `RXRPC_UNINTERRUPTIBLE`. That's standard and expected behavior to prevent the operation from being interrupted by a signal, guaranteeing the connection's completion or an error.
The key question then becomes: In the context of AF_RXRPC sockets, what's the typical interruptibility setting? Is it generally interruptible, uninterruptible, or something that is dynamically configured based on the situation? Understanding this aspect is critical because it dictates whether a long-running connection attempt can be preempted or has to run to completion. This influences how we deal with long latency or failure situations. It is particularly interesting because AF_RXRPC is built on the network, it is expected that it can timeout to facilitate the progress of a thread. Therefore, the implementation must allow for this. I'm going to have to dig deeper into the socket creation and connection establishment routines to figure out how this interruptibility flag gets configured for those particular socket types. The specifics of AF_RXRPC are important here.
|
| 83/2 |
2026/08/14 00:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/rxrpc/sendmsg.c Name:rxrpc_do_sendmsg]
Results: map[SourceCode: 655: /*
656: * send a message forming part of a client call through an RxRPC socket
657: * - caller holds the socket locked
658: * - the socket may be either a client socket or a server socket
659: */
660: int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
661: {
662: struct rxrpc_call *call;
663: bool dropped_lock = false;
664: int ret;
665:
666: struct rxrpc_send_params p = {
667: .call.tx_total_len = -1,
668: .call.user_call_ID = 0,
669: .call.nr_timeouts = 0,
670: .call.interruptibility = RXRPC_INTERRUPTIBLE,
671: .abort_code = 0,
672: .command = RXRPC_CMD_SEND_DATA,
673: .exclusive = false,
674: .upgrade = false,
675: };
676:
677: _enter("");
678:
679: ret = rxrpc_sendmsg_cmsg(msg, &p);
680: if (ret < 0)
681: goto error_release_sock;
682:
683: if (p.command == RXRPC_CMD_CHARGE_ACCEPT) {
684: ret = -EINVAL;
685: if (rx->sk.sk_state != RXRPC_SERVER_LISTENING)
686: goto error_release_sock;
687: ret = rxrpc_user_charge_accept(rx, p.call.user_call_ID);
688: goto error_release_sock;
689: }
690:
691: call = rxrpc_find_call_by_user_ID(rx, p.call.user_call_ID);
692: if (!call) {
693: ret = -EBADSLT;
694: if (p.command != RXRPC_CMD_SEND_DATA)
695: goto error_release_sock;
696: call = rxrpc_new_client_call_for_sendmsg(rx, msg, &p);
697: /* The socket is now unlocked... */
698: if (IS_ERR(call))
699: return PTR_ERR(call);
700: /* ... and we have the call lock. */
701: p.call.nr_timeouts = 0;
702: ret = 0;
703: if (rxrpc_call_is_complete(call))
704: goto out_put_unlock;
705: } else {
706: switch (rxrpc_call_state(call)) {
707: case RXRPC_CALL_CLIENT_AWAIT_CONN:
708: case RXRPC_CALL_SERVER_RECV_REQUEST:
709: if (p.command == RXRPC_CMD_SEND_ABORT)
710: break;
711: fallthrough;
712: case RXRPC_CALL_UNINITIALISED:
713: case RXRPC_CALL_SERVER_PREALLOC:
714: rxrpc_put_call(call, rxrpc_call_put_sendmsg);
715: ret = -EBUSY;
716: goto error_release_sock;
717: default:
718: break;
719: }
720:
721: ret = mutex_lock_interruptible(&call->user_mutex);
722: release_sock(&rx->sk);
723: if (ret < 0) {
724: ret = -ERESTARTSYS;
725: goto error_put;
726: }
727:
728: if (p.call.tx_total_len != -1) {
729: ret = -EINVAL;
730: if (call->tx_total_len != -1 ||
731: call->tx_pending ||
732: call->tx_top != 0)
733: goto out_put_unlock;
734: call->tx_total_len = p.call.tx_total_len;
735: }
736: }
737:
738: switch (p.call.nr_timeouts) {
739: case 3:
740: WRITE_ONCE(call->next_rx_timo, p.call.timeouts.normal);
741: fallthrough;
742: case 2:
743: WRITE_ONCE(call->next_req_timo, p.call.timeouts.idle);
744: fallthrough;
745: case 1:
746: if (p.call.timeouts.hard > 0) {
747: ktime_t delay = ms_to_ktime(p.call.timeouts.hard * MSEC_PER_SEC);
748:
749: WRITE_ONCE(call->expect_term_by,
750: ktime_add(p.call.timeouts.hard,
751: ktime_get_real()));
752: trace_rxrpc_timer_set(call, delay, rxrpc_timer_trace_hard);
753: rxrpc_poke_call(call, rxrpc_call_poke_set_timeout);
754:
755: }
756: break;
757: }
758:
759: if (rxrpc_call_is_complete(call)) {
760: /* it's too late for this call */
761: ret = -ESHUTDOWN;
762: goto out_put_unlock;
763: }
764:
765: switch (p.command) {
766: case RXRPC_CMD_SEND_ABORT:
767: rxrpc_propose_abort(call, p.abort_code, -ECONNABORTED,
768: rxrpc_abort_call_sendmsg);
769: ret = 0;
770: break;
771: case RXRPC_CMD_SEND_DATA:
772: ret = rxrpc_send_data(rx, call, msg, len, NULL, &dropped_lock);
773: break;
774: default:
775: ret = -EINVAL;
776: break;
777: }
778:
779: out_put_unlock:
780: if (!dropped_lock)
781: mutex_unlock(&call->user_mutex);
782: error_put:
783: rxrpc_put_call(call, rxrpc_call_put_sendmsg);
784: _leave(" = %d", ret);
785: return ret;
786:
787: error_release_sock:
788: release_sock(&rx->sk);
789: return ret;
790: }
SourceFile:net/rxrpc/sendmsg.c]
|
| 84/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 67315
output: 36
thoughts: 447
Thoughts: **Analyzing the Hung Task Watchdog Trigger in AF_RXRPC Sockets and AFS Calls**
Okay, so I'm digging into this hung task issue and how it relates to our AF_RXRPC and AFS implementations. My initial observation is that with AF_RXRPC sockets, the interruptibility is set to `RXRPC_INTERRUPTIBLE`, and that's used in `rxrpc_wait_to_be_connected`, so that means the wait is `TASK_INTERRUPTIBLE`. Good, that means the hung task watchdog *won't* be triggered in that case, because it's only looking for `TASK_UNINTERRUPTIBLE` states. But, AFS calls are a different story. They use either `RXRPC_UNINTERRUPTIBLE` or, if `call->intr` is true, then `RXRPC_PREINTERRUPTIBLE`. Ah, `afs_make_call` is the culprit, setting the interruptibility based on `call->intr`. If we have `RXRPC_UNINTERRUPTIBLE`, `afs_wait_for_call_to_complete` uses `TASK_UNINTERRUPTIBLE`. That's where we could get the hung task watchdog triggered.
So, the key is whether an unprivileged user can trigger AFS calls. If AFS is mounted, yes. But is it mounted by default? No, thankfully. Can they mount AFS themselves? No, since `afs_fs_type` doesn't have `FS_USERNS_MOUNT`, so that's locked down. Thus, it seems this is only reachable if a system administrator has explicitly mounted AFS *and* the unprivileged user has access. That scenario seems pretty limited... Unless AFS is *never* mounted, then this bug is simply unreachable.
But wait, syzkaller triggered it! Right, syzkaller runs as root in the initial namespace, which means it *can* mount AFS. Okay, that makes sense. Is there another way to trigger AFS calls? What about `afs_mntpt_do_automount`? No, it requires an existing mount. What about `afs_proc_init`? Does it expose anything? It looks like there may be a `/proc/net/afs/...` interface there. Can unprivileged users write to that to cause calls? Let's check `afs_proc_init`. We need to be sure.
|
| 85/2 |
2026/08/14 00:10 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/proc.c Name:afs_proc_init]
Results: map[SourceCode: 732: /*
733: * initialise the /proc/fs/afs/ directory
734: */
735: int afs_proc_init(struct afs_net *net)
736: {
737: struct proc_dir_entry *p;
738:
739: _enter("");
740:
741: p = proc_net_mkdir(net->net, "afs", net->net->proc_net);
742: if (!p)
743: goto error_dir;
744:
745: if (!proc_create_net_data_write("cells", 0644, p,
746: &afs_proc_cells_ops,
747: afs_proc_cells_write,
748: sizeof(struct seq_net_private),
749: NULL) ||
750: !proc_create_net_single_write("rootcell", 0644, p,
751: afs_proc_rootcell_show,
752: afs_proc_rootcell_write,
753: NULL) ||
754: !proc_create_net("servers", 0444, p, &afs_proc_servers_ops,
755: sizeof(struct seq_net_private)) ||
756: !proc_create_net_single("stats", 0444, p, afs_proc_stats_show, NULL) ||
757: !proc_create_net_data_write("sysname", 0644, p,
758: &afs_proc_sysname_ops,
759: afs_proc_sysname_write,
760: sizeof(struct seq_net_private),
761: NULL) ||
762: !proc_create_net_single_write("addr_prefs", 0644, p,
763: afs_proc_addr_prefs_show,
764: afs_proc_addr_prefs_write,
765: NULL))
766: goto error_tree;
767:
768: net->proc_afs = p;
769: _leave(" = 0");
770: return 0;
771:
772: error_tree:
773: proc_remove(p);
774: error_dir:
775: _leave(" = -ENOMEM");
776: return -ENOMEM;
777: }
SourceFile:fs/afs/proc.c]
|
| 86/2 |
2026/08/14 00:10 |
llm |
expert |
0m
Model:
Tokens:
input: 69073
output: 38
thoughts: 150
Thoughts: **My Assessment of the AFS `/proc` Files**
Okay, so I'm looking at these `/proc/net/afs/` files, specifically `cells` and `rootcell`. The thing that immediately jumps out at me is that they're writable with permissions of 0644. On the surface, that seems like a standard setting; root can write, everyone else can read. But hold on a second... Who exactly *can* write to this thing?
The code creates these files using `proc_create_net_data_write`, so the permissions initially look normal. But I need to consider network namespaces. If an unprivileged user can create a new network namespace, then they *could* potentially gain root privileges within that namespace. And if they *can* be root in that new namespace, that would give them write access to `/proc/net/afs/cells`! That would be a huge vulnerability.
The next logical step is to see if writing to `/proc/net/afs/cells` actually triggers an AFS call. I need to understand what this writes to this file *does*, and if it can potentially be manipulated by a non-root user. This bears further investigation.
|
| 87/2 |
2026/08/14 00:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/proc.c Name:afs_proc_cells_write]
Results: map[SourceCode: 84: /*
85: * handle writes to /proc/fs/afs/cells
86: * - to add cells: echo "add <cellname> <IP>[:<IP>][:<IP>]"
87: */
88: static int afs_proc_cells_write(struct file *file, char *buf, size_t size)
89: {
90: struct seq_file *m = file->private_data;
91: struct afs_net *net = afs_seq2net(m);
92: char *name, *args;
93: int ret;
94:
95: /* trim to first NL */
96: name = memchr(buf, '\n', size);
97: if (name)
98: *name = 0;
99:
100: /* split into command, name and argslist */
101: name = strchr(buf, ' ');
102: if (!name)
103: goto inval;
104: do {
105: *name++ = 0;
106: } while(*name == ' ');
107: if (!*name)
108: goto inval;
109:
110: args = strchr(name, ' ');
111: if (args) {
112: do {
113: *args++ = 0;
114: } while(*args == ' ');
115: if (!*args)
116: goto inval;
117: }
118:
119: /* determine command to perform */
120: _debug("cmd=%s name=%s args=%s", buf, name, args);
121:
122: if (strcmp(buf, "add") == 0) {
123: struct afs_cell *cell;
124:
125: cell = afs_lookup_cell(net, name, strlen(name), args,
126: AFS_LOOKUP_CELL_PRELOAD,
127: afs_cell_trace_use_lookup_add);
128: if (IS_ERR(cell)) {
129: ret = PTR_ERR(cell);
130: goto done;
131: }
132:
133: if (test_and_set_bit(AFS_CELL_FL_NO_GC, &cell->flags))
134: afs_unuse_cell(cell, afs_cell_trace_unuse_no_pin);
135: } else {
136: goto inval;
137: }
138:
139: ret = 0;
140:
141: done:
142: _leave(" = %d", ret);
143: return ret;
144:
145: inval:
146: ret = -EINVAL;
147: printk("kAFS: Invalid Command on /proc/fs/afs/cells file\n");
148: goto done;
149: }
SourceFile:fs/afs/proc.c]
|
| 88/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 70434
output: 36
thoughts: 22
Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue:
**Investigating a Potentially Network-Bound Operation**
Alright, the code's calling `afs_lookup_cell`. Now, *that* function name sets off a little alarm bell in my head. AFS... definitely a distributed filesystem, likely built around a network architecture. So, the key question here is: does `afs_lookup_cell` *itself* initiate a network call, or is it merely a local function that might *eventually* trigger network activity further down the call stack? It's crucial to understand the immediate impact. If it directly makes a network request, that's a whole different performance profile than something that just consults local cache or metadata. Gotta dive into the implementation of `afs_lookup_cell` to see if it initiates a socket connection or just delegates to lower-level filesystem primitives. I need to figure out if this operation is going to be dominated by network latency or if there are other contributing factors.
|
| 89/2 |
2026/08/14 00:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/cell.c Name:afs_lookup_cell]
Results: map[SourceCode: 227: /*
228: * afs_lookup_cell - Look up or create a cell record.
229: * @net: The network namespace
230: * @name: The name of the cell.
231: * @namesz: The strlen of the cell name.
232: * @vllist: A colon/comma separated list of numeric IP addresses or NULL.
233: * @reason: The reason we're doing the lookup
234: * @trace: The reason to be logged if the lookup is successful.
235: *
236: * Look up a cell record by name and query the DNS for VL server addresses if
237: * needed. Note that that actual DNS query is punted off to the manager thread
238: * so that this function can return immediately if interrupted whilst allowing
239: * cell records to be shared even if not yet fully constructed.
240: */
241: struct afs_cell *afs_lookup_cell(struct afs_net *net,
242: const char *name, unsigned int namesz,
243: const char *vllist,
244: enum afs_lookup_cell_for reason,
245: enum afs_cell_trace trace)
246: {
247: struct afs_cell *cell, *candidate, *cursor;
248: struct rb_node *parent, **pp;
249: enum afs_cell_state state;
250: int ret, n;
251:
252: _enter("%s,%s,%u", name, vllist, reason);
253:
254: if (reason != AFS_LOOKUP_CELL_PRELOAD) {
255: cell = afs_find_cell(net, name, namesz, trace);
256: if (!IS_ERR(cell)) {
257: if (reason == AFS_LOOKUP_CELL_DYNROOT)
258: goto no_wait;
259: if (cell->state == AFS_CELL_SETTING_UP ||
260: cell->state == AFS_CELL_UNLOOKED)
261: goto lookup_cell;
262: goto wait_for_cell;
263: }
264: }
265:
266: /* Assume we're probably going to create a cell and preallocate and
267: * mostly set up a candidate record. We can then use this to stash the
268: * name, the net namespace and VL server addresses.
269: *
270: * We also want to do this before we hold any locks as it may involve
271: * upcalling to userspace to make DNS queries.
272: */
273: candidate = afs_alloc_cell(net, name, namesz, vllist);
274: if (IS_ERR(candidate)) {
275: _leave(" = %ld", PTR_ERR(candidate));
276: return candidate;
277: }
278:
279: /* Find the insertion point and check to see if someone else added a
280: * cell whilst we were allocating.
281: */
282: down_write(&net->cells_lock);
283:
284: pp = &net->cells.rb_node;
285: parent = NULL;
286: while (*pp) {
287: parent = *pp;
288: cursor = rb_entry(parent, struct afs_cell, net_node);
289:
290: n = strncasecmp(cursor->name, name,
291: min_t(size_t, cursor->name_len, namesz));
292: if (n == 0)
293: n = cursor->name_len - namesz;
294: if (n < 0)
295: pp = &(*pp)->rb_left;
296: else if (n > 0)
297: pp = &(*pp)->rb_right;
298: else
299: goto cell_already_exists;
300: }
301:
302: ret = idr_alloc_cyclic(&net->cells_dyn_ino, candidate,
303: 2, INT_MAX / 2, GFP_KERNEL);
304: if (ret < 0)
305: goto cant_alloc_ino;
306: candidate->dynroot_ino = ret;
307: set_bit(AFS_CELL_FL_HAVE_INO, &candidate->flags);
308:
309: cell = candidate;
310: candidate = NULL;
311: afs_use_cell(cell, trace);
312: rb_link_node_rcu(&cell->net_node, parent, pp);
313: rb_insert_color(&cell->net_node, &net->cells);
314: up_write(&net->cells_lock);
315:
316: lookup_cell:
317: if (reason != AFS_LOOKUP_CELL_PRELOAD &&
318: reason != AFS_LOOKUP_CELL_ROOTCELL) {
319: set_bit(AFS_CELL_FL_DO_LOOKUP, &cell->flags);
320: afs_queue_cell(cell, afs_cell_trace_queue_new);
321: }
322:
323: wait_for_cell:
324: state = smp_load_acquire(&cell->state); /* vs error */
325: switch (state) {
326: case AFS_CELL_ACTIVE:
327: case AFS_CELL_DEAD:
328: break;
329: case AFS_CELL_UNLOOKED:
330: default:
331: if (reason == AFS_LOOKUP_CELL_PRELOAD ||
332: reason == AFS_LOOKUP_CELL_ROOTCELL)
333: break;
334: _debug("wait_for_cell");
335: afs_see_cell(cell, afs_cell_trace_wait);
336: wait_var_event(&cell->state,
337: ({
338: state = smp_load_acquire(&cell->state); /* vs error */
339: state == AFS_CELL_ACTIVE || state == AFS_CELL_DEAD;
340: }));
341: _debug("waited_for_cell %d %d", cell->state, cell->error);
342: }
343:
344: no_wait:
345: /* Check the state obtained from the wait check. */
346: state = smp_load_acquire(&cell->state); /* vs error */
347: if (state == AFS_CELL_DEAD) {
348: ret = cell->error;
349: goto error;
350: }
351: if (state == AFS_CELL_ACTIVE) {
352: switch (cell->dns_status) {
353: case DNS_LOOKUP_NOT_DONE:
354: if (cell->dns_source == DNS_RECORD_FROM_CONFIG) {
355: ret = 0;
356: break;
357: }
358: fallthrough;
359: default:
360: ret = -EIO;
361: goto error;
362: case DNS_LOOKUP_GOOD:
363: case DNS_LOOKUP_GOOD_WITH_BAD:
364: ret = 0;
365: break;
366: case DNS_LOOKUP_GOT_NOT_FOUND:
367: ret = -ENOENT;
368: goto error;
369: case DNS_LOOKUP_BAD:
370: ret = -EREMOTEIO;
371: goto error;
372: case DNS_LOOKUP_GOT_LOCAL_FAILURE:
373: case DNS_LOOKUP_GOT_TEMP_FAILURE:
374: case DNS_LOOKUP_GOT_NS_FAILURE:
375: ret = -EDESTADDRREQ;
376: goto error;
377: }
378: }
379:
380: _leave(" = %p [cell]", cell);
381: return cell;
382:
383: cant_alloc_ino:
384: up_write(&net->cells_lock);
385: afs_put_cell(candidate, afs_cell_trace_put_candidate);
386: goto error_noput;
387:
388: cell_already_exists:
389: _debug("cell exists");
390: cell = cursor;
391: if (reason == AFS_LOOKUP_CELL_PRELOAD) {
392: ret = -EEXIST;
393: } else {
394: afs_use_cell(cursor, trace);
395: ret = 0;
396: }
397: up_write(&net->cells_lock);
398: if (candidate)
399: afs_put_cell(candidate, afs_cell_trace_put_candidate);
400: if (ret == 0)
401: goto wait_for_cell;
402: goto error_noput;
403: error:
404: afs_unuse_cell(cell, afs_cell_trace_unuse_lookup_error);
405: error_noput:
406: _leave(" = %d [error]", ret);
407: return ERR_PTR(ret);
408: }
SourceFile:fs/afs/cell.c]
|
| 90/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 73538
output: 39
thoughts: 94
Thoughts: Here's my understanding of the situation, tailored for my expert perspective:
**AFS Cell Lookup Behavior in `afs_proc_cells_write`**
Okay, so `afs_proc_cells_write` is calling `afs_lookup_cell`, and that makes sense, right? It's writing to the `/proc` filesystem, so it needs to ensure the cell information is available. The key seems to be this `reason = AFS_LOOKUP_CELL_PRELOAD`. I see that when `AFS_LOOKUP_CELL_PRELOAD` is passed in, we *don't* queue the cell for a full lookup. That's good, efficient. It skips the `afs_queue_cell` call. So, no direct network activity. We're being smart and avoiding unnecessary round-trips when preloading.
But wait a minute... that raises a question. How is the initial cell information populated if we're *not* triggering a network call in this specific path? Where does `/proc/net/afs/rootcell` come into play? Is it being pre-populated at an earlier stage, perhaps during mount time or system initialization? I need to dig into the initialization sequence to understand how that initial cell information is bootstrapped. It's a key point and might be related to other pre-emptive procedures. Gotta trace that back.
|
| 91/2 |
2026/08/14 00:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/proc.c Name:afs_proc_rootcell_write]
Results: map[SourceCode: 218: /*
219: * Set the current workstation cell and optionally supply its list of volume
220: * location servers.
221: *
222: * echo "cell.name:192.168.231.14" >/proc/fs/afs/rootcell
223: */
224: static int afs_proc_rootcell_write(struct file *file, char *buf, size_t size)
225: {
226: struct seq_file *m = file->private_data;
227: struct afs_net *net = afs_seq2net_single(m);
228: char *s;
229: int ret;
230:
231: ret = -EINVAL;
232: if (buf[0] == '.')
233: goto out;
234: if (memchr(buf, '/', size))
235: goto out;
236:
237: /* trim to first NL */
238: s = memchr(buf, '\n', size);
239: if (s)
240: *s = 0;
241:
242: /* determine command to perform */
243: _debug("rootcell=%s", buf);
244:
245: ret = -EEXIST;
246: inode_lock(file_inode(file));
247: if (!rcu_access_pointer(net->ws_cell))
248: ret = afs_cell_init(net, buf);
249: else
250: printk("busy\n");
251: inode_unlock(file_inode(file));
252:
253: out:
254: _leave(" = %d", ret);
255: return ret;
256: }
SourceFile:fs/afs/proc.c]
|
| 92/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 74532
output: 50
thoughts: 1794
Thoughts: **Analysis of the AFS Hung Task Vulnerability**
Okay, let's break this down. `afs_cell_init` calls `afs_lookup_cell` with `AFS_LOOKUP_CELL_ROOTCELL` but doesn't queue it for lookup, so writing to the `/proc/net/afs/...` interface isn't the direct trigger. The only real way to get things going is mounting AFS or accessing an existing AFS mount. Since unprivileged users can't mount AFS (no `FS_USERNS_MOUNT`), they can only get to the crux of the issue if AFS is already mounted.
If AFS *is* mounted, then an unprivileged user can trigger this and cause a hung task panic, which is a Denial of Service (DoS). Wait, if AFS is NOT mounted, they *can't* trigger it, that seems to make the issue less severe. We're assessing exploitability here, and usually that's based on whether it can be triggered by default, or commonly. If AFS isn't mounted, it's not triggerable. However, if the system is an AFS client, it *is* triggerable. Plus, syzkaller triggered it because it has `CAP_SYS_ADMIN` and can mount AFS.
So here's what I'm thinking:
- **Exploitable:** False (it's a hang, not memory corruption, though clearly still problematic).
- **Denial of Service:** True (hung task panic is a DoS).
- **Accessible From Unprivileged Processes:** False (requires AFS mount, which requires `CAP_SYS_ADMIN` in `init_user_ns`). But, if AFS IS mounted, an unprivileged user CAN trigger it, so is this wrong?
Hold on. The prompt specifically says "Determine if the bug can be reached from a typical (non-root) user process that does NOT have any special capabilities... Assume that user namespaces are not accessible". If we're looking at the bug, and it requires AFS to be mounted, we usually assume the filesystem is mounted when assessing how easy it is for an unprivileged user to trigger it *given* the filesystem is in use. However, the report is showing the hang happens during the *mount* process:
```
afs_wait_for_call_to_complete+0x3a3/0xb20 fs/afs/rxrpc.c:662
afs_vl_get_entry_by_name_u+0x3aa/0x6a0 fs/afs/vlclient.c:152
afs_vl_lookup_vldb fs/afs/volume.c:167 [inline]
afs_create_volume+0x1fe/0x1170 fs/afs/volume.c:204
afs_sample_volume fs/afs/vl_alias.c:30 [inline]
afs_do_cell_detect_alias fs/afs/vl_alias.c:295 [inline]
afs_cell_detect_alias+0x52a/0x1160 fs/afs/vl_alias.c:327
afs_validate_fc fs/afs/super.c:388 [inline]
afs_get_tree+0x245/0x12c0 fs/afs/super.c:555
```
This *specific* stack trace shows it's happening during the mount process. An unprivileged user can't trigger `afs_cell_detect_alias` because they cannot mount AFS.
Can they trigger `afs_wait_for_call_to_complete` in a similar way through other AFS operations? Yes, any AFS operation that makes an RPC call (like `afs_fs_fetch_data`, `afs_fs_fetch_status`) uses `afs_make_call` and `afs_wait_for_call_to_complete`. And if channels are exhausted that can cause a hang. However, `afs_wait_for_call_to_complete` is used for synchronous calls. So if they exhaust the channels, *their own* call will hang.
Is hanging your own task a DoS? Yes, if it hangs in `TASK_UNINTERRUPTIBLE`, it triggers the hung task watchdog, and that can panic the kernel if `kernel.hung_task_panic` is set. So yes, this is a DoS. But can they exhaust channels with just *one* thread? No, one thread can only make one synchronous call at a time. They need to make 17 threads to exhaust the
|
| 93/2 |
2026/08/14 00:11 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile:fs/afs/rxrpc.c IncludeSnippetLines:2 Name:intr SourceTreePrefix:fs/afs/]
Results: map[References:<nil> TruncatedOutput:false]
|
| 94/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 77422
output: 27
thoughts: 12
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Analyzing the Interrupt Handling Logic**
Okay, so I'm diving in. My initial hunch is that we need to zero in on where the `call->intr` flag gets set to `true`. This likely indicates the point in the code where an interrupt is being acknowledged or, at least, where the system is gearing up to handle one. We're probably looking at a critical section β maybe some sort of context switch mechanism or interrupt controller interaction. Knowing the exact context of this assignment, and the code paths that lead *to* it, is going to be key to understanding the interrupt handling flow. I'll need to trace back from this assignment to identify the calling functions and any relevant data structures involved. Let's see what we find.
|
| 95/2 |
2026/08/14 00:11 |
tool |
grepper |
0m
Error:
Args: map[Expression:intr = true PathPrefix:fs/afs/]
Results:
|
| 96/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 77648
output: 26
thoughts: 15
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Kernel Investigation: Initial Probe into AFS Filesystem Interactions**
Okay, so I'm starting a deeper dive into the filesystem code, specifically focusing on interactions with AFS. My immediate instinct is to pinpoint the relevant areas for analysis. "intr" is a good starting point, acting as a potential keyword that might be associated with interrupts or inter-process communication within the AFS subsystem or file system handling in general. It's a broad term but given my experience, it'll provide a decent starting set of results. I want to zero in on areas where AFS and the core filesystem handling intersect. I'm targeting the `fs/afs/` directory directly because that's where I would expect the AFS-specific code to reside and therefore likely where this interaction would occur. Let's see what the results of this search yield. This search strategy can be narrowed or broadened depending on the initial results.
|
| 97/2 |
2026/08/14 00:11 |
tool |
grepper |
0m
Error:
Args: map[Expression:\.intr PathPrefix:fs/afs/]
Results:
|
| 98/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 77911
output: 25
thoughts: 27
Thoughts: Here's my thought process, as requested:
**Deconstructing a `call->intr` Mystery**
Okay, hold on a second. I'm looking at this code, and I see this `call->intr` field, which I recognize as part of the `struct afs_call`. Now, my initial thought is, "What exactly is going on with this `call->intr` thing?" I've got to find out where this is actually being *set*. I need to trace back through the code and understand its lifecycle. Time to fire up the grep and start hunting down where this value is assigned, modified, or even initialized. I'm assuming it's probably set during some sort of call setup or interrupt handling, but let's not make any assumptions. Let the code tell me the story.
|
| 99/2 |
2026/08/14 00:11 |
tool |
grepper |
0m
Args: map[Expression:intr PathPrefix:fs/afs/]
Results: map[Output:fs/afs/fs_probe.c=238=int afs_fs_probe_fileserver(struct afs_net *net, struct afs_server *server,
--
fs/afs/fs_probe.c-313- */
fs/afs/fs_probe.c:314:int afs_wait_for_fs_probes(struct afs_operation *op, struct afs_server_state *states, bool intr)
fs/afs/fs_probe.c-315-{
--
fs/afs/fs_probe.c-340-
fs/afs/fs_probe.c:341: set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
fs/afs/fs_probe.c-342- for (i = 0; i < slist->nr_servers; i++) {
--
fs/afs/fs_probe.c=496=int afs_wait_for_one_fs_probe(struct afs_server *server, struct afs_endpoint_state *estate,
fs/afs/fs_probe.c:497: unsigned long exclude, bool is_intr)
fs/afs/fs_probe.c-498-{
--
fs/afs/fs_probe.c-507- prepare_to_wait_event(&server->probe_wq, &wait,
fs/afs/fs_probe.c:508: is_intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
fs/afs/fs_probe.c-509- if (timo == 0 ||
--
fs/afs/fs_probe.c-512- atomic_read(&estate->nr_probing) == 0 ||
fs/afs/fs_probe.c:513: (is_intr && signal_pending(current)))
fs/afs/fs_probe.c-514- break;
--
fs/afs/fs_probe.c-524- return 1;
fs/afs/fs_probe.c:525: if (is_intr && signal_pending(current))
fs/afs/fs_probe.c-526- return -ERESTARTSYS;
--
fs/afs/internal.h=128=struct afs_call {
--
fs/afs/internal.h-175- bool upgrade; /* T to request service upgrade */
fs/afs/internal.h:176: bool intr; /* T if interruptible */
fs/afs/internal.h-177- bool unmarshalling_error; /* T if an unmarshalling error occurred */
--
fs/afs/internal.h=1242=int afs_fs_probe_fileserver(struct afs_net *net, struct afs_server *server,
fs/afs/internal.h-1243- struct afs_addr_list *new_alist, struct key *key);
fs/afs/internal.h:1244:int afs_wait_for_fs_probes(struct afs_operation *op, struct afs_server_state *states, bool intr);
fs/afs/internal.h-1245-extern void afs_probe_fileserver(struct afs_net *, struct afs_server *);
--
fs/afs/internal.h=1247=int afs_wait_for_one_fs_probe(struct afs_server *server, struct afs_endpoint_state *estate,
fs/afs/internal.h:1248: unsigned long exclude, bool is_intr);
fs/afs/internal.h-1249-extern void afs_fs_probe_cleanup(struct afs_net *);
--
fs/afs/internal.h=1419=static inline void afs_make_op_call(struct afs_operation *op, struct afs_call *call,
--
fs/afs/internal.h-1427- call->key = op->key;
fs/afs/internal.h:1428: call->intr = !(op->flags & AFS_OPERATION_UNINTR);
fs/afs/internal.h-1429- call->peer = rxrpc_kernel_get_peer(alist->addrs[op->addr_index].peer);
--
fs/afs/rxrpc.c=345=void afs_make_call(struct afs_call *call, gfp_t gfp)
--
fs/afs/rxrpc.c-391- call->upgrade,
fs/afs/rxrpc.c:392: (call->intr ? RXRPC_PREINTERRUPTIBLE :
fs/afs/rxrpc.c-393- RXRPC_UNINTERRUPTIBLE),
--
fs/afs/server.c=542=static noinline bool afs_update_server_record(struct afs_operation *op,
--
fs/afs/server.c-566- has_addrs) {
fs/afs/server.c:567: _leave(" = t [intr]");
fs/afs/server.c-568- return true;
--
fs/afs/server.c=586=bool afs_check_server_record(struct afs_operation *op, struct afs_server *server,
--
fs/afs/server.c-619- afs_op_set_error(op, ret);
fs/afs/server.c:620: _leave(" = f [intr]");
fs/afs/server.c-621- return false;
]
|
| 100/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 79535
output: 45
thoughts: 80
Thoughts: Here's my analysis of that code snippet:
**Debugging a Potential AFS Interruption Issue**
Okay, so I'm looking at this AFS code, specifically the `afs_make_op_call` function. I see this line: `call->intr = !(op->flags & AFS_OPERATION_UNINTR);`. Essentially, it's determining whether the operation can be interrupted based on the `op->flags`. A bitwise AND and NOT, classic stuff. If the `AFS_OPERATION_UNINTR` flag isn't set, then `call->intr` gets set to true, meaning the operation *can* be interrupted.
However, the reported hang seems to be happening within `afs_vl_get_entry_by_name_u`. Now, the key question is whether or not `afs_vl_get_entry_by_name_u` is *respecting* or even *using* that `call->intr` flag. Does it check it before doing any long blocking calls? Or is it ignoring the interruption flag altogether? I need to figure out how `afs_vl_get_entry_by_name_u` interacts with that `call->intr` variable. That's the most likely path to where the problem lies.
|
| 101/2 |
2026/08/14 00:11 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:fs/afs/vlclient.c Name:afs_vl_get_entry_by_name_u]
Results: map[SourceCode: 106: /*
107: * Dispatch a get volume entry by name or ID operation (uuid variant). If the
108: * volname is a decimal number then it's a volume ID not a volume name.
109: */
110: struct afs_vldb_entry *afs_vl_get_entry_by_name_u(struct afs_vl_cursor *vc,
111: const char *volname,
112: int volnamesz)
113: {
114: struct afs_vldb_entry *entry;
115: struct afs_call *call;
116: struct afs_net *net = vc->cell->net;
117: size_t reqsz, padsz;
118: __be32 *bp;
119:
120: _enter("");
121:
122: padsz = (4 - (volnamesz & 3)) & 3;
123: reqsz = 8 + volnamesz + padsz;
124:
125: entry = kzalloc_obj(struct afs_vldb_entry);
126: if (!entry)
127: return ERR_PTR(-ENOMEM);
128:
129: call = afs_alloc_flat_call(net, &afs_RXVLGetEntryByNameU, reqsz,
130: sizeof(struct afs_uvldbentry__xdr));
131: if (!call) {
132: kfree(entry);
133: return ERR_PTR(-ENOMEM);
134: }
135:
136: call->key = vc->key;
137: call->ret_vldb = entry;
138: call->max_lifespan = AFS_VL_MAX_LIFESPAN;
139: call->peer = rxrpc_kernel_get_peer(vc->alist->addrs[vc->addr_index].peer);
140: call->service_id = vc->server->service_id;
141:
142: /* Marshall the parameters */
143: bp = call->request;
144: *bp++ = htonl(VLGETENTRYBYNAMEU);
145: *bp++ = htonl(volnamesz);
146: memcpy(bp, volname, volnamesz);
147: if (padsz > 0)
148: memset((void *)bp + volnamesz, 0, padsz);
149:
150: trace_afs_make_vl_call(call);
151: afs_make_call(call, GFP_KERNEL);
152: afs_wait_for_call_to_complete(call);
153: vc->call_abort_code = call->abort_code;
154: vc->call_error = call->error;
155: vc->call_responded = call->responded;
156: afs_put_call(call);
157: if (vc->call_error) {
158: kfree(entry);
159: return ERR_PTR(vc->call_error);
160: }
161: return entry;
162: }
SourceFile:fs/afs/vlclient.c]
|
| 102/2 |
2026/08/14 00:11 |
llm |
expert |
0m
Model:
Tokens:
input: 80889
output: 28
thoughts: 849
Thoughts: **My Analysis of the AFS Hung Task Bug**
Okay, so here's what I've figured out. The critical thing here is that `call->intr` isn't set when `afs_vl_get_entry_by_name_u` makes a call. Since the call is allocated with `kzalloc`, `call->intr` defaults to false. This means it uses `RXRPC_UNINTERRUPTIBLE`, and `afs_wait_for_call_to_complete` ends up using `TASK_UNINTERRUPTIBLE`. That's the core of the problem. This means that a call to this function will trigger the hung task watchdog if it doesn't complete.
Here's how it unfolds: `afs_vl_get_entry_by_name_u` makes a call where it is uninterruptible, it then gets queued in `bundle->waiting_calls` because the channels are all busy. The timer for the queued call doesn't start. The active calls timeout after 120s, and then the queued call is activated, and *its* timer starts (another 120s). The call then hangs for a total of 240s, while the watchdog triggers at 143s. We have a DoS.
The question then becomes: can an unprivileged user trigger this? I need to figure out how `afs_vl_get_entry_by_name_u` is called. It's called in a whole bunch of places that boil down to mounting AFS, accessing volumes. An unprivileged user can't mount AFS directly, but can they do it via automount? That seems possible if an AFS mountpoint exists. Even better, they can trigger it by accessing volumes that aren't yet cached, and accessing many volumes on an existing mount.
If the VL server is slow, they can exhaust the channels, causing the hanging task. Therefore, while AFS is mounted, an unprivileged user *could* trigger this DoS, but because AFS is not mounted by default, and cannot be mounted by unprivileged users, this exploit is not accessible to unprivileged processes in a default configuration.
So my assessment will be:
- Exploitable: False
- DenialOfService: True
- Unprivileged: False
- UserNamespace: False
- VMGuestTrigger: False
- VMHostTrigger: False
- NetworkTrigger: True
- RemoteTrigger: False
- PeripheralTrigger: False
- FilesystemTrigger: False
But hold on... What if the bug is in rxrpc itself and can be triggered via AF_RXRPC sockets? I checked `rxrpc_do_sendmsg`, and it uses `RXRPC_INTERRUPTIBLE` for AF_RXRPC sockets, which means `rxrpc_wait_to_be_connected` is `TASK_INTERRUPTIBLE`. It won't trigger the hung task watchdog. So the watchdog can *only* be triggered by kernel users of rxrpc that use `RXRPC_UNINTERRUPTIBLE`, and AFS is the only one. Since AFS requires `CAP_SYS_ADMIN` to mount, it's not accessible to unprivileged users. I should check other users of rxrpc though, just in case.
|
| 103/2 |
2026/08/14 00:12 |
tool |
grepper |
0m
Args: map[Expression:rxrpc_kernel_begin_call PathPrefix:]
Results: map[Output:Documentation/networking/rxrpc.rst=795=The kernel interface functions are as follows:
--
Documentation/networking/rxrpc.rst-799- struct rxrpc_call *
Documentation/networking/rxrpc.rst:800: rxrpc_kernel_begin_call(struct socket *sock,
Documentation/networking/rxrpc.rst-801- struct sockaddr_rxrpc *srx,
--
Documentation/networking/rxrpc.rst-989- This is used to accept an incoming call and to assign it a call ID. This
Documentation/networking/rxrpc.rst:990: function is similar to rxrpc_kernel_begin_call() and calls accepted must
Documentation/networking/rxrpc.rst-991- be ended in the same way.
--
fs/afs/rxrpc.c=345=void afs_make_call(struct afs_call *call, gfp_t gfp)
--
fs/afs/rxrpc.c-381- /* create a call */
fs/afs/rxrpc.c:382: rxcall = rxrpc_kernel_begin_call(call->net->socket, call->peer, call->key,
fs/afs/rxrpc.c-383- (unsigned long)call,
--
include/net/af_rxrpc.h=53=void rxrpc_kernel_set_notifications(struct socket *sock,
include/net/af_rxrpc.h-54- const struct rxrpc_kernel_ops *app_ops);
include/net/af_rxrpc.h:55:struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
include/net/af_rxrpc.h-56- struct rxrpc_peer *peer,
--
net/rxrpc/af_rxrpc.c=314=EXPORT_SYMBOL(rxrpc_kernel_put_peer);
--
net/rxrpc/af_rxrpc.c-316-/**
net/rxrpc/af_rxrpc.c:317: * rxrpc_kernel_begin_call - Allow a kernel service to begin a call
net/rxrpc/af_rxrpc.c-318- * @sock: The socket on which to make the call
--
net/rxrpc/af_rxrpc.c-339- */
net/rxrpc/af_rxrpc.c:340:struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
net/rxrpc/af_rxrpc.c-341- struct rxrpc_peer *peer,
--
net/rxrpc/af_rxrpc.c-394-}
net/rxrpc/af_rxrpc.c:395:EXPORT_SYMBOL(rxrpc_kernel_begin_call);
net/rxrpc/af_rxrpc.c-396-
]
|
| 104/2 |
2026/08/14 00:12 |
llm |
expert |
0m
Model:
Tokens:
input: 83180
output: 66
thoughts: 345
Thoughts: **My Assessment and Conclusion**
Okay, so AFS is the sole user here, which keeps things straightforward. The assessment is solid. Let's run through these questions one more time to ensure I haven't missed anything.
* Exploitable: False, it's a denial-of-service, a hung task, nothing more.
* DenialOfService: True, absolutely.
* Unprivileged: False. It requires an AFS mount, so no go.
* UserNamespace: False, AFS won't play in userns.
* VMGuestTrigger: False.
* VMHostTrigger: False.
* NetworkTrigger: True. A malicious or sluggish AFS server *could* be the catalyst.
* RemoteTrigger: False.
* PeripheralTrigger: False.
* FilesystemTrigger: False... wait, hold on. This seems like it should be true given AFS is mounted.
Hmm, this is triggered when mounting AFS. But AFS is network, not local, yeah, but does it really fall under FilesystemTrigger? The trigger is the network server, not a local filesystem image. So, no, `FilesystemTrigger` is still False. It's a network mount.
Let's double-check the `afs_fs_type` struct definition just to be extra sure... yep.
```c
struct file_system_type afs_fs_type = {
.owner = THIS_MODULE,
.name = "afs",
.init_fs_context = afs_init_fs_context,
.parameters = afs_fs_parameters,
.kill_sb = afs_kill_super,
.fs_flags = FS_RENAME_DOES_D_MOVE,
};
```
No `FS_USERNS_MOUNT` flag in there, so unprivileged users are out of luck for mounting it. That confirms it.
Now, I'm ready. I'll call `set-results` and craft the final response.
|
| 105/2 |
2026/08/14 00:12 |
tool |
set-results |
0m
Args: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:true PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:true PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 106/2 |
2026/08/14 00:12 |
llm |
expert |
0m
Model:
Tokens:
input: 84113
output: 792
thoughts: 428
Thoughts: **Final Response: Bug Summary and Analysis**
Okay, the results are in. Time to solidify my findings into the final response.
Let's see, the crux of the issue boils down to a hung task timeout specifically within `afs_wait_for_call_to_complete`. My analysis reveals an interesting interaction between the AFS client and the `rxrpc` subsystem. It seems the problem centers on how `rxrpc` handles channel allocation within a bundle, specifically when all 16 channels are exhausted.
Hereβs the breakdown. When a bundle hits its channel capacity, new calls get queued in `bundle->waiting_calls`. The really problematic part, and this is key, is that the timeout timer for these queued calls *isn't* kicked off immediately. It waits until a channel becomes available and the call is assigned.
Now, if we have a slow or, heaven forbid, a *malicious* server that's dragging its heels on responding, all the active calls will eventually time out, say after the usual 120 seconds. Once those active calls are dead, the queued calls are finally assigned channels, and *then* their timers start. That's where we get the delay. They've already been waiting on the bundle! And the timers kick in after that. And now we have a double timeout, a 240-second window.
This extended wait time is the killer. Because `afs_wait_for_call_to_complete` is waiting in `TASK_UNINTERRUPTIBLE` state, this delay exceeds the hung task watchdog timeout, which is typically around 120 or 143 seconds. Boom, kernel panic if `kernel.hung_task_panic` is enabled, or a nasty persistent hang otherwise.
From a security standpoint, this is a Denial of Service. It's not exploitable for memory corruption or information leaks, which is good. But it certainly triggers the hung task watchdog, which is bad for system stability.
As for privileges, it's not directly accessible to unprivileged users or within UserNamespaces. The bug is in the AFS client, and because AFS doesn't have the `FS_USERNS_MOUNT` flag, unprivileged users can't mount it, even in a user namespace. `CAP_SYS_ADMIN` in the initial namespace is needed for a mount. While a non-privileged user can trigger this if an administrator is already running AFS, this bug doesn't appear in a default kernel configuration.
The kicker is that the trigger is network-based. A malicious or simply unresponsive AFS server can deliberately hold active calls, causing the client to queue subsequent calls and ultimately trigger this watchdog. My understanding is that, without a response, we should have a kill timer ready and waiting.
|
| 107/1 |
2026/08/14 00:12 |
action |
format-explanation |
0m
Results: map[Explanation:**Analysis of the Bug**
The bug report indicates a hung task timeout (task blocked for more than 143
seconds) in `afs_wait_for_call_to_complete()`. The stack trace shows that the
kernel is attempting to mount an AFS (Andrew File System) volume and is waiting
for a synchronous RxRPC network call to complete (`afs_vl_get_entry_by_name_u`).
**Root Cause:**
The hang is caused by a design flaw in the `rxrpc` subsystem's channel
allocation and timeout handling.
When an AFS client makes an RPC call, `rxrpc` assigns it to a connection bundle.
A bundle can have a maximum of 4 connections, each with 4 channels, allowing up
to 16 concurrent active calls to the same server. If the client makes a 17th
concurrent call, `rxrpc` queues it in `bundle->waiting_calls` because there are
no available channels.
Crucially, the timeout timer for a call (`call->hard_timo`) is **not started**
while the call is sitting in the `waiting_calls` queue. It is only started once
a channel becomes available and the call is activated.
If the AFS server is slow or malicious and drops packets, the first 16 active
calls will eventually time out (e.g., after `AFS_VL_MAX_LIFESPAN` which is 120
seconds). Once they time out, the channels are freed, and the 17th queued call
is activated. Its timer is then started for another 120 seconds.
As a result, the 17th call will wait for 120s (in the queue) + 120s (active) =
240 seconds. Because `afs_wait_for_call_to_complete()` waits in the
`TASK_UNINTERRUPTIBLE` state, this 240-second wait exceeds the kernel's hung
task watchdog timeout (typically 120 or 143 seconds), triggering the hung task
warning and potentially a kernel panic (if `kernel.hung_task_panic` is enabled).
**Security Impact Assessment:**
* **Exploitable:** **False**. This is a pure Denial of Service (DoS) issue
caused by a delayed timeout. There is no memory corruption, use-after-free, or
information leak involved.
* **Denial Of Service:** **True**. The bug causes tasks to hang in
`TASK_UNINTERRUPTIBLE` indefinitely (or long enough to trigger the hung task
watchdog), which can lead to a system crash if `hung_task_panic` is enabled, or
resource exhaustion.
* **Accessible From Unprivileged Processes & User Namespaces:** **False**. The
bug is located in the AFS filesystem client. The `afs` filesystem type does not
have the `FS_USERNS_MOUNT` flag, meaning it cannot be mounted by unprivileged
users, even within a user namespace. It strictly requires `CAP_SYS_ADMIN` in the
initial network/user namespace. While an unprivileged user could theoretically
trigger this DoS by accessing files on an *already mounted* AFS share, the bug
is unreachable in a default, unconfigured system.
* **Network Trigger:** **True**. A malicious or unresponsive AFS server can
intentionally ignore requests to exhaust the client's RxRPC channels, forcing
subsequent calls into the waiting queue and triggering the hung task watchdog on
the client.
* **Filesystem Trigger:** **False**. Although the bug is triggered during a
`mount()` syscall, the root cause is a network timeout issue with the remote
server, not the parsing of a malicious local filesystem image.]
|