| 0/0 |
2026/05/14 00:50 |
flow |
assessment-security |
37m
Results: map[DenialOfService:true Explanation:Based on the analysis of the kernel bug report and the source code, here is the
assessment of the bug:
### Root Cause Analysis
The RCU stall is caused by a long-running loop inside
`addrconf_permanent_addr()` that executes while holding a spinlock with softirqs
disabled (`write_lock_bh(&idev->lock)`).
When an interface is brought up, it triggers a `NETDEV_UP` event, which is
handled by `addrconf_notify()`. This function calls `addrconf_permanent_addr()`
to restore routes for permanent IPv6 addresses.
`addrconf_permanent_addr()` iterates over all addresses in `idev->addr_list`.
For each permanent address, it calls `fixup_permanent_addr()`, which in turn
allocates a new `fib6_info` route and per-CPU memory for the nexthop
(`alloc_percpu_gfp()`). Because this is done under a spinlock, the allocations
are performed with `GFP_ATOMIC`.
The kernel does not impose a limit on the number of manually configured IPv6
addresses an interface can have (the `max_addresses` sysctl only applies to
autoconfigured addresses). If an interface has a massive number of IPv6
addresses, the loop in `addrconf_permanent_addr()` will run for a very long
time, performing hundreds of thousands of atomic memory allocations without ever
dropping the spinlock. This completely blocks the CPU and prevents softirqs from
running, leading to the observed RCU stall and potential atomic memory
allocation failures.
### Security Impact
* **Denial of Service (DoS):** Yes. Triggering this bug causes a severe RCU
stall, which can lead to a system hang or a kernel panic (if
`panic_on_rcu_stall` is enabled). It can also exhaust atomic memory pools.
* **Exploitable:** No. The bug is a pure CPU stall/resource exhaustion issue.
There is no memory corruption, use-after-free, or out-of-bounds access involved
that could be leveraged for privilege escalation.
* **Accessible From Unprivileged Processes:** No. Adding IPv6 addresses to an
interface requires `CAP_NET_ADMIN` capabilities.
* **Accessible From User Namespaces:** Yes. An unprivileged user can create a
new user namespace and a network namespace. Within this isolated network
namespace, the user gains `CAP_NET_ADMIN`. They can then create a dummy
interface, add millions of IPv6 addresses to it using `RTM_NEWADDR` netlink
messages, and finally bring the interface up (`RTM_NEWLINK` with `IFF_UP`). This
sequence will reliably trigger the RCU stall on the host kernel.
### Conclusion
This is a Denial of Service (DoS) vulnerability that can be triggered by an
unprivileged local user by leveraging user and network namespaces. It is not
exploitable for code execution or privilege escalation. Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:true VMGuestTrigger:false VMHostTrigger:false]
|
| 1/1 |
2026/05/14 00:50 |
action |
syz-repro-to-c-repro |
0m
Results: map[SimplifiedCRepro:// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#define BITMASK(bf_off,bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
#define STORE_BY_BITMASK(type,htobe,addr,val,bf_off,bf_len) *(type*)(addr) = htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))
uint64_t r[3] = {0xffffffffffffffff, 0x0, 0xffffffffffffffff};
int main(void)
{
syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
const char* reason;
(void)reason;
intptr_t res = 0;
if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
// socket arguments: [
// domain: socket_domain = 0x11 (8 bytes)
// type: socket_type = 0x800000003 (8 bytes)
// proto: int32 = 0x0 (4 bytes)
// ]
// returns sock
res = syscall(__NR_socket, /*domain=AF_PACKET*/0x11ul, /*type=SOCK_RAW|0x800000000*/0x800000003ul, /*proto=*/0);
if (res != -1)
r[0] = res;
// ioctl$ifreq_SIOCGIFINDEX_team arguments: [
// fd: sock (resource)
// cmd: const = 0x8933 (4 bytes)
// arg: ptr[out, ifreq_dev_t["team0", ifindex_team]] {
// ifreq_dev_t["team0", ifindex_team] {
// ifr_ifrn: buffer: {74 65 61 6d 30 00 00 00 00 00 00 00 00 00 00 00} (length 0x10)
// elem: ifindex_team (resource)
// pad = 0x0 (20 bytes)
// }
// }
// ]
memcpy((void*)0x200000000600, "team0\000\000\000\000\000\000\000\000\000\000\000", 16);
res = syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x8933, /*arg=*/0x200000000600ul);
if (res != -1)
r[1] = *(uint32_t*)0x200000000610;
// socket$netlink arguments: [
// domain: const = 0x10 (8 bytes)
// type: const = 0x3 (8 bytes)
// proto: netlink_proto = 0x0 (4 bytes)
// ]
// returns sock_netlink
res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0);
if (res != -1)
r[2] = res;
// sendmsg$nl_route_sched arguments: [
// fd: sock_nl_route (resource)
// msg: ptr[in, msghdr_netlink[netlink_msg_route_sched]] {
// msghdr_netlink[netlink_msg_route_sched] {
// addr: nil
// addrlen: len = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// vec: ptr[in, iovec[in, netlink_msg_route_sched]] {
// iovec[in, netlink_msg_route_sched] {
// addr: ptr[in, netlink_msg_route_sched] {
// union netlink_msg_route_sched {
// newqdisc: netlink_msg_t[const[RTM_NEWQDISC, int16], tcmsg[AF_UNSPEC], rtm_tca_policy] {
// len: len = 0xac (4 bytes)
// type: const = 0x24 (2 bytes)
// flags: netlink_msg_flags = 0xf0b (2 bytes)
// seq: int32 = 0x0 (4 bytes)
// pid: int32 = 0x0 (4 bytes)
// payload: tcmsg[AF_UNSPEC] {
// family: const = 0x0 (1 bytes)
// tcm__pad1: const = 0x0 (1 bytes)
// tcm__pad2: const = 0x12 (2 bytes)
// ifindex: ifindex (resource)
// tcm_handle: tcm_handle {
// minor: tcm_handle_offsets = 0x0 (2 bytes)
// major: tcm_handle_offsets = 0x0 (2 bytes)
// }
// tcm_parent: tcm_handle {
// minor: tcm_handle_offsets = 0xffff (2 bytes)
// major: tcm_handle_offsets = 0xffff (2 bytes)
// }
// tcm_info: tcm_handle {
// minor: tcm_handle_offsets = 0x0 (2 bytes)
// major: tcm_handle_offsets = 0x0 (2 bytes)
// }
// }
// attrs: array[rtm_tca_policy] {
// union rtm_tca_policy {
// qdisc_kind_options: union qdisc_kind_options {
// q_taprio: tca_kind_options_t["taprio", array[taprio_policy]] {
// TCA_KIND: nlattr_t[const[TCA_KIND, int16], string["taprio"]] {
// nla_len: offsetof = 0xb (2 bytes)
// nla_type: const = 0x1 (2 bytes)
// payload: buffer: {74 61 70 72 69 6f 00} (length 0x7)
// size: buffer: {} (length 0x0)
// pad = 0x0 (1 bytes)
// }
// TCA_OPTIONS: nlattr_t[const[TCA_OPTIONS, int16], array[taprio_policy]] {
// nla_len: offsetof = 0x7c (2 bytes)
// nla_type: const = 0x2 (2 bytes)
// payload: array[taprio_policy] {
// union taprio_policy {
// TCA_TAPRIO_ATTR_PRIOMAP: nlattr_t[const[TCA_TAPRIO_ATTR_PRIOMAP, int16], tc_mqprio_qopt] {
// nla_len: offsetof = 0x56 (2 bytes)
// nla_type: const = 0x1 (2 bytes)
// payload: tc_mqprio_qopt {
// num_tc: int8 = 0x2 (1 bytes)
// prio_tc_map: array[int8] {
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x1 (1 bytes)
// }
// hw: int8 = 0x0 (1 bytes)
// count: array[int16] {
// int16 = 0x8 (2 bytes)
// int16 = 0x5 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0xfffc (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// }
// offset: array[int16] {
// int16 = 0x0 (2 bytes)
// int16 = 0x8 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0xffff (2 bytes)
// int16 = 0x8 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// }
// }
// size: buffer: {} (length 0x0)
// pad = 0x0 (2 bytes)
// }
// }
// union taprio_policy {
// TCA_TAPRIO_ATTR_SCHED_CLOCKID: nlattr_t[const[TCA_TAPRIO_ATTR_SCHED_CLOCKID, int16], int32] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0x5 (2 bytes)
// payload: int32 = 0x0 (4 bytes)
// size: buffer: {} (length 0x0)
// }
// }
// union taprio_policy {
// TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST: nlattr_tt[const[TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST, int16:14], 0, 1, array[nlnest[TCA_TAPRIO_SCHED_ENTRY, array[entry_policy$taprio]]]] {
// nla_len: offsetof = 0x18 (2 bytes)
// nla_type: const = 0x2 (1 bytes)
// NLA_F_NET_BYTEORDER: const = 0x0 (0 bytes)
// NLA_F_NESTED: const = 0x1 (1 bytes)
// payload: array[nlattr_tt[const[TCA_TAPRIO_SCHED_ENTRY, int16:14], 0, 1, array[entry_policy$taprio]]] {
// nlattr_tt[const[TCA_TAPRIO_SCHED_ENTRY, int16:14], 0, 1, array[entry_policy$taprio]] {
// nla_len: offsetof = 0x14 (2 bytes)
// nla_type: const = 0x1 (1 bytes)
// NLA_F_NET_BYTEORDER: const = 0x0 (0 bytes)
// NLA_F_NESTED: const = 0x1 (1 bytes)
// payload: array[entry_policy$taprio] {
// union entry_policy$taprio {
// TCA_TAPRIO_SCHED_ENTRY_GATE_MASK: nlattr_t[const[TCA_TAPRIO_SCHED_ENTRY_GATE_MASK, int16], int32] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0x3 (2 bytes)
// payload: int32 = 0x6 (4 bytes)
// size: buffer: {} (length 0x0)
// }
// }
// union entry_policy$taprio {
// TCA_TAPRIO_SCHED_ENTRY_INTERVAL: nlattr_t[const[TCA_TAPRIO_SCHED_ENTRY_INTERVAL, int16], int32] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0x4 (2 bytes)
// payload: int32 = 0xff (4 bytes)
// size: buffer: {} (length 0x0)
// }
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// }
// }
// }
// }
// }
// }
// len: len = 0xac (8 bytes)
// }
// }
// vlen: const = 0x1 (8 bytes)
// ctrl: const = 0x0 (8 bytes)
// ctrllen: const = 0x0 (8 bytes)
// f: send_flags = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// }
// f: send_flags = 0x0 (8 bytes)
// ]
*(uint64_t*)0x2000000007c0 = 0;
*(uint32_t*)0x2000000007c8 = 0;
*(uint64_t*)0x2000000007d0 = 0x200000000780;
*(uint64_t*)0x200000000780 = 0x200000000240;
*(uint32_t*)0x200000000240 = 0xac;
*(uint16_t*)0x200000000244 = 0x24;
*(uint16_t*)0x200000000246 = 0xf0b;
*(uint32_t*)0x200000000248 = 0;
*(uint32_t*)0x20000000024c = 0;
*(uint8_t*)0x200000000250 = 0;
*(uint8_t*)0x200000000251 = 0;
*(uint16_t*)0x200000000252 = 0x12;
*(uint32_t*)0x200000000254 = r[1];
*(uint16_t*)0x200000000258 = 0;
*(uint16_t*)0x20000000025a = 0;
*(uint16_t*)0x20000000025c = -1;
*(uint16_t*)0x20000000025e = -1;
*(uint16_t*)0x200000000260 = 0;
*(uint16_t*)0x200000000262 = 0;
*(uint16_t*)0x200000000264 = 0xb;
*(uint16_t*)0x200000000266 = 1;
memcpy((void*)0x200000000268, "taprio\000", 7);
*(uint16_t*)0x200000000270 = 0x7c;
*(uint16_t*)0x200000000272 = 2;
*(uint16_t*)0x200000000274 = 0x56;
*(uint16_t*)0x200000000276 = 1;
*(uint8_t*)0x200000000278 = 2;
*(uint8_t*)0x200000000279 = 0;
*(uint8_t*)0x20000000027a = 0;
*(uint8_t*)0x20000000027b = 0;
*(uint8_t*)0x20000000027c = 0;
*(uint8_t*)0x20000000027d = 0;
*(uint8_t*)0x20000000027e = 0;
*(uint8_t*)0x20000000027f = 0;
*(uint8_t*)0x200000000280 = 0;
*(uint8_t*)0x200000000281 = 0;
*(uint8_t*)0x200000000282 = 0;
*(uint8_t*)0x200000000283 = 0;
*(uint8_t*)0x200000000284 = 0;
*(uint8_t*)0x200000000285 = 0;
*(uint8_t*)0x200000000286 = 0;
*(uint8_t*)0x200000000287 = 0;
*(uint8_t*)0x200000000288 = 1;
*(uint8_t*)0x200000000289 = 0;
*(uint16_t*)0x20000000028a = 8;
*(uint16_t*)0x20000000028c = 5;
*(uint16_t*)0x20000000028e = 0;
*(uint16_t*)0x200000000290 = 0;
*(uint16_t*)0x200000000292 = 0;
*(uint16_t*)0x200000000294 = 0xfffc;
*(uint16_t*)0x200000000296 = 0;
*(uint16_t*)0x200000000298 = 0;
*(uint16_t*)0x20000000029a = 0;
*(uint16_t*)0x20000000029c = 0;
*(uint16_t*)0x20000000029e = 0;
*(uint16_t*)0x2000000002a0 = 0;
*(uint16_t*)0x2000000002a2 = 0;
*(uint16_t*)0x2000000002a4 = 0;
*(uint16_t*)0x2000000002a6 = 0;
*(uint16_t*)0x2000000002a8 = 0;
*(uint16_t*)0x2000000002aa = 0;
*(uint16_t*)0x2000000002ac = 8;
*(uint16_t*)0x2000000002ae = 0;
*(uint16_t*)0x2000000002b0 = 0;
*(uint16_t*)0x2000000002b2 = 0;
*(uint16_t*)0x2000000002b4 = 0;
*(uint16_t*)0x2000000002b6 = 0;
*(uint16_t*)0x2000000002b8 = 0;
*(uint16_t*)0x2000000002ba = -1;
*(uint16_t*)0x2000000002bc = 8;
*(uint16_t*)0x2000000002be = 0;
*(uint16_t*)0x2000000002c0 = 0;
*(uint16_t*)0x2000000002c2 = 0;
*(uint16_t*)0x2000000002c4 = 0;
*(uint16_t*)0x2000000002c6 = 0;
*(uint16_t*)0x2000000002c8 = 0;
*(uint16_t*)0x2000000002cc = 8;
*(uint16_t*)0x2000000002ce = 5;
*(uint32_t*)0x2000000002d0 = 0;
*(uint16_t*)0x2000000002d4 = 0x18;
STORE_BY_BITMASK(uint16_t, , 0x2000000002d6, 2, 0, 14);
STORE_BY_BITMASK(uint16_t, , 0x2000000002d7, 0, 6, 1);
STORE_BY_BITMASK(uint16_t, , 0x2000000002d7, 1, 7, 1);
*(uint16_t*)0x2000000002d8 = 0x14;
STORE_BY_BITMASK(uint16_t, , 0x2000000002da, 1, 0, 14);
STORE_BY_BITMASK(uint16_t, , 0x2000000002db, 0, 6, 1);
STORE_BY_BITMASK(uint16_t, , 0x2000000002db, 1, 7, 1);
*(uint16_t*)0x2000000002dc = 8;
*(uint16_t*)0x2000000002de = 3;
*(uint32_t*)0x2000000002e0 = 6;
*(uint16_t*)0x2000000002e4 = 8;
*(uint16_t*)0x2000000002e6 = 4;
*(uint32_t*)0x2000000002e8 = 0xff;
*(uint64_t*)0x200000000788 = 0xac;
*(uint64_t*)0x2000000007d8 = 1;
*(uint64_t*)0x2000000007e0 = 0;
*(uint64_t*)0x2000000007e8 = 0;
*(uint32_t*)0x2000000007f0 = 0;
syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x2000000007c0ul, /*f=*/0ul);
return 0;
}
]
|
| 2/1 |
2026/05/14 00:50 |
action |
kernel-checkouter |
1m
Results: map[KernelSrc:/app/workdir/cache/src/9631da0f795e153231392ac4bdc5d697abd9e74d]
|
| 3/1 |
2026/05/14 00:51 |
action |
kernel-builder |
14m
Results: map[KernelObj:/app/workdir/cache/build/5da2d8ef52aa6a50f6876d7702c0b6b87e8b7b06]
|
| 4/1 |
2026/05/14 01:06 |
action |
codesearch-prepare |
10m
Results: map[Index:codesearch-index]
|
| 5/1 |
2026/05/14 01:17 |
agent |
expert |
10m
Model:
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:true VMGuestTrigger:false VMHostTrigger:false]
Instruction:
You are an experienced Linux kernel security engineer. Your task is to analyze given kernel bug report
and determine its security impact based on the following dimensions.
Use the provided tools to examine the source code, check for capability checks (e.g., capable(), ns_capable()),
and understand the nature of the bug. Analyze the given kernel build and configuration.
You can check the kernel config by grepping ".config" file; you can check kernel cmdline by greeping
".config" file for "CONFIG_CMDLINE=". Assume sysctl parameters have default values.
But analyze for the corresponding production build w/o debugging tools enabled (like KASAN, KMSAN, UBSAN).
Don't make assumptions; verify them with source code access. Try different strategies when analyzing the bug:
- think of ways in which the vulnerable code is unreachable
- or the other way around: try to come up with different ideas of how an unprivileged user can reach the bug
If still unsure err on the side of the bug being non-exploitable/not-accessible.
In the final reply, provide a reasoning for your assessment.
Analysis dimensions:
* Exploitable:
Determine if the bug can result in memory corruption or elevated privileges.
Memory safety issues are almost always exploitable (KASAN or UBSAN reports for use-after-free, out-of-bounds;
refcounting issues, corrupted lists, etc). When kernel is crashing on a completly wild pointer access
(e.g. user-space address, or non-canonical address, but not on NULL or address corresponding to KASAN shadow
for NULL address), including both data accesses and control tranfers, that's also usually implies possibility
of exploitation. Such reports usually say "unable to handle kernel paging request".
Uses of uninitialized values detected by KMSAN may be exploitable b/c attacker frequently can affect uninit
values with spraying techniques. However, for these exploitabability depends on how exactly the uninit value
is used in the code, and what it affects.
Think of what happens after the bug is triggered. Some bugs cause kernel panic and halt execution,
they are harder to exploit. For example, BUG reports halts the kernel. However, WARNING reports don't halt
execution in production builds. Debug bug detection tools (like KASAN, KMSAN, KCSAN, UBSAN) are also not enabled
in production builds, so attacker can freely exploit these bugs w/o being detected by these tools.
If you see an integer overflow, think how the overflowed value used later (if it's used as allocation size,
or an array index). If you see an out-of-bounds read, think if it's followed by an out-of-bounds write as well.
Some KCSAN data-races may be exploitable by skilled attackers as well. Think what data structures got corrupted
as the result of data races and how. However, note that kernel has lots of "benign" data races that don't lead
to any runtime misbehavior at all.
* Denial Of Service:
Determine if the bug can result in denial-of-service. Most bugs can, since they cause system crash,
hangs, deadlocks, or resource leaks. This is mostly applicable to WARNING bugs that won't cause system crash
in production. For these think what will be consequences of the violation of the kernel assumptions flagged
by the WARNING. In some cases the unexpected condition is also properly handled by the normal control flow
(e.g. with "if (WARN_ON(...))"), these won't cause denial-of-service. If the condition is not handled,
then it may or may not cause denial-of-service.
* Accessible From Unprivileged Processes:
Determine if the bug can be reached from a typical (non-root) user process that does NOT have any special capabilities
(like CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON) or access to device nodes restricted to root.
Assume that unprivileged_bpf_disabled=1, that is eBPF loading is not accessible. However, cBPF (classical BPF)
is still accessible to non-root processes.
Assume that user namespaces are not accessible, that is, the process cannot get the mentioned capabilities even
within a new user namespace (checked by ns_capable() function in the kernel sources).
* Accessible From User Namespaces:
Determine if the bug can be reached within a user-namespace where the process has all capabilities
(including CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON). Such capabilities are checked with ns_capable()
function in the kernel sources.
* VM Guest Trigger:
Determine if the bug can be triggered from the context of a typical KVM guest (e.g., set up by a QEMU VMM).
Consider accesses to standard Linux host paravirtualized features (virtio-blk, virtio-net, etc.),
and handling of VM exits in the KVM code.
* VM Host Trigger in The Confidetial Computing Context:
Determine if the bug can be triggered in a confidential computing guest kernel from the context of a KVM host.
Consider access to standard Linux guest paravirtualized features (virtio-blk, virtio-net, etc.).
* Ethernet Network Trigger:
Determine if the bug can be triggered by processing ingress network Ethernet traffic, either directly (network stack)
or via drivers exposed to network data.
* Other Remote Trigger:
Determine if the bug can be triggered by processing remote traffic other than Ethernet (Wifi, Bluetooth, NFC, etc).
* Peripheral Trigger:
Determine if the bug can be triggered via an untrusted peripheral device that can be physically plugged
into a system, such as a USB device or a niche hardware driver handling external hardware inputs.
This is particularly important for mobile and desktop environments where users can plug in unknown devices.
* Malicious Filesystem Trigger:
Determine if the bug can be triggered by the kernel mounting and parsing a malicious filesystem image.
This is highly critical for Desktop and Mobile environments where external media or downloaded images
might be auto-mounted.
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:
rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
rcu: 1-...!: (2 ticks this GP) idle=457c/1/0x4000000000000000 softirq=19011/19011 fqs=0
rcu: (detected by 0, t=10502 jiffies, g=14185, q=446 ncpus=2)
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 6016 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:find_held_lock kernel/locking/lockdep.c:5347 [inline]
RIP: 0010:__lock_release kernel/locking/lockdep.c:5535 [inline]
RIP: 0010:lock_release+0xf1/0x3e0 kernel/locking/lockdep.c:5889
Code: 01 00 00 00 83 3d 2e 57 06 0e 00 0f 84 96 01 00 00 41 8b 87 e8 0a 00 00 85 c0 0f 84 1d 01 00 00 4c 89 6c 24 18 48 89 5c 24 08 <44> 8d 60 ff 49 8d af f0 0a 00 00 4d 63 ec 48 89 04 24 83 f8 32 0f
RSP: 0018:ffffc90000a08c38 EFLAGS: 00000006
RAX: 0000000000000003 RBX: 0000000000000087 RCX: 4afe2442a3139200
RDX: 0000000000010000 RSI: ffffffff8d9cd98a RDI: ffffffff8be33e80
RBP: ffffc90000a08d30 R08: ffffffff8fa3a537 R09: 1ffffffff1f474a6
R10: dffffc0000000000 R11: fffffbfff1f474a7 R12: dffffc0000000000
R13: ffffffff81adc428 R14: ffff8880b8727a98 R15: ffff888033f7da00
FS: 0000555578362500(0000) GS:ffff888125d15000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000000600 CR3: 0000000029b2e000 CR4: 00000000003526f0
Call Trace:
<IRQ>
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:149 [inline]
_raw_spin_unlock_irqrestore+0x70/0x110 kernel/locking/spinlock.c:194
__run_hrtimer kernel/time/hrtimer.c:1757 [inline]
__hrtimer_run_queues+0x408/0xc60 kernel/time/hrtimer.c:1825
hrtimer_interrupt+0x45b/0xaa0 kernel/time/hrtimer.c:1887
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1039 [inline]
__sysvec_apic_timer_interrupt+0x108/0x410 arch/x86/kernel/apic/apic.c:1056
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1050
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xa8/0x110 kernel/locking/spinlock.c:194
Code: 74 05 e8 cb 89 4a f6 48 c7 44 24 20 00 00 00 00 9c 8f 44 24 20 f6 44 24 21 02 75 4f f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 <e8> e3 2e 13 f6 65 8b 05 6c d1 23 07 85 c0 74 40 48 c7 04 24 0e 36
RSP: 0018:ffffc9000471e380 EFLAGS: 00000206
RAX: 4afe2442a3139200 RBX: 0000000000000a02 RCX: 4afe2442a3139200
RDX: 0000000000000002 RSI: ffffffff8d9b9e1e RDI: 0000000000000001
RBP: ffffc9000471e400 R08: ffffffff8fa3a537 R09: 1ffffffff1f474a6
R10: dffffc0000000000 R11: fffffbfff1f474a7 R12: dffffc0000000000
R13: 000000000001ad70 R14: ffffffff8e21e160 R15: 1ffff920008e3c70
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
pcpu_alloc_noprof+0xc00/0x1720 mm/percpu.c:1858
fib6_nh_init+0x78c/0x1ff0 net/ipv6/route.c:3677
ip6_route_info_create_nh+0x16a/0xab0 net/ipv6/route.c:3892
addrconf_f6i_alloc+0x203/0x450 net/ipv6/route.c:4684
fixup_permanent_addr net/ipv6/addrconf.c:3583 [inline]
addrconf_permanent_addr+0x274/0x9d0 net/ipv6/addrconf.c:3622
addrconf_notify+0x887/0x1010 net/ipv6/addrconf.c:3694
notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85
call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
call_netdevice_notifiers net/core/dev.c:2281 [inline]
__dev_notify_flags+0x18d/0x2e0 net/core/dev.c:-1
netif_change_flags+0xe8/0x1a0 net/core/dev.c:9617
do_setlink+0xc55/0x41c0 net/core/rtnetlink.c:3143
rtnl_changelink net/core/rtnetlink.c:3761 [inline]
__rtnl_newlink net/core/rtnetlink.c:3920 [inline]
rtnl_newlink+0x160b/0x1c70 net/core/rtnetlink.c:4057
rtnetlink_rcv_msg+0x7cf/0xb70 net/core/rtnetlink.c:6946
netlink_rcv_skb+0x205/0x470 net/netlink/af_netlink.c:2552
netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346
netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896
sock_sendmsg_nosec net/socket.c:714 [inline]
__sock_sendmsg+0x21c/0x270 net/socket.c:729
__sys_sendto+0x3bd/0x520 net/socket.c:2228
__do_sys_sendto net/socket.c:2235 [inline]
__se_sys_sendto net/socket.c:2231 [inline]
__x64_sys_sendto+0xde/0x100 net/socket.c:2231
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb49dd90a3c
Code: 2a 5f 02 00 44 8b 4c 24 2c 4c 8b 44 24 20 89 c5 44 8b 54 24 28 48 8b 54 24 18 b8 2c 00 00 00 48 8b 74 24 10 8b 7c 24 08 0f 05 <48> 3d 00 f0 ff ff 77 34 89 ef 48 89 44 24 08 e8 70 5f 02 00 48 8b
RSP: 002b:00007fb49e0ff630 EFLAGS: 00000293 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007fb49eb04620 RCX: 00007fb49dd90a3c
RDX: 000000000000002c RSI: 00007fb49eb04670 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007fb49e0ff684 R09: 000000000000000c
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000003
R13: 0000000000000000 R14: 00007fb49eb04670 R15: 0000000000000000
</TASK>
rcu: rcu_preempt kthread timer wakeup didn't happen for 10501 jiffies! g14185 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402
rcu: Possible timer handling issue on cpu=1 timer-softirq=7353
rcu: rcu_preempt kthread starved for 10502 jiffies! g14185 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=1
rcu: Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
rcu: RCU grace-period kthread stack dump:
task:rcu_preempt state:I stack:26552 pid:16 tgid:16 ppid:2 task_flags:0x208040 flags:0x00004000
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5357 [inline]
__schedule+0x1798/0x4cc0 kernel/sched/core.c:6961
__schedule_loop kernel/sched/core.c:7043 [inline]
schedule+0x165/0x360 kernel/sched/core.c:7058
schedule_timeout+0x12b/0x270 kernel/time/sleep_timeout.c:99
rcu_gp_fqs_loop+0x301/0x1540 kernel/rcu/tree.c:2083
rcu_gp_kthread+0x99/0x390 kernel/rcu/tree.c:2285
kthread+0x70e/0x8a0 kernel/kthread.c:463
ret_from_fork+0x436/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
It is reproducible with the followint program.
Keep in mind that it may lack the precise threading, sandboxing, and some arguments of a working reproducer.
But it should give an idea of the involved syscalls.
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#define BITMASK(bf_off,bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
#define STORE_BY_BITMASK(type,htobe,addr,val,bf_off,bf_len) *(type*)(addr) = htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))
uint64_t r[3] = {0xffffffffffffffff, 0x0, 0xffffffffffffffff};
int main(void)
{
syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
const char* reason;
(void)reason;
intptr_t res = 0;
if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
// socket arguments: [
// domain: socket_domain = 0x11 (8 bytes)
// type: socket_type = 0x800000003 (8 bytes)
// proto: int32 = 0x0 (4 bytes)
// ]
// returns sock
res = syscall(__NR_socket, /*domain=AF_PACKET*/0x11ul, /*type=SOCK_RAW|0x800000000*/0x800000003ul, /*proto=*/0);
if (res != -1)
r[0] = res;
// ioctl$ifreq_SIOCGIFINDEX_team arguments: [
// fd: sock (resource)
// cmd: const = 0x8933 (4 bytes)
// arg: ptr[out, ifreq_dev_t["team0", ifindex_team]] {
// ifreq_dev_t["team0", ifindex_team] {
// ifr_ifrn: buffer: {74 65 61 6d 30 00 00 00 00 00 00 00 00 00 00 00} (length 0x10)
// elem: ifindex_team (resource)
// pad = 0x0 (20 bytes)
// }
// }
// ]
memcpy((void*)0x200000000600, "team0\000\000\000\000\000\000\000\000\000\000\000", 16);
res = syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x8933, /*arg=*/0x200000000600ul);
if (res != -1)
r[1] = *(uint32_t*)0x200000000610;
// socket$netlink arguments: [
// domain: const = 0x10 (8 bytes)
// type: const = 0x3 (8 bytes)
// proto: netlink_proto = 0x0 (4 bytes)
// ]
// returns sock_netlink
res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0);
if (res != -1)
r[2] = res;
// sendmsg$nl_route_sched arguments: [
// fd: sock_nl_route (resource)
// msg: ptr[in, msghdr_netlink[netlink_msg_route_sched]] {
// msghdr_netlink[netlink_msg_route_sched] {
// addr: nil
// addrlen: len = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// vec: ptr[in, iovec[in, netlink_msg_route_sched]] {
// iovec[in, netlink_msg_route_sched] {
// addr: ptr[in, netlink_msg_route_sched] {
// union netlink_msg_route_sched {
// newqdisc: netlink_msg_t[const[RTM_NEWQDISC, int16], tcmsg[AF_UNSPEC], rtm_tca_policy] {
// len: len = 0xac (4 bytes)
// type: const = 0x24 (2 bytes)
// flags: netlink_msg_flags = 0xf0b (2 bytes)
// seq: int32 = 0x0 (4 bytes)
// pid: int32 = 0x0 (4 bytes)
// payload: tcmsg[AF_UNSPEC] {
// family: const = 0x0 (1 bytes)
// tcm__pad1: const = 0x0 (1 bytes)
// tcm__pad2: const = 0x12 (2 bytes)
// ifindex: ifindex (resource)
// tcm_handle: tcm_handle {
// minor: tcm_handle_offsets = 0x0 (2 bytes)
// major: tcm_handle_offsets = 0x0 (2 bytes)
// }
// tcm_parent: tcm_handle {
// minor: tcm_handle_offsets = 0xffff (2 bytes)
// major: tcm_handle_offsets = 0xffff (2 bytes)
// }
// tcm_info: tcm_handle {
// minor: tcm_handle_offsets = 0x0 (2 bytes)
// major: tcm_handle_offsets = 0x0 (2 bytes)
// }
// }
// attrs: array[rtm_tca_policy] {
// union rtm_tca_policy {
// qdisc_kind_options: union qdisc_kind_options {
// q_taprio: tca_kind_options_t["taprio", array[taprio_policy]] {
// TCA_KIND: nlattr_t[const[TCA_KIND, int16], string["taprio"]] {
// nla_len: offsetof = 0xb (2 bytes)
// nla_type: const = 0x1 (2 bytes)
// payload: buffer: {74 61 70 72 69 6f 00} (length 0x7)
// size: buffer: {} (length 0x0)
// pad = 0x0 (1 bytes)
// }
// TCA_OPTIONS: nlattr_t[const[TCA_OPTIONS, int16], array[taprio_policy]] {
// nla_len: offsetof = 0x7c (2 bytes)
// nla_type: const = 0x2 (2 bytes)
// payload: array[taprio_policy] {
// union taprio_policy {
// TCA_TAPRIO_ATTR_PRIOMAP: nlattr_t[const[TCA_TAPRIO_ATTR_PRIOMAP, int16], tc_mqprio_qopt] {
// nla_len: offsetof = 0x56 (2 bytes)
// nla_type: const = 0x1 (2 bytes)
// payload: tc_mqprio_qopt {
// num_tc: int8 = 0x2 (1 bytes)
// prio_tc_map: array[int8] {
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x0 (1 bytes)
// int8 = 0x1 (1 bytes)
// }
// hw: int8 = 0x0 (1 bytes)
// count: array[int16] {
// int16 = 0x8 (2 bytes)
// int16 = 0x5 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0xfffc (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// }
// offset: array[int16] {
// int16 = 0x0 (2 bytes)
// int16 = 0x8 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0xffff (2 bytes)
// int16 = 0x8 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// int16 = 0x0 (2 bytes)
// }
// }
// size: buffer: {} (length 0x0)
// pad = 0x0 (2 bytes)
// }
// }
// union taprio_policy {
// TCA_TAPRIO_ATTR_SCHED_CLOCKID: nlattr_t[const[TCA_TAPRIO_ATTR_SCHED_CLOCKID, int16], int32] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0x5 (2 bytes)
// payload: int32 = 0x0 (4 bytes)
// size: buffer: {} (length 0x0)
// }
// }
// union taprio_policy {
// TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST: nlattr_tt[const[TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST, int16:14], 0, 1, array[nlnest[TCA_TAPRIO_SCHED_ENTRY, array[entry_policy$taprio]]]] {
// nla_len: offsetof = 0x18 (2 bytes)
// nla_type: const = 0x2 (1 bytes)
// NLA_F_NET_BYTEORDER: const = 0x0 (0 bytes)
// NLA_F_NESTED: const = 0x1 (1 bytes)
// payload: array[nlattr_tt[const[TCA_TAPRIO_SCHED_ENTRY, int16:14], 0, 1, array[entry_policy$taprio]]] {
// nlattr_tt[const[TCA_TAPRIO_SCHED_ENTRY, int16:14], 0, 1, array[entry_policy$taprio]] {
// nla_len: offsetof = 0x14 (2 bytes)
// nla_type: const = 0x1 (1 bytes)
// NLA_F_NET_BYTEORDER: const = 0x0 (0 bytes)
// NLA_F_NESTED: const = 0x1 (1 bytes)
// payload: array[entry_policy$taprio] {
// union entry_policy$taprio {
// TCA_TAPRIO_SCHED_ENTRY_GATE_MASK: nlattr_t[const[TCA_TAPRIO_SCHED_ENTRY_GATE_MASK, int16], int32] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0x3 (2 bytes)
// payload: int32 = 0x6 (4 bytes)
// size: buffer: {} (length 0x0)
// }
// }
// union entry_policy$taprio {
// TCA_TAPRIO_SCHED_ENTRY_INTERVAL: nlattr_t[const[TCA_TAPRIO_SCHED_ENTRY_INTERVAL, int16], int32] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0x4 (2 bytes)
// payload: int32 = 0xff (4 bytes)
// size: buffer: {} (length 0x0)
// }
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// }
// }
// }
// }
// }
// }
// len: len = 0xac (8 bytes)
// }
// }
// vlen: const = 0x1 (8 bytes)
// ctrl: const = 0x0 (8 bytes)
// ctrllen: const = 0x0 (8 bytes)
// f: send_flags = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// }
// f: send_flags = 0x0 (8 bytes)
// ]
*(uint64_t*)0x2000000007c0 = 0;
*(uint32_t*)0x2000000007c8 = 0;
*(uint64_t*)0x2000000007d0 = 0x200000000780;
*(uint64_t*)0x200000000780 = 0x200000000240;
*(uint32_t*)0x200000000240 = 0xac;
*(uint16_t*)0x200000000244 = 0x24;
*(uint16_t*)0x200000000246 = 0xf0b;
*(uint32_t*)0x200000000248 = 0;
*(uint32_t*)0x20000000024c = 0;
*(uint8_t*)0x200000000250 = 0;
*(uint8_t*)0x200000000251 = 0;
*(uint16_t*)0x200000000252 = 0x12;
*(uint32_t*)0x200000000254 = r[1];
*(uint16_t*)0x200000000258 = 0;
*(uint16_t*)0x20000000025a = 0;
*(uint16_t*)0x20000000025c = -1;
*(uint16_t*)0x20000000025e = -1;
*(uint16_t*)0x200000000260 = 0;
*(uint16_t*)0x200000000262 = 0;
*(uint16_t*)0x200000000264 = 0xb;
*(uint16_t*)0x200000000266 = 1;
memcpy((void*)0x200000000268, "taprio\000", 7);
*(uint16_t*)0x200000000270 = 0x7c;
*(uint16_t*)0x200000000272 = 2;
*(uint16_t*)0x200000000274 = 0x56;
*(uint16_t*)0x200000000276 = 1;
*(uint8_t*)0x200000000278 = 2;
*(uint8_t*)0x200000000279 = 0;
*(uint8_t*)0x20000000027a = 0;
*(uint8_t*)0x20000000027b = 0;
*(uint8_t*)0x20000000027c = 0;
*(uint8_t*)0x20000000027d = 0;
*(uint8_t*)0x20000000027e = 0;
*(uint8_t*)0x20000000027f = 0;
*(uint8_t*)0x200000000280 = 0;
*(uint8_t*)0x200000000281 = 0;
*(uint8_t*)0x200000000282 = 0;
*(uint8_t*)0x200000000283 = 0;
*(uint8_t*)0x200000000284 = 0;
*(uint8_t*)0x200000000285 = 0;
*(uint8_t*)0x200000000286 = 0;
*(uint8_t*)0x200000000287 = 0;
*(uint8_t*)0x200000000288 = 1;
*(uint8_t*)0x200000000289 = 0;
*(uint16_t*)0x20000000028a = 8;
*(uint16_t*)0x20000000028c = 5;
*(uint16_t*)0x20000000028e = 0;
*(uint16_t*)0x200000000290 = 0;
*(uint16_t*)0x200000000292 = 0;
*(uint16_t*)0x200000000294 = 0xfffc;
*(uint16_t*)0x200000000296 = 0;
*(uint16_t*)0x200000000298 = 0;
*(uint16_t*)0x20000000029a = 0;
*(uint16_t*)0x20000000029c = 0;
*(uint16_t*)0x20000000029e = 0;
*(uint16_t*)0x2000000002a0 = 0;
*(uint16_t*)0x2000000002a2 = 0;
*(uint16_t*)0x2000000002a4 = 0;
*(uint16_t*)0x2000000002a6 = 0;
*(uint16_t*)0x2000000002a8 = 0;
*(uint16_t*)0x2000000002aa = 0;
*(uint16_t*)0x2000000002ac = 8;
*(uint16_t*)0x2000000002ae = 0;
*(uint16_t*)0x2000000002b0 = 0;
*(uint16_t*)0x2000000002b2 = 0;
*(uint16_t*)0x2000000002b4 = 0;
*(uint16_t*)0x2000000002b6 = 0;
*(uint16_t*)0x2000000002b8 = 0;
*(uint16_t*)0x2000000002ba = -1;
*(uint16_t*)0x2000000002bc = 8;
*(uint16_t*)0x2000000002be = 0;
*(uint16_t*)0x2000000002c0 = 0;
*(uint16_t*)0x2000000002c2 = 0;
*(uint16_t*)0x2000000002c4 = 0;
*(uint16_t*)0x2000000002c6 = 0;
*(uint16_t*)0x2000000002c8 = 0;
*(uint16_t*)0x2000000002cc = 8;
*(uint16_t*)0x2000000002ce = 5;
*(uint32_t*)0x2000000002d0 = 0;
*(uint16_t*)0x2000000002d4 = 0x18;
STORE_BY_BITMASK(uint16_t, , 0x2000000002d6, 2, 0, 14);
STORE_BY_BITMASK(uint16_t, , 0x2000000002d7, 0, 6, 1);
STORE_BY_BITMASK(uint16_t, , 0x2000000002d7, 1, 7, 1);
*(uint16_t*)0x2000000002d8 = 0x14;
STORE_BY_BITMASK(uint16_t, , 0x2000000002da, 1, 0, 14);
STORE_BY_BITMASK(uint16_t, , 0x2000000002db, 0, 6, 1);
STORE_BY_BITMASK(uint16_t, , 0x2000000002db, 1, 7, 1);
*(uint16_t*)0x2000000002dc = 8;
*(uint16_t*)0x2000000002de = 3;
*(uint32_t*)0x2000000002e0 = 6;
*(uint16_t*)0x2000000002e4 = 8;
*(uint16_t*)0x2000000002e6 = 4;
*(uint32_t*)0x2000000002e8 = 0xff;
*(uint64_t*)0x200000000788 = 0xac;
*(uint64_t*)0x2000000007d8 = 1;
*(uint64_t*)0x2000000007e0 = 0;
*(uint64_t*)0x2000000007e8 = 0;
*(uint32_t*)0x2000000007f0 = 0;
syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x2000000007c0ul, /*f=*/0ul);
return 0;
}
Reply: Based on the analysis of the kernel bug report and the source code, here is the assessment of the bug:
### Root Cause Analysis
The RCU stall is caused by a long-running loop inside `addrconf_permanent_addr()` that executes while holding a spinlock with softirqs disabled (`write_lock_bh(&idev->lock)`).
When an interface is brought up, it triggers a `NETDEV_UP` event, which is handled by `addrconf_notify()`. This function calls `addrconf_permanent_addr()` to restore routes for permanent IPv6 addresses.
`addrconf_permanent_addr()` iterates over all addresses in `idev->addr_list`. For each permanent address, it calls `fixup_permanent_addr()`, which in turn allocates a new `fib6_info` route and per-CPU memory for the nexthop (`alloc_percpu_gfp()`). Because this is done under a spinlock, the allocations are performed with `GFP_ATOMIC`.
The kernel does not impose a limit on the number of manually configured IPv6 addresses an interface can have (the `max_addresses` sysctl only applies to autoconfigured addresses). If an interface has a massive number of IPv6 addresses, the loop in `addrconf_permanent_addr()` will run for a very long time, performing hundreds of thousands of atomic memory allocations without ever dropping the spinlock. This completely blocks the CPU and prevents softirqs from running, leading to the observed RCU stall and potential atomic memory allocation failures.
### Security Impact
* **Denial of Service (DoS):** Yes. Triggering this bug causes a severe RCU stall, which can lead to a system hang or a kernel panic (if `panic_on_rcu_stall` is enabled). It can also exhaust atomic memory pools.
* **Exploitable:** No. The bug is a pure CPU stall/resource exhaustion issue. There is no memory corruption, use-after-free, or out-of-bounds access involved that could be leveraged for privilege escalation.
* **Accessible From Unprivileged Processes:** No. Adding IPv6 addresses to an interface requires `CAP_NET_ADMIN` capabilities.
* **Accessible From User Namespaces:** Yes. An unprivileged user can create a new user namespace and a network namespace. Within this isolated network namespace, the user gains `CAP_NET_ADMIN`. They can then create a dummy interface, add millions of IPv6 addresses to it using `RTM_NEWADDR` netlink messages, and finally bring the interface up (`RTM_NEWLINK` with `IFF_UP`). This sequence will reliably trigger the RCU stall on the host kernel.
### Conclusion
This is a Denial of Service (DoS) vulnerability that can be triggered by an unprivileged local user by leveraging user and network namespaces. It is not exploitable for code execution or privilege escalation.
|
| 6/2 |
2026/05/14 01:17 |
llm |
expert |
0m
Model:
Tokens:
input: 15074
output: 22
thoughts: 1738
Thoughts: **Initial Assessment of the RCU Stall and Stack Trace**
Okay, first things first. I see an RCU stall report indicating a `rcu_preempt` kthread issue. It's starved for a significant number of jiffies β over 10 seconds, which is a red flag. The stack trace, centered on CPU 1, is my next point of focus. It looks like it's deep within interrupt handling, specifically related to the APIC timer and HRTimer management. The path I see, from `__raw_spin_unlock_irqrestore` through `hrtimer_interrupt` and eventually into `net/ipv6/route.c`, is intriguing, as the code seems to be locked in ipv6 route configuration functions.
**Deconstructing the Context**
Now, I need to understand what's *causing* this stall. The provided information mentions the use of a `taprio` qdisc on a `team` device. My immediate thought is about device setup and network configuration. I'm noting the device interaction via `SIOCGIFINDEX_team`, which points toward an issue or interaction with a Team device.
My concern is the C reproducer. I am thinking, Does it properly handle the team0 device creation, or is it assuming it's already there?
**Tracing the Execution Path**
The stack trace reveals `rtnl_newlink`, then calls to `do_setlink` and `netif_change_flags`, which eventually leads into `addrconf_notify`. The puzzle pieces begin to fit together: the code flow points to a netlink message, likely to configure a new link. However, this raises a question: is this `RTM_NEWLINK`?
I have to carefully double-check the netlink message type. The reproducer sets up a `taprio` qdisc; this action is not associated with `RTM_NEWLINK`, and it's a `RTM_NEWQDISC` netlink message. This means there's a disconnect: The stack trace shows `rtnl_newlink` which is associated with `RTM_NEWLINK`, but I'm thinking about `RTM_NEWQDISC` here.
**Pinpointing the Lock Contention**
My next action is examining the `pcpu_alloc_noprof` function in `mm/percpu.c`, where I see a spinlock involved. The lock here is `pcpu_lock`. The stall must be a lock contention problem, involving `spin_unlock_irqrestore`. Is it an infinite loop within the function itself?
**Conclusion**
Based on this, it seems the stall is likely caused by contention around the `pcpu_lock` spinlock within `pcpu_alloc_noprof` during an IPv6 route configuration, triggered by the addition of a `taprio` qdisc. My next investigation involves examining the code path in `mm/percpu.c` at line 1858 in connection with this lock. Further, I have to find out what is calling this reproducer, as it might be a factor.
|
| 7/2 |
2026/05/14 01:17 |
tool |
grepper |
0m
Args: map[Expression:pcpu_alloc_noprof]
Results: map[Output:include/linux/percpu.h=133=extern void __init setup_per_cpu_areas(void);
--
include/linux/percpu.h-135-
include/linux/percpu.h:136:extern void __percpu *pcpu_alloc_noprof(size_t size, size_t align, bool reserved,
include/linux/percpu.h-137- gfp_t gfp) __alloc_size(1);
--
include/linux/percpu.h-139-#define __alloc_percpu_gfp(_size, _align, _gfp) \
include/linux/percpu.h:140: alloc_hooks(pcpu_alloc_noprof(_size, _align, false, _gfp))
include/linux/percpu.h-141-#define __alloc_percpu(_size, _align) \
include/linux/percpu.h:142: alloc_hooks(pcpu_alloc_noprof(_size, _align, false, GFP_KERNEL))
include/linux/percpu.h-143-#define __alloc_reserved_percpu(_size, _align) \
include/linux/percpu.h:144: alloc_hooks(pcpu_alloc_noprof(_size, _align, true, GFP_KERNEL))
include/linux/percpu.h-145-
--
include/linux/percpu.h-152-#define alloc_percpu_noprof(type) \
include/linux/percpu.h:153: ((typeof(type) __percpu *)pcpu_alloc_noprof(sizeof(type), \
include/linux/percpu.h-154- __alignof__(type), false, GFP_KERNEL))
--
mm/percpu.c=1710=static void pcpu_alloc_tag_free_hook(struct pcpu_chunk *chunk, int off, size_t size)
--
mm/percpu.c-1729- */
mm/percpu.c:1730:void __percpu *pcpu_alloc_noprof(size_t size, size_t align, bool reserved,
mm/percpu.c-1731- gfp_t gfp)
--
mm/percpu.c-1931-}
mm/percpu.c:1932:EXPORT_SYMBOL_GPL(pcpu_alloc_noprof);
mm/percpu.c-1933-
]
|
| 8/2 |
2026/05/14 01:17 |
llm |
expert |
0m
Model:
Tokens:
input: 18125
output: 43
thoughts: 20
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Diving into `mm/percpu.c`**
Okay, time to dig in. Based on what I'm dealing with, I'm going to start with `mm/percpu.c` and specifically around line 1858. I'm assuming that's where I need to look based on my understanding of this system's memory management and where the symptoms point. I'm hoping to understand how per-CPU allocations are handled at that point in the code. I'm probably looking for something specific about how the memory is allocated, freed, or potentially synchronized. Let's see what's actually going on in that area, and hopefully it will lead me to the root cause of the issue.
|
| 9/2 |
2026/05/14 01:17 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:mm/percpu.c IncludeLines:true Name:pcpu_alloc_noprof]
Results: map[SourceCode:1715: /**
1716: * pcpu_alloc - the percpu allocator
1717: * @size: size of area to allocate in bytes
1718: * @align: alignment of area (max PAGE_SIZE)
1719: * @reserved: allocate from the reserved chunk if available
1720: * @gfp: allocation flags
1721: *
1722: * Allocate percpu area of @size bytes aligned at @align. If @gfp doesn't
1723: * contain %GFP_KERNEL, the allocation is atomic. If @gfp has __GFP_NOWARN
1724: * then no warning will be triggered on invalid or failed allocation
1725: * requests.
1726: *
1727: * RETURNS:
1728: * Percpu pointer to the allocated area on success, NULL on failure.
1729: */
1730: void __percpu *pcpu_alloc_noprof(size_t size, size_t align, bool reserved,
1731: gfp_t gfp)
1732: {
1733: gfp_t pcpu_gfp;
1734: bool is_atomic;
1735: bool do_warn;
1736: struct obj_cgroup *objcg = NULL;
1737: static atomic_t warn_limit = ATOMIC_INIT(10);
1738: struct pcpu_chunk *chunk, *next;
1739: const char *err;
1740: int slot, off, cpu, ret;
1741: unsigned long flags;
1742: void __percpu *ptr;
1743: size_t bits, bit_align;
1744:
1745: gfp = current_gfp_context(gfp);
1746: /* whitelisted flags that can be passed to the backing allocators */
1747: pcpu_gfp = gfp & (GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
1748: is_atomic = !gfpflags_allow_blocking(gfp);
1749: do_warn = !(gfp & __GFP_NOWARN);
1750:
1751: /*
1752: * There is now a minimum allocation size of PCPU_MIN_ALLOC_SIZE,
1753: * therefore alignment must be a minimum of that many bytes.
1754: * An allocation may have internal fragmentation from rounding up
1755: * of up to PCPU_MIN_ALLOC_SIZE - 1 bytes.
1756: */
1757: if (unlikely(align < PCPU_MIN_ALLOC_SIZE))
1758: align = PCPU_MIN_ALLOC_SIZE;
1759:
1760: size = ALIGN(size, PCPU_MIN_ALLOC_SIZE);
1761: bits = size >> PCPU_MIN_ALLOC_SHIFT;
1762: bit_align = align >> PCPU_MIN_ALLOC_SHIFT;
1763:
1764: if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE ||
1765: !is_power_of_2(align))) {
1766: WARN(do_warn, "illegal size (%zu) or align (%zu) for percpu allocation\n",
1767: size, align);
1768: return NULL;
1769: }
1770:
1771: if (unlikely(!pcpu_memcg_pre_alloc_hook(size, gfp, &objcg)))
1772: return NULL;
1773:
1774: if (!is_atomic) {
1775: /*
1776: * pcpu_balance_workfn() allocates memory under this mutex,
1777: * and it may wait for memory reclaim. Allow current task
1778: * to become OOM victim, in case of memory pressure.
1779: */
1780: if (gfp & __GFP_NOFAIL) {
1781: mutex_lock(&pcpu_alloc_mutex);
1782: } else if (mutex_lock_killable(&pcpu_alloc_mutex)) {
1783: pcpu_memcg_post_alloc_hook(objcg, NULL, 0, size);
1784: return NULL;
1785: }
1786: }
1787:
1788: spin_lock_irqsave(&pcpu_lock, flags);
1789:
1790: /* serve reserved allocations from the reserved chunk if available */
1791: if (reserved && pcpu_reserved_chunk) {
1792: chunk = pcpu_reserved_chunk;
1793:
1794: off = pcpu_find_block_fit(chunk, bits, bit_align, is_atomic);
1795: if (off < 0) {
1796: err = "alloc from reserved chunk failed";
1797: goto fail_unlock;
1798: }
1799:
1800: off = pcpu_alloc_area(chunk, bits, bit_align, off);
1801: if (off >= 0)
1802: goto area_found;
1803:
1804: err = "alloc from reserved chunk failed";
1805: goto fail_unlock;
1806: }
1807:
1808: restart:
1809: /* search through normal chunks */
1810: for (slot = pcpu_size_to_slot(size); slot <= pcpu_free_slot; slot++) {
1811: list_for_each_entry_safe(chunk, next, &pcpu_chunk_lists[slot],
1812: list) {
1813: off = pcpu_find_block_fit(chunk, bits, bit_align,
1814: is_atomic);
1815: if (off < 0) {
1816: if (slot < PCPU_SLOT_FAIL_THRESHOLD)
1817: pcpu_chunk_move(chunk, 0);
1818: continue;
1819: }
1820:
1821: off = pcpu_alloc_area(chunk, bits, bit_align, off);
1822: if (off >= 0) {
1823: pcpu_reintegrate_chunk(chunk);
1824: goto area_found;
1825: }
1826: }
1827: }
1828:
1829: spin_unlock_irqrestore(&pcpu_lock, flags);
1830:
1831: if (is_atomic) {
1832: err = "atomic alloc failed, no space left";
1833: goto fail;
1834: }
1835:
1836: /* No space left. Create a new chunk. */
1837: if (list_empty(&pcpu_chunk_lists[pcpu_free_slot])) {
1838: chunk = pcpu_create_chunk(pcpu_gfp);
1839: if (!chunk) {
1840: err = "failed to allocate new chunk";
1841: goto fail;
1842: }
1843:
1844: spin_lock_irqsave(&pcpu_lock, flags);
1845: pcpu_chunk_relocate(chunk, -1);
1846: } else {
1847: spin_lock_irqsave(&pcpu_lock, flags);
1848: }
1849:
1850: goto restart;
1851:
1852: area_found:
1853: pcpu_stats_area_alloc(chunk, size);
1854:
1855: if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW)
1856: pcpu_schedule_balance_work();
1857:
1858: spin_unlock_irqrestore(&pcpu_lock, flags);
1859:
1860: /* populate if not all pages are already there */
1861: if (!is_atomic) {
1862: unsigned int page_end, rs, re;
1863:
1864: rs = PFN_DOWN(off);
1865: page_end = PFN_UP(off + size);
1866:
1867: for_each_clear_bitrange_from(rs, re, chunk->populated, page_end) {
1868: WARN_ON(chunk->immutable);
1869:
1870: ret = pcpu_populate_chunk(chunk, rs, re, pcpu_gfp);
1871:
1872: spin_lock_irqsave(&pcpu_lock, flags);
1873: if (ret) {
1874: pcpu_free_area(chunk, off);
1875: err = "failed to populate";
1876: goto fail_unlock;
1877: }
1878: pcpu_chunk_populated(chunk, rs, re);
1879: spin_unlock_irqrestore(&pcpu_lock, flags);
1880: }
1881:
1882: mutex_unlock(&pcpu_alloc_mutex);
1883: }
1884:
1885: /* clear the areas and return address relative to base address */
1886: for_each_possible_cpu(cpu)
1887: memset((void *)pcpu_chunk_addr(chunk, cpu, 0) + off, 0, size);
1888:
1889: ptr = __addr_to_pcpu_ptr(chunk->base_addr + off);
1890: kmemleak_alloc_percpu(ptr, size, gfp);
1891:
1892: trace_percpu_alloc_percpu(_RET_IP_, reserved, is_atomic, size, align,
1893: chunk->base_addr, off, ptr,
1894: pcpu_obj_full_size(size), gfp);
1895:
1896: pcpu_memcg_post_alloc_hook(objcg, chunk, off, size);
1897:
1898: pcpu_alloc_tag_alloc_hook(chunk, off, size);
1899:
1900: return ptr;
1901:
1902: fail_unlock:
1903: spin_unlock_irqrestore(&pcpu_lock, flags);
1904: fail:
1905: trace_percpu_alloc_percpu_fail(reserved, is_atomic, size, align);
1906:
1907: if (do_warn) {
1908: int remaining = atomic_dec_if_positive(&warn_limit);
1909:
1910: if (remaining >= 0) {
1911: pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n",
1912: size, align, is_atomic, err);
1913: if (!is_atomic)
1914: dump_stack();
1915: if (remaining == 0)
1916: pr_info("limit reached, disable warning\n");
1917: }
1918: }
1919:
1920: if (is_atomic) {
1921: /* see the flag handling in pcpu_balance_workfn() */
1922: pcpu_atomic_alloc_failed = true;
1923: pcpu_schedule_balance_work();
1924: } else {
1925: mutex_unlock(&pcpu_alloc_mutex);
1926: }
1927:
1928: pcpu_memcg_post_alloc_hook(objcg, NULL, 0, size);
1929:
1930: return NULL;
1931: }
SourceFile:mm/percpu.c]
|
| 10/2 |
2026/05/14 01:17 |
llm |
expert |
0m
Model:
Tokens:
input: 21705
output: 43
thoughts: 291
Thoughts: **Analyzing a Potential RCU Stall in Per-CPU Allocation**
Okay, so the stack trace points directly to `spin_unlock_irqrestore` at `mm/percpu.c:1858`. Let's see... looking at the code surrounding that line, `spin_unlock_irqrestore` is called after a potential `pcpu_stats_area_alloc` and a check for `pcpu_nr_empty_pop_pages`. The code snippet itself doesn't scream "problem," but the context is key. The critical information is that the RCU stall is happening on CPU 1, and this CPU is specifically in `spin_unlock_irqrestore`.
Now, is CPU 1 actually *stuck* in the `spin_unlock_irqrestore` call? Or is it simply that the operation preceding it, the `pcpu_alloc_noprof` that calls `pcpu_stats_area_alloc` maybe, is the real culprit and has just taken a ridiculously long time? The RCU stall duration of ~10 seconds (10502 jiffies) is quite significant. That's a long wait for any lock.
Given the duration, it seems plausible that `pcpu_alloc_noprof` might be called in a loop somewhere. A long allocation in the per-cpu allocator could easily lead to such a stall. I need to investigate the call sites to see where this function is used. A quick check of `fib6_nh_init` makes sense to begin my investigation there.
|
| 11/2 |
2026/05/14 01:17 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/route.c IncludeLines:true Name:fib6_nh_init]
Results: map[SourceCode:3570: int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,
3571: struct fib6_config *cfg, gfp_t gfp_flags,
3572: struct netlink_ext_ack *extack)
3573: {
3574: netdevice_tracker *dev_tracker = &fib6_nh->fib_nh_dev_tracker;
3575: struct net_device *dev = NULL;
3576: struct inet6_dev *idev = NULL;
3577: int addr_type;
3578: int err;
3579:
3580: fib6_nh->fib_nh_family = AF_INET6;
3581: #ifdef CONFIG_IPV6_ROUTER_PREF
3582: fib6_nh->last_probe = jiffies;
3583: #endif
3584: if (cfg->fc_is_fdb) {
3585: fib6_nh->fib_nh_gw6 = cfg->fc_gateway;
3586: fib6_nh->fib_nh_gw_family = AF_INET6;
3587: return 0;
3588: }
3589:
3590: err = -ENODEV;
3591: if (cfg->fc_ifindex) {
3592: dev = netdev_get_by_index(net, cfg->fc_ifindex,
3593: dev_tracker, gfp_flags);
3594: if (!dev)
3595: goto out;
3596: idev = in6_dev_get(dev);
3597: if (!idev)
3598: goto out;
3599: }
3600:
3601: if (cfg->fc_flags & RTNH_F_ONLINK) {
3602: if (!dev) {
3603: NL_SET_ERR_MSG(extack,
3604: "Nexthop device required for onlink");
3605: goto out;
3606: }
3607:
3608: if (!(dev->flags & IFF_UP)) {
3609: NL_SET_ERR_MSG(extack, "Nexthop device is not up");
3610: err = -ENETDOWN;
3611: goto out;
3612: }
3613:
3614: fib6_nh->fib_nh_flags |= RTNH_F_ONLINK;
3615: }
3616:
3617: fib6_nh->fib_nh_weight = 1;
3618:
3619: /* We cannot add true routes via loopback here,
3620: * they would result in kernel looping; promote them to reject routes
3621: */
3622: addr_type = ipv6_addr_type(&cfg->fc_dst);
3623: if (fib6_is_reject(cfg->fc_flags, dev, addr_type)) {
3624: /* hold loopback dev/idev if we haven't done so. */
3625: if (dev != net->loopback_dev) {
3626: if (dev) {
3627: netdev_put(dev, dev_tracker);
3628: in6_dev_put(idev);
3629: }
3630: dev = net->loopback_dev;
3631: netdev_hold(dev, dev_tracker, gfp_flags);
3632: idev = in6_dev_get(dev);
3633: if (!idev) {
3634: err = -ENODEV;
3635: goto out;
3636: }
3637: }
3638: goto pcpu_alloc;
3639: }
3640:
3641: if (cfg->fc_flags & RTF_GATEWAY) {
3642: err = ip6_validate_gw(net, cfg, &dev, dev_tracker,
3643: &idev, extack);
3644: if (err)
3645: goto out;
3646:
3647: fib6_nh->fib_nh_gw6 = cfg->fc_gateway;
3648: fib6_nh->fib_nh_gw_family = AF_INET6;
3649: }
3650:
3651: err = -ENODEV;
3652: if (!dev)
3653: goto out;
3654:
3655: if (!idev || idev->cnf.disable_ipv6) {
3656: NL_SET_ERR_MSG(extack, "IPv6 is disabled on nexthop device");
3657: err = -EACCES;
3658: goto out;
3659: }
3660:
3661: if (!(dev->flags & IFF_UP) && !cfg->fc_ignore_dev_down) {
3662: NL_SET_ERR_MSG(extack, "Nexthop device is not up");
3663: err = -ENETDOWN;
3664: goto out;
3665: }
3666:
3667: if (!(cfg->fc_flags & (RTF_LOCAL | RTF_ANYCAST)) &&
3668: !netif_carrier_ok(dev))
3669: fib6_nh->fib_nh_flags |= RTNH_F_LINKDOWN;
3670:
3671: err = fib_nh_common_init(net, &fib6_nh->nh_common, cfg->fc_encap,
3672: cfg->fc_encap_type, cfg, gfp_flags, extack);
3673: if (err)
3674: goto out;
3675:
3676: pcpu_alloc:
3677: fib6_nh->rt6i_pcpu = alloc_percpu_gfp(struct rt6_info *, gfp_flags);
3678: if (!fib6_nh->rt6i_pcpu) {
3679: err = -ENOMEM;
3680: goto out;
3681: }
3682:
3683: fib6_nh->fib_nh_dev = dev;
3684: fib6_nh->fib_nh_oif = dev->ifindex;
3685: err = 0;
3686: out:
3687: if (idev)
3688: in6_dev_put(idev);
3689:
3690: if (err) {
3691: fib_nh_common_release(&fib6_nh->nh_common);
3692: fib6_nh->nh_common.nhc_pcpu_rth_output = NULL;
3693: fib6_nh->fib_nh_lws = NULL;
3694: netdev_put(dev, dev_tracker);
3695: }
3696:
3697: return err;
3698: }
SourceFile:net/ipv6/route.c]
|
| 12/2 |
2026/05/14 01:17 |
llm |
expert |
0m
Model:
Tokens:
input: 24378
output: 45
thoughts: 91
Thoughts: Okay, here's my interpretation of that code snippet, presented as my own thought process:
**Diving into the `alloc_percpu_gfp` Call**
Alright, so line 3677 is the one that's calling `alloc_percpu_gfp`. It looks like we're allocating per-CPU memory for `fib6_nh->rt6i_pcpu`, which is a pointer to a `struct rt6_info`. Seems straightforward enough, standard per-CPU allocation for routing information. But the interesting bit, as always, is where the `gfp_flags` come from. We're passing in `gfp_flags` to `alloc_percpu_gfp`, so the allocation behavior will be determined by it. Now, where is that set? It looks like we get the `gfp_flags` from a function named `addrconf_f6i_alloc`. Time to dig a level deeper and figure out what's happening there. Let's see what `addrconf_f6i_alloc` does and how it determines those allocation flags. That'll be the key to understanding the memory allocation characteristics here.
|
| 13/2 |
2026/05/14 01:17 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/route.c IncludeLines:true Name:addrconf_f6i_alloc]
Results: map[SourceCode:4653: struct fib6_info *addrconf_f6i_alloc(struct net *net,
4654: struct inet6_dev *idev,
4655: const struct in6_addr *addr,
4656: bool anycast, gfp_t gfp_flags,
4657: struct netlink_ext_ack *extack)
4658: {
4659: struct fib6_config cfg = {
4660: .fc_table = l3mdev_fib_table(idev->dev) ? : RT6_TABLE_LOCAL,
4661: .fc_ifindex = idev->dev->ifindex,
4662: .fc_flags = RTF_UP | RTF_NONEXTHOP,
4663: .fc_dst = *addr,
4664: .fc_dst_len = 128,
4665: .fc_protocol = RTPROT_KERNEL,
4666: .fc_nlinfo.nl_net = net,
4667: .fc_ignore_dev_down = true,
4668: };
4669: struct fib6_info *f6i;
4670: int err;
4671:
4672: if (anycast) {
4673: cfg.fc_type = RTN_ANYCAST;
4674: cfg.fc_flags |= RTF_ANYCAST;
4675: } else {
4676: cfg.fc_type = RTN_LOCAL;
4677: cfg.fc_flags |= RTF_LOCAL;
4678: }
4679:
4680: f6i = ip6_route_info_create(&cfg, gfp_flags, extack);
4681: if (IS_ERR(f6i))
4682: return f6i;
4683:
4684: err = ip6_route_info_create_nh(f6i, &cfg, gfp_flags, extack);
4685: if (err)
4686: return ERR_PTR(err);
4687:
4688: f6i->dst_nocount = true;
4689:
4690: if (!anycast &&
4691: (READ_ONCE(net->ipv6.devconf_all->disable_policy) ||
4692: READ_ONCE(idev->cnf.disable_policy)))
4693: f6i->dst_nopolicy = true;
4694:
4695: return f6i;
4696: }
SourceFile:net/ipv6/route.c]
|
| 14/2 |
2026/05/14 01:17 |
llm |
expert |
1m
Model:
Tokens:
input: 25508
output: 42
thoughts: 56
Thoughts: Here's my take on the thought process:
**Tracing the IPv6 Address Configuration Flow**
Okay, so I'm digging into this IPv6 address configuration code, and I need to figure out how `addrconf_f6i_alloc` is getting invoked. The call stack, as far as I can see, is: `addrconf_f6i_alloc` is called by `fixup_permanent_addr`. `fixup_permanent_addr`, in turn, is triggered by `addrconf_permanent_addr`, and that function is ultimately called by `addrconf_notify`. Seems like a fairly standard sequence of events.
Now, that last function call, `addrconf_notify`, is the point where everything begins. That's where the real action starts! This is likely where the external event that triggers the whole process is happening. Better double-check `addrconf_notify` to understand the conditions that get us to `addrconf_f6i_alloc`. Gotta understand the inputs.
|
| 15/2 |
2026/05/14 01:19 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/addrconf.c IncludeLines:true Name:addrconf_notify]
Results: map[SourceCode:3636: static int addrconf_notify(struct notifier_block *this, unsigned long event,
3637: void *ptr)
3638: {
3639: struct net_device *dev = netdev_notifier_info_to_dev(ptr);
3640: struct netdev_notifier_change_info *change_info;
3641: struct netdev_notifier_changeupper_info *info;
3642: struct inet6_dev *idev = __in6_dev_get(dev);
3643: struct net *net = dev_net(dev);
3644: int run_pending = 0;
3645: int err;
3646:
3647: switch (event) {
3648: case NETDEV_REGISTER:
3649: if (!idev && dev->mtu >= IPV6_MIN_MTU) {
3650: idev = ipv6_add_dev(dev);
3651: if (IS_ERR(idev))
3652: return notifier_from_errno(PTR_ERR(idev));
3653: }
3654: break;
3655:
3656: case NETDEV_CHANGEMTU:
3657: /* if MTU under IPV6_MIN_MTU stop IPv6 on this interface. */
3658: if (dev->mtu < IPV6_MIN_MTU) {
3659: addrconf_ifdown(dev, dev != net->loopback_dev);
3660: break;
3661: }
3662:
3663: if (idev) {
3664: rt6_mtu_change(dev, dev->mtu);
3665: WRITE_ONCE(idev->cnf.mtu6, dev->mtu);
3666: break;
3667: }
3668:
3669: /* allocate new idev */
3670: idev = ipv6_add_dev(dev);
3671: if (IS_ERR(idev))
3672: break;
3673:
3674: /* device is still not ready */
3675: if (!(idev->if_flags & IF_READY))
3676: break;
3677:
3678: run_pending = 1;
3679: fallthrough;
3680: case NETDEV_UP:
3681: case NETDEV_CHANGE:
3682: if (idev && idev->cnf.disable_ipv6)
3683: break;
3684:
3685: if (dev->priv_flags & IFF_NO_ADDRCONF) {
3686: if (event == NETDEV_UP && !IS_ERR_OR_NULL(idev) &&
3687: dev->flags & IFF_UP && dev->flags & IFF_MULTICAST)
3688: ipv6_mc_up(idev);
3689: break;
3690: }
3691:
3692: if (event == NETDEV_UP) {
3693: /* restore routes for permanent addresses */
3694: addrconf_permanent_addr(net, dev);
3695:
3696: if (!addrconf_link_ready(dev)) {
3697: /* device is not ready yet. */
3698: pr_debug("ADDRCONF(NETDEV_UP): %s: link is not ready\n",
3699: dev->name);
3700: break;
3701: }
3702:
3703: if (!idev && dev->mtu >= IPV6_MIN_MTU)
3704: idev = ipv6_add_dev(dev);
3705:
3706: if (!IS_ERR_OR_NULL(idev)) {
3707: idev->if_flags |= IF_READY;
3708: run_pending = 1;
3709: }
3710: } else if (event == NETDEV_CHANGE) {
3711: if (!addrconf_link_ready(dev)) {
3712: /* device is still not ready. */
3713: rt6_sync_down_dev(dev, event);
3714: break;
3715: }
3716:
3717: if (!IS_ERR_OR_NULL(idev)) {
3718: if (idev->if_flags & IF_READY) {
3719: /* device is already configured -
3720: * but resend MLD reports, we might
3721: * have roamed and need to update
3722: * multicast snooping switches
3723: */
3724: ipv6_mc_up(idev);
3725: change_info = ptr;
3726: if (change_info->flags_changed & IFF_NOARP)
3727: addrconf_dad_run(idev, true);
3728: rt6_sync_up(dev, RTNH_F_LINKDOWN);
3729: break;
3730: }
3731: idev->if_flags |= IF_READY;
3732: }
3733:
3734: pr_debug("ADDRCONF(NETDEV_CHANGE): %s: link becomes ready\n",
3735: dev->name);
3736:
3737: run_pending = 1;
3738: }
3739:
3740: addrconf_init_auto_addrs(dev);
3741:
3742: if (!IS_ERR_OR_NULL(idev)) {
3743: if (run_pending)
3744: addrconf_dad_run(idev, false);
3745:
3746: /* Device has an address by now */
3747: rt6_sync_up(dev, RTNH_F_DEAD);
3748:
3749: /*
3750: * If the MTU changed during the interface down,
3751: * when the interface up, the changed MTU must be
3752: * reflected in the idev as well as routers.
3753: */
3754: if (idev->cnf.mtu6 != dev->mtu &&
3755: dev->mtu >= IPV6_MIN_MTU) {
3756: rt6_mtu_change(dev, dev->mtu);
3757: WRITE_ONCE(idev->cnf.mtu6, dev->mtu);
3758: }
3759: WRITE_ONCE(idev->tstamp, jiffies);
3760: inet6_ifinfo_notify(RTM_NEWLINK, idev);
3761:
3762: /*
3763: * If the changed mtu during down is lower than
3764: * IPV6_MIN_MTU stop IPv6 on this interface.
3765: */
3766: if (dev->mtu < IPV6_MIN_MTU)
3767: addrconf_ifdown(dev, dev != net->loopback_dev);
3768: }
3769: break;
3770:
3771: case NETDEV_DOWN:
3772: case NETDEV_UNREGISTER:
3773: /*
3774: * Remove all addresses from this interface.
3775: */
3776: addrconf_ifdown(dev, event != NETDEV_DOWN);
3777: break;
3778:
3779: case NETDEV_CHANGENAME:
3780: if (idev) {
3781: snmp6_unregister_dev(idev);
3782: addrconf_sysctl_unregister(idev);
3783: err = addrconf_sysctl_register(idev);
3784: if (err)
3785: return notifier_from_errno(err);
3786: err = snmp6_register_dev(idev);
3787: if (err) {
3788: addrconf_sysctl_unregister(idev);
3789: return notifier_from_errno(err);
3790: }
3791: }
3792: break;
3793:
3794: case NETDEV_PRE_TYPE_CHANGE:
3795: case NETDEV_POST_TYPE_CHANGE:
3796: if (idev)
3797: addrconf_type_change(dev, event);
3798: break;
3799:
3800: case NETDEV_CHANGEUPPER:
3801: info = ptr;
3802:
3803: /* flush all routes if dev is linked to or unlinked from
3804: * an L3 master device (e.g., VRF)
3805: */
3806: if (info->upper_dev && netif_is_l3_master(info->upper_dev))
3807: addrconf_ifdown(dev, false);
3808: }
3809:
3810: return NOTIFY_OK;
3811: }
SourceFile:net/ipv6/addrconf.c]
|
| 16/2 |
2026/05/14 01:19 |
llm |
expert |
1m
Model:
Tokens:
input: 28390
output: 44
thoughts: 32
Thoughts: Here's my thought process, as if I were analyzing that code:
**Diving into the Network Device Lifecycle**
Okay, so `addrconf_permanent_addr` gets triggered on a `NETDEV_UP` event. That's a key hook, telling me it's likely responsible for configuring *permanent* IP addresses when a network interface comes online. My mental map tells me this is probably where the core logic of DHCP or static address assignments is kicking in, or at least the part that *makes it stick*. I need to dig into `addrconf_permanent_addr` immediately to confirm my assumptions and figure out the exact flow. Time to see what that function is actually *doing* under the hood. I expect to see checks for configuration sources, address allocation methods, and probably some interaction with the routing table.
|
| 17/2 |
2026/05/14 01:20 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/addrconf.c IncludeLines:true Name:addrconf_permanent_addr]
Results: map[SourceCode:3609: static void addrconf_permanent_addr(struct net *net, struct net_device *dev)
3610: {
3611: struct inet6_ifaddr *ifp, *tmp;
3612: struct inet6_dev *idev;
3613:
3614: idev = __in6_dev_get(dev);
3615: if (!idev)
3616: return;
3617:
3618: write_lock_bh(&idev->lock);
3619:
3620: list_for_each_entry_safe(ifp, tmp, &idev->addr_list, if_list) {
3621: if ((ifp->flags & IFA_F_PERMANENT) &&
3622: fixup_permanent_addr(net, idev, ifp) < 0) {
3623: write_unlock_bh(&idev->lock);
3624: in6_ifa_hold(ifp);
3625: ipv6_del_addr(ifp);
3626: write_lock_bh(&idev->lock);
3627:
3628: net_info_ratelimited("%s: Failed to add prefix route for address %pI6c; dropping\n",
3629: idev->dev->name, &ifp->addr);
3630: }
3631: }
3632:
3633: write_unlock_bh(&idev->lock);
3634: }
SourceFile:net/ipv6/addrconf.c]
|
| 18/2 |
2026/05/14 01:20 |
llm |
expert |
0m
Model:
Tokens:
input: 29082
output: 44
thoughts: 132
Thoughts: **Analyzing Potential Lock Inversion**
Okay, let's break this down. My concern immediately zeroes in on the lock acquisition sequence. I see `fixup_permanent_addr` being called *within* the scope of `write_lock_bh(&idev->lock)`. And remember, `write_lock_bh` specifically disables softirqs. That alone raises a flag; it's always a point of scrutiny when you're dealing with locks and interrupt contexts.
Now, looking deeper into `fixup_permanent_addr`, it calls `addrconf_f6i_alloc`. From there, things get more interesting. `addrconf_f6i_alloc` subsequently calls `ip6_route_info_create_nh`, which then proceeds to `fib6_nh_init`. This eventually leads to `alloc_percpu_gfp(struct rt6_info *, gfp_flags)`.
My immediate question, the thing I *really* need to know right now, is: what are the *`gfp_flags`* being passed to `addrconf_f6i_alloc`? That's the crux of this. Knowing those flags is critical to understand the potential for memory allocation conflicts within the locked context. Depending on those flags, this could be perfectly safe, or a very nasty potential lock inversion issue. This deserves a closer look.
|
| 19/2 |
2026/05/14 01:21 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/addrconf.c IncludeLines:true Name:fixup_permanent_addr]
Results: map[SourceCode:3572: static int fixup_permanent_addr(struct net *net,
3573: struct inet6_dev *idev,
3574: struct inet6_ifaddr *ifp)
3575: {
3576: /* !fib6_node means the host route was removed from the
3577: * FIB, for example, if 'lo' device is taken down. In that
3578: * case regenerate the host route.
3579: */
3580: if (!ifp->rt || !ifp->rt->fib6_node) {
3581: struct fib6_info *f6i, *prev;
3582:
3583: f6i = addrconf_f6i_alloc(net, idev, &ifp->addr, false,
3584: GFP_ATOMIC, NULL);
3585: if (IS_ERR(f6i))
3586: return PTR_ERR(f6i);
3587:
3588: /* ifp->rt can be accessed outside of rtnl */
3589: spin_lock(&ifp->lock);
3590: prev = ifp->rt;
3591: ifp->rt = f6i;
3592: spin_unlock(&ifp->lock);
3593:
3594: fib6_info_release(prev);
3595: }
3596:
3597: if (!(ifp->flags & IFA_F_NOPREFIXROUTE)) {
3598: addrconf_prefix_route(&ifp->addr, ifp->prefix_len,
3599: ifp->rt_priority, idev->dev, 0, 0,
3600: GFP_ATOMIC);
3601: }
3602:
3603: if (ifp->state == INET6_IFADDR_STATE_PREDAD)
3604: addrconf_dad_start(ifp);
3605:
3606: return 0;
3607: }
SourceFile:net/ipv6/addrconf.c]
|
| 20/2 |
2026/05/14 01:21 |
llm |
expert |
0m
Model:
Tokens:
input: 30143
output: 43
thoughts: 403
Thoughts: **Analyzing the Atomic Allocation Path**
Okay, so I see that `GFP_ATOMIC` is being passed all the way down to `alloc_percpu_gfp` through a series of function calls: `addrconf_f6i_alloc` -> `ip6_route_info_create_nh` -> `fib6_nh_init`. `alloc_percpu_gfp` then calls `pcpu_alloc_noprof` with the `GFP_ATOMIC` flag. Since we are using `GFP_ATOMIC`, the `is_atomic` flag within `pcpu_alloc_noprof` will be true. That means the allocation *shouldn't* block, which is expected.
However, I'm slightly concerned, even though it doesn't block, because `pcpu_alloc_noprof` still grabs `spin_lock_irqsave(&pcpu_lock, flags)`. If we're dealing with a large number of chunks, wouldn't there be a potential for some significant lock contention during the search for a free block, even if it's atomic?
Let me review the implementation, here's what `pcpu_alloc_noprof` does:
```c
restart:
/* search through normal chunks */
for (slot = pcpu_size_to_slot(size); slot <= pcpu_free_slot; slot++) {
list_for_each_entry_safe(chunk, next, &pcpu_chunk_lists[slot],
list) {
off = pcpu_find_block_fit(chunk, bits, bit_align,
is_atomic);
if (off < 0) {
if (slot < PCPU_SLOT_FAIL_THRESHOLD)
pcpu_chunk_move(chunk, 0);
continue;
}
```
Now, with `is_atomic` set, `pcpu_find_block_fit` will potentially fail if it requires page population. I should probably dive into the `pcpu_find_block_fit` function to confirm how that is handled.
|
| 21/2 |
2026/05/14 01:21 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:mm/percpu.c IncludeLines:true Name:pcpu_find_block_fit]
Results: map[SourceCode:1091: /**
1092: * pcpu_find_block_fit - finds the block index to start searching
1093: * @chunk: chunk of interest
1094: * @alloc_bits: size of request in allocation units
1095: * @align: alignment of area (max PAGE_SIZE bytes)
1096: * @pop_only: use populated regions only
1097: *
1098: * Given a chunk and an allocation spec, find the offset to begin searching
1099: * for a free region. This iterates over the bitmap metadata blocks to
1100: * find an offset that will be guaranteed to fit the requirements. It is
1101: * not quite first fit as if the allocation does not fit in the contig hint
1102: * of a block or chunk, it is skipped. This errs on the side of caution
1103: * to prevent excess iteration. Poor alignment can cause the allocator to
1104: * skip over blocks and chunks that have valid free areas.
1105: *
1106: * RETURNS:
1107: * The offset in the bitmap to begin searching.
1108: * -1 if no offset is found.
1109: */
1110: static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits,
1111: size_t align, bool pop_only)
1112: {
1113: struct pcpu_block_md *chunk_md = &chunk->chunk_md;
1114: int bit_off, bits, next_off;
1115:
1116: /*
1117: * This is an optimization to prevent scanning by assuming if the
1118: * allocation cannot fit in the global hint, there is memory pressure
1119: * and creating a new chunk would happen soon.
1120: */
1121: if (!pcpu_check_block_hint(chunk_md, alloc_bits, align))
1122: return -1;
1123:
1124: bit_off = pcpu_next_hint(chunk_md, alloc_bits);
1125: bits = 0;
1126: pcpu_for_each_fit_region(chunk, alloc_bits, align, bit_off, bits) {
1127: if (!pop_only || pcpu_is_populated(chunk, bit_off, bits,
1128: &next_off))
1129: break;
1130:
1131: bit_off = next_off;
1132: bits = 0;
1133: }
1134:
1135: if (bit_off == pcpu_chunk_map_bits(chunk))
1136: return -1;
1137:
1138: return bit_off;
1139: }
SourceFile:mm/percpu.c]
|
| 22/2 |
2026/05/14 01:21 |
llm |
expert |
0m
Model:
Tokens:
input: 31875
output: 46
thoughts: 1285
Thoughts: **Analyzing a Kernel Hang During qdisc Setup**
Okay, so I'm diving into this kernel issue where a `taprio` qdisc setup on a `team0` interface is causing a 10-second hang. I see that the kernel function `pcpu_alloc_noprof` is involved, and I'm trying to understand its behavior within the context of the problem. If `is_atomic` is true, then `pcpu_alloc_noprof` does NOT loop infinitely. It searches once and fails. This rules out an infinite loop within that particular function as the direct cause of the hang, but I have to consider that a caller might loop and that could be the problem.
My initial thought was that a huge number of per-CPU areas could contribute to the hang, but now I suspect that there are a lot of iterations. So, I checked the callers. Let's trace it back: `pcpu_alloc_noprof` is called by `pcpu_alloc_area`. `pcpu_alloc_area` succeeds in an atomic way and returns. Okay, so now I start checking callers. `pcpu_alloc_area` is called by `alloc_percpu_gfp`. `alloc_percpu_gfp` is called by `fib6_nh_init`. I checked further and see that `ip6_route_info_create_nh` calls `fib6_nh_init`. Then `addrconf_f6i_alloc` calls `ip6_route_info_create_nh`. Finally, `fixup_permanent_addr` calls `addrconf_f6i_alloc`. The kicker is that `addrconf_permanent_addr` calls `fixup_permanent_addr` in a loop over `idev->addr_list`.
This loop on `idev->addr_list` is a red flag. Could it be a *massive* number of addresses? If so, `addrconf_permanent_addr` could be holding `write_lock_bh(&idev->lock)` for a prolonged time, effectively disabling softirqs and potentially triggering an RCU stall if the lock is held for 10 seconds. But why would there be so many addresses? I thought that the root cause was the qdisc setup, so this is confusing. Could an unprivileged user add tons of IPv6 addresses? While that's normally protected by `CAP_NET_ADMIN` requirements, I am focused on the `qdisc` setup, so I am trying to determine the connection.
I checked the reproducer: it uses `RTM_NEWQDISC` not `RTM_NEWADDR`, so that route seems wrong. I'm looking back at the process and trying to align the stack trace with what the reproducer is doing. I see that the reproducer creates a netlink socket and sends `RTM_NEWQDISC` to set up `taprio` on `team0`. Does `taprio` trigger `NETDEV_UP` or `NETDEV_CHANGE`, perhaps somehow making our massive list? The stack trace shows `do_setlink` -> `rtnl_changelink` -> `__rtnl_newlink` -> `rtnl_newlink`.
Wait, isn't `rtnl_newlink` a `RTM_NEWLINK` message and not `RTM_NEWQDISC`? Let's go back to the reproducer code. The comments *say* `RTM_NEWQDISC`, but let's be sure. Looking closer at the actual bytes, yes, the reproducer explicitly sends the code for `RTM_NEWQDISC` (0x24 = 36). So why is the stack trace showing `rtnl_newlink` then? Something's not lining up between the message being sent and how the kernel is handling it. I need to examine the `rtnetlink_rcv_msg` function in `net/core/rtnetlink.c` and try to understand how it dispatches these netlink messages. This might be the crucial piece of the puzzle.
|
| 23/2 |
2026/05/14 01:21 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/core/rtnetlink.c IncludeLines:true Name:rtnetlink_rcv_msg]
Results: map[SourceCode:6847: static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
6848: struct netlink_ext_ack *extack)
6849: {
6850: struct net *net = sock_net(skb->sk);
6851: struct rtnl_link *link;
6852: enum rtnl_kinds kind;
6853: struct module *owner;
6854: int err = -EOPNOTSUPP;
6855: rtnl_doit_func doit;
6856: unsigned int flags;
6857: int family;
6858: int type;
6859:
6860: type = nlh->nlmsg_type;
6861: if (type > RTM_MAX)
6862: return -EOPNOTSUPP;
6863:
6864: type -= RTM_BASE;
6865:
6866: /* All the messages must have at least 1 byte length */
6867: if (nlmsg_len(nlh) < sizeof(struct rtgenmsg))
6868: return 0;
6869:
6870: family = ((struct rtgenmsg *)nlmsg_data(nlh))->rtgen_family;
6871: kind = rtnl_msgtype_kind(type);
6872:
6873: if (kind != RTNL_KIND_GET && !netlink_net_capable(skb, CAP_NET_ADMIN))
6874: return -EPERM;
6875:
6876: rcu_read_lock();
6877: if (kind == RTNL_KIND_GET && (nlh->nlmsg_flags & NLM_F_DUMP)) {
6878: struct sock *rtnl;
6879: rtnl_dumpit_func dumpit;
6880: u32 min_dump_alloc = 0;
6881:
6882: link = rtnl_get_link(family, type);
6883: if (!link || !link->dumpit) {
6884: family = PF_UNSPEC;
6885: link = rtnl_get_link(family, type);
6886: if (!link || !link->dumpit)
6887: goto err_unlock;
6888: }
6889: owner = link->owner;
6890: dumpit = link->dumpit;
6891: flags = link->flags;
6892:
6893: if (type == RTM_GETLINK - RTM_BASE)
6894: min_dump_alloc = rtnl_calcit(skb, nlh);
6895:
6896: err = 0;
6897: /* need to do this before rcu_read_unlock() */
6898: if (!try_module_get(owner))
6899: err = -EPROTONOSUPPORT;
6900:
6901: rcu_read_unlock();
6902:
6903: rtnl = net->rtnl;
6904: if (err == 0) {
6905: struct netlink_dump_control c = {
6906: .dump = dumpit,
6907: .min_dump_alloc = min_dump_alloc,
6908: .module = owner,
6909: .flags = flags,
6910: };
6911: err = rtnetlink_dump_start(rtnl, skb, nlh, &c);
6912: /* netlink_dump_start() will keep a reference on
6913: * module if dump is still in progress.
6914: */
6915: module_put(owner);
6916: }
6917: return err;
6918: }
6919:
6920: link = rtnl_get_link(family, type);
6921: if (!link || !link->doit) {
6922: family = PF_UNSPEC;
6923: link = rtnl_get_link(PF_UNSPEC, type);
6924: if (!link || !link->doit)
6925: goto out_unlock;
6926: }
6927:
6928: owner = link->owner;
6929: if (!try_module_get(owner)) {
6930: err = -EPROTONOSUPPORT;
6931: goto out_unlock;
6932: }
6933:
6934: flags = link->flags;
6935: if (kind == RTNL_KIND_DEL && (nlh->nlmsg_flags & NLM_F_BULK) &&
6936: !(flags & RTNL_FLAG_BULK_DEL_SUPPORTED)) {
6937: NL_SET_ERR_MSG(extack, "Bulk delete is not supported");
6938: module_put(owner);
6939: goto err_unlock;
6940: }
6941:
6942: if (flags & RTNL_FLAG_DOIT_UNLOCKED) {
6943: doit = link->doit;
6944: rcu_read_unlock();
6945: if (doit)
6946: err = doit(skb, nlh, extack);
6947: module_put(owner);
6948: return err;
6949: }
6950: rcu_read_unlock();
6951:
6952: rtnl_lock();
6953: link = rtnl_get_link(family, type);
6954: if (link && link->doit)
6955: err = link->doit(skb, nlh, extack);
6956: rtnl_unlock();
6957:
6958: module_put(owner);
6959:
6960: return err;
6961:
6962: out_unlock:
6963: rcu_read_unlock();
6964: return err;
6965:
6966: err_unlock:
6967: rcu_read_unlock();
6968: return -EOPNOTSUPP;
6969: }
SourceFile:net/core/rtnetlink.c]
|
| 24/2 |
2026/05/14 01:21 |
llm |
expert |
0m
Model:
Tokens:
input: 35894
output: 17
thoughts: 1521
Thoughts: **Analysis of RCU Stall Vulnerability in IPv6 Address Handling**
Okay, let's break this down. I see a crash, and I need to understand the root cause. My initial thought is that the message type `RTM_NEWQDISC` (36) is somehow getting misdirected to the `RTM_NEWLINK` handler (`rtnl_newlink`). However, a simple calculation (`36 - 16 = 20`, where 16 is `RTM_BASE`) points to the correct handler, so that's not the primary issue. The stack trace strongly points to `rtnl_newlink`, even though the reproducer seems to be sending an `RTM_NEWQDISC` message. That's a bit odd.
The reproducer's interaction with the socket makes sense β using `AF_NETLINK` and sending a message with type `0x24` (`RTM_NEWQDISC`). However, the fact that `rtnl_newlink` appears in the stack trace while the reproducer _sets_ an integer at an address is throwing me off. This could mean either the reproducer is not the full picture, or it is causing another thread to call `rtnl_newlink`.
Syzkaller's concurrent execution is key here β the reproducer is likely just one part of the puzzle. The stack trace details `rtnl_newlink` calling `do_setlink`, then `netif_change_flags`, which eventually leads to `addrconf_notify` via a chain of notifier calls. This is where things get interesting. `addrconf_notify` calls `addrconf_permanent_addr`, and that's the likely culprit.
`addrconf_permanent_addr` iterates over `idev->addr_list` for "permanent" addresses. This is a crucial detail. It calls `fixup_permanent_addr` for each, which in turn allocates routes with `addrconf_f6i_alloc` using `GFP_ATOMIC`. This allocates percpu memory.
The problem? `addrconf_permanent_addr` holds a `write_lock_bh(&idev->lock)` β disabling softirqs while it iterates and potentially allocates memory for *each* permanent address. If `idev->addr_list` contains an enormous number of permanent addresses, this spinlock will be held for an extended period, leading to an RCU stall. `write_lock_bh` is a spinlock, no `cond_resched()`, nothing to prevent it from stalling!
The question now is, how can an unprivileged user even *get* a huge number of addresses on an interface? Normally, `RTM_NEWADDR` requires `CAP_NET_ADMIN`. But then, user namespaces come to mind! Within a user namespace, you get `CAP_NET_ADMIN` within that namespace. I could create a dummy interface, flood it with millions of IPv6 addresses, bring it up, and bingo, that triggers `NETDEV_UP` which leads to `addrconf_permanent_addr`.
Looking at the code, it confirms my suspicions. The `write_lock_bh` is *not* dropped within the loop. `fixup_permanent_addr` does its work, and it's not until *after* the loop completes, all memory allocation has happened, that the lock is released! So, if I have 100,000 addresses, `fixup_permanent_addr` is called 100,000 times *without dropping the lock*. It's allocating percpu memory with `GFP_ATOMIC` *while holding a spinlock*. That's a textbook recipe for an RCU stall, potential OOM, or allocation failures. I need to check if there is a sysctl to limit the number of IP addresses to prevent this. This is definitely a vulnerability.
|
| 25/2 |
2026/05/14 01:22 |
tool |
grepper |
0m
Args: map[Expression:max_addresses]
Results: map[Output:Documentation/networking/ip-sysctl.rst=2915=regen_max_retry - INTEGER
--
Documentation/networking/ip-sysctl.rst-2920-
Documentation/networking/ip-sysctl.rst:2921:max_addresses - INTEGER
Documentation/networking/ip-sysctl.rst-2922- Maximum number of autoconfigured addresses per interface. Setting
--
include/linux/ipv6.h=13=struct ipv6_devconf {
--
include/linux/ipv6.h-41- __s32 max_desync_factor;
include/linux/ipv6.h:42: __s32 max_addresses;
include/linux/ipv6.h-43- __s32 accept_ra_defrtr;
--
net/ipv6/addrconf.c=180=static struct ipv6_devconf ipv6_devconf __read_mostly = {
--
net/ipv6/addrconf.c-200- .max_desync_factor = MAX_DESYNC_FACTOR,
net/ipv6/addrconf.c:201: .max_addresses = IPV6_MAX_ADDRESSES,
net/ipv6/addrconf.c-202- .accept_ra_defrtr = 1,
--
net/ipv6/addrconf.c=245=static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
--
net/ipv6/addrconf.c-265- .max_desync_factor = MAX_DESYNC_FACTOR,
net/ipv6/addrconf.c:266: .max_addresses = IPV6_MAX_ADDRESSES,
net/ipv6/addrconf.c-267- .accept_ra_defrtr = 1,
--
net/ipv6/addrconf.c=2163=void addrconf_dad_failure(struct sk_buff *skb, struct inet6_ifaddr *ifp)
--
net/ipv6/addrconf.c-2166- struct net *net = dev_net(idev->dev);
net/ipv6/addrconf.c:2167: int max_addresses;
net/ipv6/addrconf.c-2168-
--
net/ipv6/addrconf.c-2204-
net/ipv6/addrconf.c:2205: max_addresses = READ_ONCE(idev->cnf.max_addresses);
net/ipv6/addrconf.c:2206: if (max_addresses &&
net/ipv6/addrconf.c:2207: ipv6_count_addresses(idev) >= max_addresses)
net/ipv6/addrconf.c-2208- goto lock_errdad;
--
net/ipv6/addrconf.c=2672=int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
--
net/ipv6/addrconf.c-2682- if (!ifp && valid_lft) {
net/ipv6/addrconf.c:2683: int max_addresses = READ_ONCE(in6_dev->cnf.max_addresses);
net/ipv6/addrconf.c-2684- struct ifa6_config cfg = {
--
net/ipv6/addrconf.c-2703- */
net/ipv6/addrconf.c:2704: if (!max_addresses ||
net/ipv6/addrconf.c:2705: ipv6_count_addresses(in6_dev) < max_addresses)
net/ipv6/addrconf.c-2706- ifp = ipv6_add_addr(in6_dev, &cfg, false, NULL);
--
net/ipv6/addrconf.c=5627=static void ipv6_store_devconf(const struct ipv6_devconf *cnf,
--
net/ipv6/addrconf.c-5656- array[DEVCONF_MAX_DESYNC_FACTOR] = READ_ONCE(cnf->max_desync_factor);
net/ipv6/addrconf.c:5657: array[DEVCONF_MAX_ADDRESSES] = READ_ONCE(cnf->max_addresses);
net/ipv6/addrconf.c-5658- array[DEVCONF_ACCEPT_RA_DEFRTR] = READ_ONCE(cnf->accept_ra_defrtr);
--
net/ipv6/addrconf.c=6820=static const struct ctl_table addrconf_sysctl[] = {
--
net/ipv6/addrconf.c-6966- {
net/ipv6/addrconf.c:6967: .procname = "max_addresses",
net/ipv6/addrconf.c:6968: .data = &ipv6_devconf.max_addresses,
net/ipv6/addrconf.c-6969- .maxlen = sizeof(int),
]
|
| 26/2 |
2026/05/14 01:22 |
llm |
expert |
0m
Model:
Tokens:
input: 39541
output: 44
thoughts: 59
Thoughts: Okay, here's my take on those thoughts, framed as my own:
**Investigating the Scope of `max_addresses`**
Right, so I'm digging into this `max_addresses` sysctl variable. The documentation is pretty clear β it's all about the *autoconfigured* addresses. "Maximum number of autoconfigured addresses per interface," it says. But that immediately raises a question for me: does this *only* apply to addresses the system configures itself, or does it also restrict addresses I add manually?
That's a crucial distinction, and I need to be absolutely certain. The implications for network management could be significant if it limits both. Okay, time to dive into the code. Let's start by checking out how the kernel handles `RTM_NEWADDR` messages, specifically within the `inet6_addr_add` function. That's the logical place to start looking for the address addition logic and any associated checks. This should clarify if there's a distinction in handling between autoconfigured and manually added addresses. I need to be sure before I make any decisions based on this setting.
|
| 27/2 |
2026/05/14 01:22 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/addrconf.c IncludeLines:true Name:inet6_addr_add]
Results: map[SourceCode:3010: /*
3011: * Manual configuration of address on an interface
3012: */
3013: static int inet6_addr_add(struct net *net, struct net_device *dev,
3014: struct ifa6_config *cfg, clock_t expires, u32 flags,
3015: struct netlink_ext_ack *extack)
3016: {
3017: struct inet6_ifaddr *ifp;
3018: struct inet6_dev *idev;
3019:
3020: ASSERT_RTNL_NET(net);
3021:
3022: if (cfg->plen > 128) {
3023: NL_SET_ERR_MSG_MOD(extack, "Invalid prefix length");
3024: return -EINVAL;
3025: }
3026:
3027: if (cfg->ifa_flags & IFA_F_MANAGETEMPADDR && cfg->plen != 64) {
3028: NL_SET_ERR_MSG_MOD(extack, "address with \"mngtmpaddr\" flag must have a prefix length of 64");
3029: return -EINVAL;
3030: }
3031:
3032: idev = addrconf_add_dev(dev);
3033: if (IS_ERR(idev)) {
3034: NL_SET_ERR_MSG_MOD(extack, "IPv6 is disabled on this device");
3035: return PTR_ERR(idev);
3036: }
3037:
3038: if (cfg->ifa_flags & IFA_F_MCAUTOJOIN) {
3039: int ret = ipv6_mc_config(net->ipv6.mc_autojoin_sk,
3040: true, cfg->pfx, dev->ifindex);
3041:
3042: if (ret < 0) {
3043: NL_SET_ERR_MSG_MOD(extack, "Multicast auto join failed");
3044: return ret;
3045: }
3046: }
3047:
3048: cfg->scope = ipv6_addr_scope(cfg->pfx);
3049:
3050: ifp = ipv6_add_addr(idev, cfg, true, extack);
3051: if (!IS_ERR(ifp)) {
3052: if (!(cfg->ifa_flags & IFA_F_NOPREFIXROUTE)) {
3053: addrconf_prefix_route(&ifp->addr, ifp->prefix_len,
3054: ifp->rt_priority, dev, expires,
3055: flags, GFP_KERNEL);
3056: }
3057:
3058: /* Send a netlink notification if DAD is enabled and
3059: * optimistic flag is not set
3060: */
3061: if (!(ifp->flags & (IFA_F_OPTIMISTIC | IFA_F_NODAD)))
3062: ipv6_ifa_notify(0, ifp);
3063: /*
3064: * Note that section 3.1 of RFC 4429 indicates
3065: * that the Optimistic flag should not be set for
3066: * manually configured addresses
3067: */
3068: addrconf_dad_start(ifp);
3069: if (cfg->ifa_flags & IFA_F_MANAGETEMPADDR)
3070: manage_tempaddrs(idev, ifp, cfg->valid_lft,
3071: cfg->preferred_lft, true, jiffies);
3072: in6_ifa_put(ifp);
3073: addrconf_verify_rtnl(net);
3074: return 0;
3075: } else if (cfg->ifa_flags & IFA_F_MCAUTOJOIN) {
3076: ipv6_mc_config(net->ipv6.mc_autojoin_sk, false,
3077: cfg->pfx, dev->ifindex);
3078: }
3079:
3080: return PTR_ERR(ifp);
3081: }
SourceFile:net/ipv6/addrconf.c]
|
| 28/2 |
2026/05/14 01:22 |
llm |
expert |
0m
Model:
Tokens:
input: 41084
output: 44
thoughts: 32
Thoughts: Here's my thought process, as it stands:
**Diving into IPv6 Address Addition**
Okay, so `inet6_addr_add` seems to be the entry point here for adding IPv6 addresses. Interesting. The code suggests it's calling `ipv6_add_addr` directly. That's a good place to start digging deeper. It makes sense to go straight to the core function and see what it's doing under the hood, instead of wading through any potential abstraction layers in between. Let's see what `ipv6_add_addr` is all about.
|
| 29/2 |
2026/05/14 01:22 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/addrconf.c IncludeLines:true Name:ipv6_add_addr]
Results: map[SourceCode:1067: static struct inet6_ifaddr *
1068: ipv6_add_addr(struct inet6_dev *idev, struct ifa6_config *cfg,
1069: bool can_block, struct netlink_ext_ack *extack)
1070: {
1071: gfp_t gfp_flags = can_block ? GFP_KERNEL : GFP_ATOMIC;
1072: int addr_type = ipv6_addr_type(cfg->pfx);
1073: struct net *net = dev_net(idev->dev);
1074: struct inet6_ifaddr *ifa = NULL;
1075: struct fib6_info *f6i = NULL;
1076: int err = 0;
1077:
1078: if (addr_type == IPV6_ADDR_ANY) {
1079: NL_SET_ERR_MSG_MOD(extack, "Invalid address");
1080: return ERR_PTR(-EADDRNOTAVAIL);
1081: } else if (addr_type & IPV6_ADDR_MULTICAST &&
1082: !(cfg->ifa_flags & IFA_F_MCAUTOJOIN)) {
1083: NL_SET_ERR_MSG_MOD(extack, "Cannot assign multicast address without \"IFA_F_MCAUTOJOIN\" flag");
1084: return ERR_PTR(-EADDRNOTAVAIL);
1085: } else if (!(idev->dev->flags & IFF_LOOPBACK) &&
1086: !netif_is_l3_master(idev->dev) &&
1087: addr_type & IPV6_ADDR_LOOPBACK) {
1088: NL_SET_ERR_MSG_MOD(extack, "Cannot assign loopback address on this device");
1089: return ERR_PTR(-EADDRNOTAVAIL);
1090: }
1091:
1092: if (idev->dead) {
1093: NL_SET_ERR_MSG_MOD(extack, "device is going away");
1094: err = -ENODEV;
1095: goto out;
1096: }
1097:
1098: if (idev->cnf.disable_ipv6) {
1099: NL_SET_ERR_MSG_MOD(extack, "IPv6 is disabled on this device");
1100: err = -EACCES;
1101: goto out;
1102: }
1103:
1104: /* validator notifier needs to be blocking;
1105: * do not call in atomic context
1106: */
1107: if (can_block) {
1108: struct in6_validator_info i6vi = {
1109: .i6vi_addr = *cfg->pfx,
1110: .i6vi_dev = idev,
1111: .extack = extack,
1112: };
1113:
1114: err = inet6addr_validator_notifier_call_chain(NETDEV_UP, &i6vi);
1115: err = notifier_to_errno(err);
1116: if (err < 0)
1117: goto out;
1118: }
1119:
1120: ifa = kzalloc(sizeof(*ifa), gfp_flags | __GFP_ACCOUNT);
1121: if (!ifa) {
1122: err = -ENOBUFS;
1123: goto out;
1124: }
1125:
1126: f6i = addrconf_f6i_alloc(net, idev, cfg->pfx, false, gfp_flags, extack);
1127: if (IS_ERR(f6i)) {
1128: err = PTR_ERR(f6i);
1129: f6i = NULL;
1130: goto out;
1131: }
1132:
1133: neigh_parms_data_state_setall(idev->nd_parms);
1134:
1135: ifa->addr = *cfg->pfx;
1136: if (cfg->peer_pfx)
1137: ifa->peer_addr = *cfg->peer_pfx;
1138:
1139: spin_lock_init(&ifa->lock);
1140: INIT_DELAYED_WORK(&ifa->dad_work, addrconf_dad_work);
1141: INIT_HLIST_NODE(&ifa->addr_lst);
1142: ifa->scope = cfg->scope;
1143: ifa->prefix_len = cfg->plen;
1144: ifa->rt_priority = cfg->rt_priority;
1145: ifa->flags = cfg->ifa_flags;
1146: ifa->ifa_proto = cfg->ifa_proto;
1147: /* No need to add the TENTATIVE flag for addresses with NODAD */
1148: if (!(cfg->ifa_flags & IFA_F_NODAD))
1149: ifa->flags |= IFA_F_TENTATIVE;
1150: ifa->valid_lft = cfg->valid_lft;
1151: ifa->prefered_lft = cfg->preferred_lft;
1152: ifa->cstamp = ifa->tstamp = jiffies;
1153: ifa->tokenized = false;
1154:
1155: ifa->rt = f6i;
1156:
1157: ifa->idev = idev;
1158: in6_dev_hold(idev);
1159:
1160: /* For caller */
1161: refcount_set(&ifa->refcnt, 1);
1162:
1163: rcu_read_lock();
1164:
1165: err = ipv6_add_addr_hash(idev->dev, ifa);
1166: if (err < 0) {
1167: rcu_read_unlock();
1168: goto out;
1169: }
1170:
1171: write_lock_bh(&idev->lock);
1172:
1173: /* Add to inet6_dev unicast addr list. */
1174: ipv6_link_dev_addr(idev, ifa);
1175:
1176: if (ifa->flags&IFA_F_TEMPORARY) {
1177: list_add(&ifa->tmp_list, &idev->tempaddr_list);
1178: in6_ifa_hold(ifa);
1179: }
1180:
1181: in6_ifa_hold(ifa);
1182: write_unlock_bh(&idev->lock);
1183:
1184: rcu_read_unlock();
1185:
1186: inet6addr_notifier_call_chain(NETDEV_UP, ifa);
1187: out:
1188: if (unlikely(err < 0)) {
1189: fib6_info_release(f6i);
1190:
1191: if (ifa) {
1192: if (ifa->idev)
1193: in6_dev_put(ifa->idev);
1194: kfree(ifa);
1195: }
1196: ifa = ERR_PTR(err);
1197: }
1198:
1199: return ifa;
1200: }
SourceFile:net/ipv6/addrconf.c]
|
| 30/2 |
2026/05/14 01:22 |
llm |
expert |
0m
Model:
Tokens:
input: 43401
output: 43
thoughts: 1154
Thoughts: **RCU Stall Vulnerability Analysis**
Okay, so I've stumbled upon something interesting and potentially quite nasty in the IPv6 address handling within the kernel. My initial thought was, "Wait, `ipv6_add_addr` doesn't check `max_addresses`?" This immediately raised a red flag. The `max_addresses` limit seems to be enforced only in specific contexts: `addrconf_dad_failure` and `addrconf_prefix_rcv_add_addr`. This suggests that a malicious actor, with the necessary `CAP_NET_ADMIN` privileges, could potentially add an unlimited number of IPv6 addresses using `RTM_NEWADDR`!
I double-checked to see if there were any other implicit limits in `inet6_addr_add` or `ipv6_add_addr`, and nope, nothing obvious. This means a privileged user, say, inside a container with `CAP_NET_ADMIN`, could indeed flood an interface with millions of IPv6 addresses.
The next critical piece of the puzzle is what happens when that interface goes down and then back up. `addrconf_permanent_addr` gets called on `NETDEV_UP`. This routine then iterates through *all* those millions of added addresses while holding a `write_lock_bh(&idev->lock)`. That's a textbook recipe for an RCU stall! The sheer volume of operations within a critical section, combined with the RCU read-side critical section not able to run will lead to this stall.
Now, let's confirm if `addrconf_permanent_addr` is called on `NETDEV_UP`. I saw that `addrconf_notify` has the logic to trigger it on `NETDEV_UP` under specific conditions (not disabled IPv6, no IFF_NO_ADDRCONF).
My brain started racing, thinking about the attack surface. It *is* possible to trigger `NETDEV_UP` from an unprivileged user namespace. I can create a user namespace, then a network namespace inside it. Inside that namespace, I'll have `CAP_NET_ADMIN`. I could create a dummy interface or even use `lo`, then add millions of IPv6 addresses using `RTM_NEWADDR`. I can then bring the interface down and back up using `RTM_NEWLINK` with `IFF_UP`. This triggers `NETDEV_UP`, which calls `addrconf_permanent_addr`.
`addrconf_permanent_addr` would then loop over *every single* address, and for each calls `fixup_permanent_addr`. `fixup_permanent_addr` would then call `addrconf_f6i_alloc` with `GFP_ATOMIC`. This calls `ip6_route_info_create_nh`, which calls `fib6_nh_init`, which then calls `alloc_percpu_gfp(..., GFP_ATOMIC)`. This is where it gets particularly nasty.
It's allocating percpu memory for *each* address. While the use of `GFP_ATOMIC` prevents blocking, it *will* acquire `spin_lock_irqsave(&pcpu_lock, flags)`. With millions of addresses, this spinlock will be held for an extended period, leading to a guaranteed RCU stall. Furthermore, it might exhaust the percpu memory, resulting in atomic allocation failures, but the RCU stall is the immediate and most dangerous consequence.
Now, let's step back and look at the reproducer. It uses `RTM_NEWQDISC` for `taprio` on `team0`. Does this trigger `NETDEV_UP`? Looking at the stack trace, I see that it is `RTM_NEWLINK`, not `RTM_NEWQDISC`.
So, the reproducer either has `RTM_NEWLINK` in another thread, or syzkaller might be sending `RTM_NEWLINK` while the reproducer is running. Syzkaller frequently sets interface flags up and down. The reproducer might have added many addresses to `team0` before, or maybe syzkaller did it.
Wait, looking at the reproducer again, there's a system call that sends a netlink message:
```c
syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
```
It turns out it sends `RTM_NEWQDIS
|
| 31/2 |
2026/05/14 01:22 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/sched/sch_taprio.c IncludeLines:true Name:taprio_change]
Results: map[SourceCode:1816: static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
1817: struct netlink_ext_ack *extack)
1818: {
1819: struct qdisc_size_table *stab = rtnl_dereference(sch->stab);
1820: struct nlattr *tb[TCA_TAPRIO_ATTR_MAX + 1] = { };
1821: struct sched_gate_list *oper, *admin, *new_admin;
1822: struct taprio_sched *q = qdisc_priv(sch);
1823: struct net_device *dev = qdisc_dev(sch);
1824: struct tc_mqprio_qopt *mqprio = NULL;
1825: unsigned long flags;
1826: u32 taprio_flags;
1827: ktime_t start;
1828: int i, err;
1829:
1830: err = nla_parse_nested_deprecated(tb, TCA_TAPRIO_ATTR_MAX, opt,
1831: taprio_policy, extack);
1832: if (err < 0)
1833: return err;
1834:
1835: if (tb[TCA_TAPRIO_ATTR_PRIOMAP])
1836: mqprio = nla_data(tb[TCA_TAPRIO_ATTR_PRIOMAP]);
1837:
1838: /* The semantics of the 'flags' argument in relation to 'change()'
1839: * requests, are interpreted following two rules (which are applied in
1840: * this order): (1) an omitted 'flags' argument is interpreted as
1841: * zero; (2) the 'flags' of a "running" taprio instance cannot be
1842: * changed.
1843: */
1844: taprio_flags = nla_get_u32_default(tb[TCA_TAPRIO_ATTR_FLAGS], 0);
1845:
1846: /* txtime-assist and full offload are mutually exclusive */
1847: if ((taprio_flags & TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST) &&
1848: (taprio_flags & TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD)) {
1849: NL_SET_ERR_MSG_ATTR(extack, tb[TCA_TAPRIO_ATTR_FLAGS],
1850: "TXTIME_ASSIST and FULL_OFFLOAD are mutually exclusive");
1851: return -EINVAL;
1852: }
1853:
1854: if (q->flags != TAPRIO_FLAGS_INVALID && q->flags != taprio_flags) {
1855: NL_SET_ERR_MSG_MOD(extack,
1856: "Changing 'flags' of a running schedule is not supported");
1857: return -EOPNOTSUPP;
1858: }
1859: q->flags = taprio_flags;
1860:
1861: /* Needed for length_to_duration() during netlink attribute parsing */
1862: taprio_set_picos_per_byte(dev, q, extack);
1863:
1864: err = taprio_parse_mqprio_opt(dev, mqprio, extack, q->flags);
1865: if (err < 0)
1866: return err;
1867:
1868: err = taprio_parse_tc_entries(sch, opt, extack);
1869: if (err)
1870: return err;
1871:
1872: new_admin = kzalloc(sizeof(*new_admin), GFP_KERNEL);
1873: if (!new_admin) {
1874: NL_SET_ERR_MSG(extack, "Not enough memory for a new schedule");
1875: return -ENOMEM;
1876: }
1877: INIT_LIST_HEAD(&new_admin->entries);
1878:
1879: oper = rtnl_dereference(q->oper_sched);
1880: admin = rtnl_dereference(q->admin_sched);
1881:
1882: /* no changes - no new mqprio settings */
1883: if (!taprio_mqprio_cmp(dev, mqprio))
1884: mqprio = NULL;
1885:
1886: if (mqprio && (oper || admin)) {
1887: NL_SET_ERR_MSG(extack, "Changing the traffic mapping of a running schedule is not supported");
1888: err = -ENOTSUPP;
1889: goto free_sched;
1890: }
1891:
1892: if (mqprio) {
1893: err = netdev_set_num_tc(dev, mqprio->num_tc);
1894: if (err)
1895: goto free_sched;
1896: for (i = 0; i < mqprio->num_tc; i++) {
1897: netdev_set_tc_queue(dev, i,
1898: mqprio->count[i],
1899: mqprio->offset[i]);
1900: q->cur_txq[i] = mqprio->offset[i];
1901: }
1902:
1903: /* Always use supplied priority mappings */
1904: for (i = 0; i <= TC_BITMASK; i++)
1905: netdev_set_prio_tc_map(dev, i,
1906: mqprio->prio_tc_map[i]);
1907: }
1908:
1909: err = parse_taprio_schedule(q, tb, new_admin, extack);
1910: if (err < 0)
1911: goto free_sched;
1912:
1913: if (new_admin->num_entries == 0) {
1914: NL_SET_ERR_MSG(extack, "There should be at least one entry in the schedule");
1915: err = -EINVAL;
1916: goto free_sched;
1917: }
1918:
1919: err = taprio_parse_clockid(sch, tb, extack);
1920: if (err < 0)
1921: goto free_sched;
1922:
1923: taprio_update_queue_max_sdu(q, new_admin, stab);
1924:
1925: if (FULL_OFFLOAD_IS_ENABLED(q->flags))
1926: err = taprio_enable_offload(dev, q, new_admin, extack);
1927: else
1928: err = taprio_disable_offload(dev, q, extack);
1929: if (err)
1930: goto free_sched;
1931:
1932: /* Protects against enqueue()/dequeue() */
1933: spin_lock_bh(qdisc_lock(sch));
1934:
1935: if (tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]) {
1936: if (!TXTIME_ASSIST_IS_ENABLED(q->flags)) {
1937: NL_SET_ERR_MSG_MOD(extack, "txtime-delay can only be set when txtime-assist mode is enabled");
1938: err = -EINVAL;
1939: goto unlock;
1940: }
1941:
1942: q->txtime_delay = nla_get_u32(tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]);
1943: }
1944:
1945: if (!TXTIME_ASSIST_IS_ENABLED(q->flags) &&
1946: !FULL_OFFLOAD_IS_ENABLED(q->flags) &&
1947: !hrtimer_active(&q->advance_timer)) {
1948: hrtimer_setup(&q->advance_timer, advance_sched, q->clockid, HRTIMER_MODE_ABS);
1949: }
1950:
1951: err = taprio_get_start_time(sch, new_admin, &start);
1952: if (err < 0) {
1953: NL_SET_ERR_MSG(extack, "Internal error: failed get start time");
1954: goto unlock;
1955: }
1956:
1957: setup_txtime(q, new_admin, start);
1958:
1959: if (TXTIME_ASSIST_IS_ENABLED(q->flags)) {
1960: if (!oper) {
1961: rcu_assign_pointer(q->oper_sched, new_admin);
1962: err = 0;
1963: new_admin = NULL;
1964: goto unlock;
1965: }
1966:
1967: /* Not going to race against advance_sched(), but still */
1968: admin = rcu_replace_pointer(q->admin_sched, new_admin,
1969: lockdep_rtnl_is_held());
1970: if (admin)
1971: call_rcu(&admin->rcu, taprio_free_sched_cb);
1972: } else {
1973: setup_first_end_time(q, new_admin, start);
1974:
1975: /* Protects against advance_sched() */
1976: spin_lock_irqsave(&q->current_entry_lock, flags);
1977:
1978: taprio_start_sched(sch, start, new_admin);
1979:
1980: admin = rcu_replace_pointer(q->admin_sched, new_admin,
1981: lockdep_rtnl_is_held());
1982: if (admin)
1983: call_rcu(&admin->rcu, taprio_free_sched_cb);
1984:
1985: spin_unlock_irqrestore(&q->current_entry_lock, flags);
1986:
1987: if (FULL_OFFLOAD_IS_ENABLED(q->flags))
1988: taprio_offload_config_changed(q);
1989: }
1990:
1991: new_admin = NULL;
1992: err = 0;
1993:
1994: if (!stab)
1995: NL_SET_ERR_MSG_MOD(extack,
1996: "Size table not specified, frame length estimations may be inaccurate");
1997:
1998: unlock:
1999: spin_unlock_bh(qdisc_lock(sch));
2000:
2001: free_sched:
2002: if (new_admin)
2003: call_rcu(&new_admin->rcu, taprio_free_sched_cb);
2004:
2005: return err;
2006: }
SourceFile:net/sched/sch_taprio.c]
|
| 32/2 |
2026/05/14 01:22 |
llm |
expert |
0m
Model:
Tokens:
input: 48771
output: 44
thoughts: 82
Thoughts: Here's my thought process, as if I were considering this code:
**Delving into the Traffic Control Initialization**
Okay, so I'm focusing on this `taprio_change` function. It looks like it's responsible for making some pretty fundamental changes, specifically relating to traffic classes. I see it's calling `netdev_set_num_tc(dev, mqprio->num_tc)` and then `netdev_set_tc_queue`. Hmm, that's interesting. I need to be absolutely certain how the network device is handling these calls because changes like this can ripple through the driver and the stack.
The key question in my mind is, does `netdev_set_num_tc` cause a `NETDEV_CHANGE` event, or perhaps a `NETDEV_UP` event? Understanding that is critical. I need to know if we're dealing with a configuration change that requires the stack to react, or a more fundamental state transition. This will have significant consequences for how the rest of the system responds.
Alright, I'm going to dive right into the `netdev_set_num_tc` function to clarify the behaviour. Let's see what's happening under the hood. Time to dig in and understand those internal calls and how they affect the device state.
|
| 33/2 |
2026/05/14 01:23 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/core/dev.c IncludeLines:true Name:netdev_set_num_tc]
Results: map[SourceCode:3086: int netdev_set_num_tc(struct net_device *dev, u8 num_tc)
3087: {
3088: if (num_tc > TC_MAX_QUEUE)
3089: return -EINVAL;
3090:
3091: #ifdef CONFIG_XPS
3092: netif_reset_xps_queues_gt(dev, 0);
3093: #endif
3094: netdev_unbind_all_sb_channels(dev);
3095:
3096: dev->num_tc = num_tc;
3097: return 0;
3098: }
SourceFile:net/core/dev.c]
|
| 34/2 |
2026/05/14 01:23 |
llm |
expert |
2m
Model:
Tokens:
input: 49393
output: 43
thoughts: 1681
Thoughts: **Analyzing the Network Interface Crash and Potential Denial of Service**
Okay, so I'm looking at this crash, and initially, it seems like the reproducer isn't directly causing it. The stack trace points to `rtnl_newlink` calling `do_setlink`, which handles `RTM_NEWLINK` messages. I initially thought the reproducer's `RTM_NEWQDISC` message was the culprit. However, the stack trace clearly shows `sendto` being the system call involved, not `sendmsg` as the reproducer is utilizing. This suggests the reproducer might be *a* trigger but not *the* direct cause.
The key is that some other process/thread (likely another syzkaller-generated program) sent `RTM_NEWLINK` and changed interface flags, and the crash is happening on CPU 1. This other process had a huge number of IPv6 addresses assigned to the interface. Syzkaller probably added these addresses via `RTM_NEWADDR`. I'm starting to think we might have an issue with the sheer volume of addresses.
There's no apparent limit in `ipv6_add_addr` or `inet6_addr_add` for the number of IPv6 addresses. `addrconf_prefix_rcv_add_addr` does check `max_addresses`, but that's for autoconfigured addresses (RA), and `addrconf_dad_failure` is also limited, but not `inet6_addr_add`. The `dev->ip6_ptr->addr_list` is a linked list, so there shouldn't be a size limit.
So, if an unprivileged user can create a user namespace and a network namespace (which they can), they have `CAP_NET_ADMIN` in the network namespace. They can create a dummy interface, add millions of IPv6 addresses, and then bring the interface up. This triggers `addrconf_permanent_addr`, which iterates through all those addresses. Inside that function, for each address, `fixup_permanent_addr` allocates `fib6_info` and percpu memory with `GFP_ATOMIC` while holding a spinlock. This is where the RCU stall happens because of the long-running loop that disables softirqs.
I'm mentally sketching a script in my head: `unshare -Ur -n`, add a dummy interface, loop to add 100,000 IPv6 addresses, and then `ip link set dummy0 up`. Boom, RCU stall. `NETDEV_UP` will call `addrconf_permanent_addr`. This will take a long time, disable softirqs, and eat a ton of memory.
So, it's a denial-of-service vulnerability. It's accessible from unprivileged processes through user namespaces, but it's not directly exploitable beyond causing an RCU stall. I need to see if `addrconf_ifdown` is another place that is impacted.
|
| 35/2 |
2026/05/14 01:25 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/addrconf.c IncludeLines:true Name:addrconf_ifdown]
Results: map[SourceCode:3840: static int addrconf_ifdown(struct net_device *dev, bool unregister)
3841: {
3842: unsigned long event = unregister ? NETDEV_UNREGISTER : NETDEV_DOWN;
3843: struct net *net = dev_net(dev);
3844: struct inet6_dev *idev;
3845: struct inet6_ifaddr *ifa;
3846: LIST_HEAD(tmp_addr_list);
3847: bool keep_addr = false;
3848: bool was_ready;
3849: int state, i;
3850:
3851: ASSERT_RTNL();
3852:
3853: rt6_disable_ip(dev, event);
3854:
3855: idev = __in6_dev_get(dev);
3856: if (!idev)
3857: return -ENODEV;
3858:
3859: /*
3860: * Step 1: remove reference to ipv6 device from parent device.
3861: * Do not dev_put!
3862: */
3863: if (unregister) {
3864: WRITE_ONCE(idev->dead, 1);
3865:
3866: /* protected by rtnl_lock */
3867: RCU_INIT_POINTER(dev->ip6_ptr, NULL);
3868:
3869: /* Step 1.5: remove snmp6 entry */
3870: snmp6_unregister_dev(idev);
3871:
3872: }
3873:
3874: /* combine the user config with event to determine if permanent
3875: * addresses are to be removed from address hash table
3876: */
3877: if (!unregister && !idev->cnf.disable_ipv6) {
3878: /* aggregate the system setting and interface setting */
3879: int _keep_addr = READ_ONCE(net->ipv6.devconf_all->keep_addr_on_down);
3880:
3881: if (!_keep_addr)
3882: _keep_addr = READ_ONCE(idev->cnf.keep_addr_on_down);
3883:
3884: keep_addr = (_keep_addr > 0);
3885: }
3886:
3887: /* Step 2: clear hash table */
3888: for (i = 0; i < IN6_ADDR_HSIZE; i++) {
3889: struct hlist_head *h = &net->ipv6.inet6_addr_lst[i];
3890:
3891: spin_lock_bh(&net->ipv6.addrconf_hash_lock);
3892: restart:
3893: hlist_for_each_entry_rcu(ifa, h, addr_lst) {
3894: if (ifa->idev == idev) {
3895: addrconf_del_dad_work(ifa);
3896: /* combined flag + permanent flag decide if
3897: * address is retained on a down event
3898: */
3899: if (!keep_addr ||
3900: !(ifa->flags & IFA_F_PERMANENT) ||
3901: addr_is_local(&ifa->addr)) {
3902: hlist_del_init_rcu(&ifa->addr_lst);
3903: goto restart;
3904: }
3905: }
3906: }
3907: spin_unlock_bh(&net->ipv6.addrconf_hash_lock);
3908: }
3909:
3910: write_lock_bh(&idev->lock);
3911:
3912: addrconf_del_rs_timer(idev);
3913:
3914: /* Step 2: clear flags for stateless addrconf, repeated down
3915: * detection
3916: */
3917: was_ready = idev->if_flags & IF_READY;
3918: if (!unregister)
3919: idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY);
3920:
3921: /* Step 3: clear tempaddr list */
3922: while (!list_empty(&idev->tempaddr_list)) {
3923: ifa = list_first_entry(&idev->tempaddr_list,
3924: struct inet6_ifaddr, tmp_list);
3925: list_del(&ifa->tmp_list);
3926: write_unlock_bh(&idev->lock);
3927: spin_lock_bh(&ifa->lock);
3928:
3929: if (ifa->ifpub) {
3930: in6_ifa_put(ifa->ifpub);
3931: ifa->ifpub = NULL;
3932: }
3933: spin_unlock_bh(&ifa->lock);
3934: in6_ifa_put(ifa);
3935: write_lock_bh(&idev->lock);
3936: }
3937:
3938: list_for_each_entry(ifa, &idev->addr_list, if_list)
3939: list_add_tail(&ifa->if_list_aux, &tmp_addr_list);
3940: write_unlock_bh(&idev->lock);
3941:
3942: while (!list_empty(&tmp_addr_list)) {
3943: struct fib6_info *rt = NULL;
3944: bool keep;
3945:
3946: ifa = list_first_entry(&tmp_addr_list,
3947: struct inet6_ifaddr, if_list_aux);
3948: list_del(&ifa->if_list_aux);
3949:
3950: addrconf_del_dad_work(ifa);
3951:
3952: keep = keep_addr && (ifa->flags & IFA_F_PERMANENT) &&
3953: !addr_is_local(&ifa->addr);
3954:
3955: spin_lock_bh(&ifa->lock);
3956:
3957: if (keep) {
3958: /* set state to skip the notifier below */
3959: state = INET6_IFADDR_STATE_DEAD;
3960: ifa->state = INET6_IFADDR_STATE_PREDAD;
3961: if (!(ifa->flags & IFA_F_NODAD))
3962: ifa->flags |= IFA_F_TENTATIVE;
3963:
3964: rt = ifa->rt;
3965: ifa->rt = NULL;
3966: } else {
3967: state = ifa->state;
3968: ifa->state = INET6_IFADDR_STATE_DEAD;
3969: }
3970:
3971: spin_unlock_bh(&ifa->lock);
3972:
3973: if (rt)
3974: ip6_del_rt(net, rt, false);
3975:
3976: if (state != INET6_IFADDR_STATE_DEAD) {
3977: __ipv6_ifa_notify(RTM_DELADDR, ifa);
3978: inet6addr_notifier_call_chain(NETDEV_DOWN, ifa);
3979: } else {
3980: if (idev->cnf.forwarding)
3981: addrconf_leave_anycast(ifa);
3982: addrconf_leave_solict(ifa->idev, &ifa->addr);
3983: }
3984:
3985: if (!keep) {
3986: write_lock_bh(&idev->lock);
3987: list_del_rcu(&ifa->if_list);
3988: write_unlock_bh(&idev->lock);
3989: in6_ifa_put(ifa);
3990: }
3991: }
3992:
3993: /* Step 5: Discard anycast and multicast list */
3994: if (unregister) {
3995: ipv6_ac_destroy_dev(idev);
3996: ipv6_mc_destroy_dev(idev);
3997: } else if (was_ready) {
3998: ipv6_mc_down(idev);
3999: }
4000:
4001: WRITE_ONCE(idev->tstamp, jiffies);
4002: idev->ra_mtu = 0;
4003:
4004: /* Last: Shot the device (if unregistered) */
4005: if (unregister) {
4006: addrconf_sysctl_unregister(idev);
4007: neigh_parms_release(&nd_tbl, idev->nd_parms);
4008: neigh_ifdown(&nd_tbl, dev);
4009: in6_dev_put(idev);
4010: }
4011: return 0;
4012: }
SourceFile:net/ipv6/addrconf.c]
|
| 36/2 |
2026/05/14 01:25 |
llm |
expert |
0m
Model:
Tokens:
input: 54358
output: 45
thoughts: 1043
Thoughts: **Analysis of a Potential Denial of Service Vulnerability in IPv6 Address Configuration**
Okay, here's what I've got. It seems like I've stumbled upon a potential denial-of-service vulnerability related to IPv6 address configuration in the kernel.
Looking at the code, specifically the `addrconf_ifdown` function, I see that it cleverly drops the lock (`idev->lock`) before iterating over the temporary address list. This prevents RCU stalls, or at least mitigates the risk by not holding the spinlock for the whole loop. That's good practice. However, `addrconf_permanent_addr` doesn't follow suit. It *holds* the `write_lock_bh(&idev->lock)` for the *entire* loop over `idev->addr_list`. And within this loop, it calls `fixup_permanent_addr`, which does memory allocations using `GFP_ATOMIC`. That's the problem. That's a definite bug.
The way I see it, someone could exploit this by creating a user namespace and a network namespace, which they can do without being root. Then, with `CAP_NET_ADMIN` privileges in that namespace, they create a dummy interface. The trick is to then add a huge number of IPv6 addresses to this interface using `RTM_NEWADDR`. Bring the interface up and `addrconf_permanent_addr` is called, iterating through *all* those addresses while holding the spinlock, and performing `GFP_ATOMIC` allocations.
The immediate consequence is an RCU stall, likely leading to soft lockups and possibly even atomic allocation failures. It's a straightforward denial of service, but not exploitable in the traditional sense, as there's no memory corruption. It's just a long loop holding a spinlock and doing memory allocations.
Now, the interesting thing is that `CAP_NET_ADMIN` in a user namespace is *sufficient* for this, due to the way `RTM_NEWADDR` and `netlink_net_capable` are implemented. It ultimately checks `ns_capable(net->user_ns, CAP_NET_ADMIN)`. So this isn't root-only, which makes it worse.
I've also double-checked for any limits. There's no limit on the number of netlink messages a user can send, and no limit (within the user's memory cgroup) on the number of IPv6 addresses they can add to an interface. `ipv6_add_addr` doesn't check for a maximum number of addresses.
The memory cgroup limits the overall memory use, but even with a relatively small memory limit (say, 50MB), someone could still add a substantial number of addresses. Each `struct inet6_ifaddr` consumes around 200 bytes, which would translate to hundreds of thousands of addresses. Iterating over all those addresses and allocating `GFP_ATOMIC` memory for each one is going to cause a massive RCU stall, guaranteed. And I confirmed `fib6_info` is also accounted to the memory cgroup as well.
So, the issue is that it's possible to exhaust the system with `GFP_ATOMIC` allocations, even under memory cgroup limits. The fix is obvious: collect the addresses to a temporary list, drop the lock, and process them like in `addrconf_ifdown`, or drop the lock inside the loop within `addrconf_permanent_addr`.
|
| 37/2 |
2026/05/14 01:26 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/route.c IncludeLines:true Name:ip6_route_info_create]
Results: map[SourceCode:3787: static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
3788: gfp_t gfp_flags,
3789: struct netlink_ext_ack *extack)
3790: {
3791: struct net *net = cfg->fc_nlinfo.nl_net;
3792: struct fib6_table *table;
3793: struct fib6_info *rt;
3794: int err;
3795:
3796: if (cfg->fc_nlinfo.nlh &&
3797: !(cfg->fc_nlinfo.nlh->nlmsg_flags & NLM_F_CREATE)) {
3798: table = fib6_get_table(net, cfg->fc_table);
3799: if (!table) {
3800: pr_warn("NLM_F_CREATE should be specified when creating new route\n");
3801: table = fib6_new_table(net, cfg->fc_table);
3802: }
3803: } else {
3804: table = fib6_new_table(net, cfg->fc_table);
3805: }
3806: if (!table) {
3807: err = -ENOBUFS;
3808: goto err;
3809: }
3810:
3811: rt = fib6_info_alloc(gfp_flags, !cfg->fc_nh_id);
3812: if (!rt) {
3813: err = -ENOMEM;
3814: goto err;
3815: }
3816:
3817: rt->fib6_metrics = ip_fib_metrics_init(cfg->fc_mx, cfg->fc_mx_len,
3818: extack);
3819: if (IS_ERR(rt->fib6_metrics)) {
3820: err = PTR_ERR(rt->fib6_metrics);
3821: goto free;
3822: }
3823:
3824: if (cfg->fc_flags & RTF_ADDRCONF)
3825: rt->dst_nocount = true;
3826:
3827: if (cfg->fc_flags & RTF_EXPIRES)
3828: fib6_set_expires(rt, jiffies +
3829: clock_t_to_jiffies(cfg->fc_expires));
3830:
3831: if (cfg->fc_protocol == RTPROT_UNSPEC)
3832: cfg->fc_protocol = RTPROT_BOOT;
3833:
3834: rt->fib6_protocol = cfg->fc_protocol;
3835: rt->fib6_table = table;
3836: rt->fib6_metric = cfg->fc_metric;
3837: rt->fib6_type = cfg->fc_type ? : RTN_UNICAST;
3838: rt->fib6_flags = cfg->fc_flags & ~RTF_GATEWAY;
3839:
3840: ipv6_addr_prefix(&rt->fib6_dst.addr, &cfg->fc_dst, cfg->fc_dst_len);
3841: rt->fib6_dst.plen = cfg->fc_dst_len;
3842:
3843: #ifdef CONFIG_IPV6_SUBTREES
3844: ipv6_addr_prefix(&rt->fib6_src.addr, &cfg->fc_src, cfg->fc_src_len);
3845: rt->fib6_src.plen = cfg->fc_src_len;
3846: #endif
3847: return rt;
3848: free:
3849: kfree(rt);
3850: err:
3851: return ERR_PTR(err);
3852: }
SourceFile:net/ipv6/route.c]
|
| 38/2 |
2026/05/14 01:26 |
llm |
expert |
0m
Model:
Tokens:
input: 57305
output: 43
thoughts: 58
Thoughts: **Examining the Memory Allocation in IPv6 Routing Information**
Okay, so I'm looking at `fib6_info_alloc` here. It's using `kzalloc` with those `gfp_flags`. Interesting. Now, I recall seeing `addrconf_f6i_alloc` β that function uses `GFP_ATOMIC`. This triggers a thoughtβ¦ is `fib6_info_alloc` internally using `__GFP_ACCOUNT`? I need to quickly determine if memory accounting is involved here, given the atomic context observed in the other allocation.
|
| 39/2 |
2026/05/14 01:26 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:net/ipv6/route.c IncludeLines:true Name:fib6_info_alloc]
Results: map[SourceCode: 147: struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh)
148: {
149: struct fib6_info *f6i;
150: size_t sz = sizeof(*f6i);
151:
152: if (with_fib6_nh)
153: sz += sizeof(struct fib6_nh);
154:
155: f6i = kzalloc(sz, gfp_flags);
156: if (!f6i)
157: return NULL;
158:
159: /* fib6_siblings is a union with nh_list, so this initializes both */
160: INIT_LIST_HEAD(&f6i->fib6_siblings);
161: refcount_set(&f6i->fib6_ref, 1);
162:
163: INIT_HLIST_NODE(&f6i->gc_link);
164:
165: return f6i;
166: }
SourceFile:net/ipv6/ip6_fib.c]
|
| 40/2 |
2026/05/14 01:26 |
llm |
expert |
0m
Model:
Tokens:
input: 57865
output: 21
thoughts: 4642
Thoughts: **Analysis of Potential RCU Stall in IPv6 Address Configuration**
Okay, so I've been tracing through this code, and it seems like the issue stems from how IPv6 addresses are managed, specifically in the context of network device bring-up and permanent addresses. My initial thought was that `fib6_info` allocations using `__GFP_ACCOUNT` were the culprits, but that's not quite right. Instead, it's the `GFP_ATOMIC` allocations within `fixup_permanent_addr` that are creating the problem, and those aren't accounted for within the memory cgroup.
The core issue appears to be a Denial of Service vulnerability: an unprivileged user, given `CAP_NET_ADMIN` within a user namespace, can trigger an RCU stall. The mechanism is this: bringing up a network interface (`NETDEV_UP`) with a large number of *permanent* IPv6 addresses configured leads to a loop within `addrconf_permanent_addr`. This loop iterates through `idev->addr_list`, which contains permanent addresses. For *each* address, `fixup_permanent_addr` gets called. `fixup_permanent_addr` calls `addrconf_f6i_alloc`, which in turn calls `alloc_percpu_gfp`. Because `GFP_ATOMIC` is used, the allocation *doesn't* account to the memory cgroup. The new `fib6_info` replaces the old one, and the old one is freed (correctly), but the problem is the loop itself, holding `write_lock_bh(&idev->lock)` for a prolonged time.
Now, even though the old `fib6_info` gets released, the key is the sheer *number* of iterations. Allocating and releasing `fib6_info` multiple times while holding a lock on the `idev` structure will cause an RCU stall.
I initially thought that `alloc_percpu_gfp` itself might be the problem, since it utilizes `GFP_ATOMIC`. I explored the possibility of this failing and returning `NULL`, triggering memory corruption, but it turns out the code gracefully handles allocation failures. The problem becomes RCU stall.
The question then, is how can this be triggered? Receiving router advertisements (`RTM_NEWADDR`)? Only `RTM_NEWADDR` can add millions of addresses and requires `CAP_NET_ADMIN`. Changing `max_addresses`? Nope, the code doesn't check it. Bringing up the interface (`NETDEV_UP`) is the key, but it requires `CAP_NET_ADMIN` in the user namespace.
So, the critical factor is the ability to populate `idev->addr_list` with a substantial number of permanent addresses. The provided reproducer likely doesn't *directly* add millions of addresses within the syscalls it makes, but it seems syzkaller (or the environment in which it's running) is doing that, or possibly executing the reproducer multiple times and adding addresses each time. This then combined with an `RTM_NEWQDISC`, or the triggering of `NETDEV_UP` causes the stall by looping through the addresses already in `idev->addr_list`, holding the lock for a prolonged duration. The memory allocation is *not* what causes the RCU stall, but rather the repeated operations on the locked data structure.
|
| 41/2 |
2026/05/14 01:27 |
tool |
grepper |
0m
Args: map[Expression:RTM_NEWQDISC]
Results: map[Output:include/uapi/linux/rtnetlink.h=24=enum {
--
include/uapi/linux/rtnetlink.h-64-
include/uapi/linux/rtnetlink.h:65: RTM_NEWQDISC = 36,
include/uapi/linux/rtnetlink.h:66:#define RTM_NEWQDISC RTM_NEWQDISC
include/uapi/linux/rtnetlink.h-67- RTM_DELQDISC,
--
net/sched/sch_api.c=992=static int qdisc_get_notify(struct net *net, struct sk_buff *oskb,
--
net/sched/sch_api.c-1004- if (tc_fill_qdisc(skb, q, clid, portid, n->nlmsg_seq, 0,
net/sched/sch_api.c:1005: RTM_NEWQDISC, extack) < 0)
net/sched/sch_api.c-1006- goto err_out;
--
net/sched/sch_api.c=1018=static int qdisc_notify(struct net *net, struct sk_buff *oskb,
--
net/sched/sch_api.c-1039- if (tc_fill_qdisc(skb, new, clid, portid, n->nlmsg_seq,
net/sched/sch_api.c:1040: old ? NLM_F_REPLACE : 0, RTM_NEWQDISC, extack) < 0)
net/sched/sch_api.c-1041- goto err_out;
--
net/sched/sch_api.c=1818=static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
--
net/sched/sch_api.c-1836- cb->nlh->nlmsg_seq, NLM_F_MULTI,
net/sched/sch_api.c:1837: RTM_NEWQDISC, NULL) <= 0)
net/sched/sch_api.c-1838- goto done;
--
net/sched/sch_api.c-1858- cb->nlh->nlmsg_seq, NLM_F_MULTI,
net/sched/sch_api.c:1859: RTM_NEWQDISC, NULL) <= 0)
net/sched/sch_api.c-1860- goto done;
--
net/sched/sch_api.c=2480=static const struct rtnl_msg_handler psched_rtnl_msg_handlers[] __initconst = {
net/sched/sch_api.c:2481: {.msgtype = RTM_NEWQDISC, .doit = tc_modify_qdisc},
net/sched/sch_api.c-2482- {.msgtype = RTM_DELQDISC, .doit = tc_get_qdisc},
--
net/sched/sch_fifo.c=231=int fifo_set_limit(struct Qdisc *q, unsigned int limit)
--
net/sched/sch_fifo.c-244- if (nla) {
net/sched/sch_fifo.c:245: nla->nla_type = RTM_NEWQDISC;
net/sched/sch_fifo.c-246- nla->nla_len = nla_attr_size(sizeof(struct tc_fifo_qopt));
--
security/selinux/nlmsgtab.c=28=static const struct nlmsg_perm nlmsg_route_perms[] = {
--
security/selinux/nlmsgtab.c-44- { RTM_GETRULE, NETLINK_ROUTE_SOCKET__NLMSG_READ },
security/selinux/nlmsgtab.c:45: { RTM_NEWQDISC, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
security/selinux/nlmsgtab.c-46- { RTM_DELQDISC, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
--
tools/lib/bpf/netlink.c=619=static int tc_qdisc_create_excl(struct bpf_tc_hook *hook)
tools/lib/bpf/netlink.c-620-{
tools/lib/bpf/netlink.c:621: return tc_qdisc_modify(hook, RTM_NEWQDISC, NLM_F_CREATE | NLM_F_EXCL);
tools/lib/bpf/netlink.c-622-}
--
tools/testing/selftests/bpf/prog_tests/tc_links.c=1798=static int qdisc_replace(int ifindex, const char *kind, bool block)
--
tools/testing/selftests/bpf/prog_tests/tc_links.c-1810- req.n.nlmsg_flags = NLM_F_CREATE | NLM_F_REPLACE | NLM_F_REQUEST;
tools/testing/selftests/bpf/prog_tests/tc_links.c:1811: req.n.nlmsg_type = RTM_NEWQDISC;
tools/testing/selftests/bpf/prog_tests/tc_links.c-1812- req.t.tcm_family = AF_UNSPEC;
]
|
| 42/2 |
2026/05/14 01:27 |
llm |
expert |
0m
Model:
Tokens:
input: 64620
output: 66
thoughts: 632
Thoughts: **My Analysis of the Kernel Crash**
Okay, let's break this down. The reproducer from syzkaller is sending `RTM_NEWQDISC` (opcode 36, I confirmed). However, the stack trace indicates the crash is in `rtnl_newlink`. This immediately tells me the reproducer *itself* isn't the direct cause. Syzkaller's parallelism can be tricky; it's likely the crash was triggered by a separate program sending `RTM_NEWLINK`, and the reproducer happened to be running concurrently. Or perhaps the minimization failed to capture the complete triggering sequence.
Could there be an indirect path? Does `RTM_NEWQDISC` somehow lead to a call to `rtnl_newlink`? No, that's not how it works. `rtnl_newlink` is a netlink message handler, called directly via `rtnetlink_rcv_msg`. So the reproducer *definitely* isn't the culprit, or at least it's an incomplete trace of the real problem.
The bug, however, is clear. The code in `addrconf_permanent_addr` is looping over `idev->addr_list`, holding a spinlock (`write_lock_bh(&idev->lock)`). This is a red flag. The iteration and the spinlock will cause an RCU stall, especially if `idev->addr_list` is large. And, crucially, there's no limit imposed on the number of addresses an unprivileged user can add within a user namespace. That's the vulnerability.
Here's the distilled summary for the final output:
* **Bug:** `addrconf_permanent_addr` holds a spinlock (`write_lock_bh(&idev->lock)`) while iterating over all IPv6 addresses on an interface. Within each iteration, `fixup_permanent_addr` is called which allocates memory, using `GFP_ATOMIC` in this case (both `fib6_info` and percpu memory).
* **Trigger:** An unprivileged user can leverage the ability to create a user and network namespace. They can gain `CAP_NET_ADMIN` privileges within this user namespace. They then add an arbitrarily large number of IPv6 addresses to a dummy interface using `RTM_NEWADDR`. Bringing the interface up (`RTM_NEWLINK` with `IFF_UP`) then triggers `NETDEV_UP`, which calls `addrconf_permanent_addr`.
* **Impact:** The lengthy loop holding a spinlock disables softirqs and creates an RCU stall, leading to a Denial of Service. It also has the potential to cause atomic memory allocation failures.
* **Exploitable:** Just a DoS, no privilege escalation.
* **Accessibility:**
* Unprivileged processes: No, requires `CAP_NET_ADMIN`.
* User namespaces: Yes, `CAP_NET_ADMIN` within a user namespace is sufficient.
* No triggers from VMs, Ethernet, Remote, Peripherals or Malicious filesystems.
I'll use the `set-results` tool to finalize the report.
|
| 43/2 |
2026/05/14 01:27 |
tool |
set-results |
0m
Args: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:true VMGuestTrigger:false VMHostTrigger:false]
Results: map[DenialOfService:true Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:true VMGuestTrigger:false VMHostTrigger:false]
|
| 44/2 |
2026/05/14 01:27 |
llm |
expert |
0m
Model:
Tokens:
input: 66056
output: 612
thoughts: 217
Thoughts: **Finalizing the Response**
Okay, the analysis is complete, and the results are definitive. It's time to craft the final response, clearly articulating the core issue and its implications. I need to make sure the explanation is precise and leaves no room for ambiguity.
First, I need to pinpoint the root cause: the vulnerability stems from `addrconf_permanent_addr` iterating through `idev->addr_list` while holding the `write_lock_bh(&idev->lock)`. That's the critical lock contention point.
Second, the operations within that loop are key. Specifically, `fixup_permanent_addr` allocates `fib6_info` structures and percpu memory using `GFP_ATOMIC`. This is where the resource exhaustion begins.
Third, a significant factor is the lack of any limits in `ipv6_add_addr` regarding the number of manually added IPv6 addresses. No inherent protection there.
Fourth, the trigger is clear: an unprivileged user within a user namespace, possessing `CAP_NET_ADMIN` capabilities, can exploit this. They can add an excessive number of addresses to an interface and then bring it up. This action triggers the `NETDEV_UP` event, which leads to execution of the vulnerable function.
Finally, the impact is a crucial aspect to articulate. The primary consequence is an RCU stall, resulting in a denial-of-service condition due to the prolonged disabling of softirqs. Thankfully, the analysis indicates there's no memory corruption, which is significant as it mitigates concerns of exploitability. This means the severity is lower than it could be, but the potential for DoS remains a serious concern.
With this clear understanding, I'm ready to write the response, presenting the technical details in a concise and easily digestible manner.
|
| 45/1 |
2026/05/14 01:27 |
action |
format-explanation |
0m
Results: map[Explanation:Based on the analysis of the kernel bug report and the source code, here is the
assessment of the bug:
### Root Cause Analysis
The RCU stall is caused by a long-running loop inside
`addrconf_permanent_addr()` that executes while holding a spinlock with softirqs
disabled (`write_lock_bh(&idev->lock)`).
When an interface is brought up, it triggers a `NETDEV_UP` event, which is
handled by `addrconf_notify()`. This function calls `addrconf_permanent_addr()`
to restore routes for permanent IPv6 addresses.
`addrconf_permanent_addr()` iterates over all addresses in `idev->addr_list`.
For each permanent address, it calls `fixup_permanent_addr()`, which in turn
allocates a new `fib6_info` route and per-CPU memory for the nexthop
(`alloc_percpu_gfp()`). Because this is done under a spinlock, the allocations
are performed with `GFP_ATOMIC`.
The kernel does not impose a limit on the number of manually configured IPv6
addresses an interface can have (the `max_addresses` sysctl only applies to
autoconfigured addresses). If an interface has a massive number of IPv6
addresses, the loop in `addrconf_permanent_addr()` will run for a very long
time, performing hundreds of thousands of atomic memory allocations without ever
dropping the spinlock. This completely blocks the CPU and prevents softirqs from
running, leading to the observed RCU stall and potential atomic memory
allocation failures.
### Security Impact
* **Denial of Service (DoS):** Yes. Triggering this bug causes a severe RCU
stall, which can lead to a system hang or a kernel panic (if
`panic_on_rcu_stall` is enabled). It can also exhaust atomic memory pools.
* **Exploitable:** No. The bug is a pure CPU stall/resource exhaustion issue.
There is no memory corruption, use-after-free, or out-of-bounds access involved
that could be leveraged for privilege escalation.
* **Accessible From Unprivileged Processes:** No. Adding IPv6 addresses to an
interface requires `CAP_NET_ADMIN` capabilities.
* **Accessible From User Namespaces:** Yes. An unprivileged user can create a
new user namespace and a network namespace. Within this isolated network
namespace, the user gains `CAP_NET_ADMIN`. They can then create a dummy
interface, add millions of IPv6 addresses to it using `RTM_NEWADDR` netlink
messages, and finally bring the interface up (`RTM_NEWLINK` with `IFF_UP`). This
sequence will reliably trigger the RCU stall on the host kernel.
### Conclusion
This is a Denial of Service (DoS) vulnerability that can be triggered by an
unprivileged local user by leveraging user and network namespaces. It is not
exploitable for code execution or privilege escalation.]
|