Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-64507 — PoC and detection tooling for CVE-2026-64507: demonstrates classic-BPF JIT spray, JIT memory reuse, and verifies the IBPB flush mitigation via kernel symbols and ftrace. | Kitploit
Tools/GitHubGitHub/manalejandro/cve-2026-64507
Defensive ToolsMemory ForensicsVulnerability AnalysisExploitationBinary Exploitation
GitHubmanalejandro/cve-2026-64507

CVE-2026-64507

PoC and detection tooling for CVE-2026-64507: demonstrates classic-BPF JIT spray, JIT memory reuse, and verifies the IBPB flush mitigation via kernel symbols and ftrace.

View Repository
1 month agoNot yet reviewed
Share

CVE-2026-64507 — PoC: IBPB flush on BPF JIT allocation

Demonstration and detection tooling for the Linux kernel hardening that flushes the indirect branch predictors (IBPB) when classic-BPF JIT memory is reused by the BPF program-pack allocator ("cBPF JIT spray hardening").

CVECVE-2026-64507 (GHSA-mfjh-rff8-525v)
ComponentLinux kernel — kernel/bpf/core.c + arch/x86/kernel/cpu/bugs.c
Introducedwith the BPF program-pack allocator (57631054fae6, v5.18)
Fixed (mainline)a3af84b0fa00ead01fcd0e28b5d773ff25990a0d — merged for v7.2-rc2
Fixed (stable)6.6.145, 6.12.97, 6.18.39, 7.1.4 (+ 6.16.y backport queue)
Related CVECVE-2026-64508 — infrastructure (bpf_arch_pred_flush static call/key, 96cce16e26dd02)
Series"cBPF JIT spray hardening" by Pawan Gupta (Intel), 6 patches
Severityhardening gap for Spectre-v2/BHI branch-target-injection (BTI) into JIT-sprayed BPF code

TL;DR

$ make
$ ./poc info          # is this kernel patched? is the flush active?
$ sudo ./poc all      # full demonstration (spray + reuse + ftrace ground truth)

Verified in this repository on a patched kernel (7.2.6, flush active, IBPB confirmed per reuse) and on a genuinely vulnerable kernel (Debian 6.12.96 booted in QEMU/KVM, no flush at all). Real transcripts are in Verified results.


1. Background

1.1 The BPF JIT program-pack allocator

Since v5.18 the BPF JIT allocates small programs from 2 MiB executable packs (bpf_prog_pack_alloc(), BPF_PROG_PACK_SIZE, 64-byte chunks). When a program is freed its chunks return to the pack bitmap and are handed out again to later programs.

1.2 JIT spraying

BPF immediates are copied verbatim into the generated machine code. A classic (SO_ATTACH_FILTER) filter such as:

BPF_STMT(BPF_LD  | BPF_IMM, 0xdeadbeef)   /* ->  b8 ef be ad de   mov eax, 0xdeadbeef */
BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0xcafebabe) /* -> 05 be ba fe ca  add eax, 0xcafebabe */

compiles to executable kernel memory that contains the attacker-chosen bytes ef be ad de … be ba fe ca verbatim (this PoC dumps them, see §6). An attacker who controls many programs can therefore place large amounts of chosen instruction bytes ("JIT spray") at 64-byte-aligned addresses inside the execmem region. Classic socket filters are the unprivileged attack surface the series targets.

1.3 Why memory reuse matters — Spectre-v2 / BTI

On CPUs vulnerable to Spectre-v2 / branch-target injection (and to BHI), branch predictions are not tagged by privilege. An indirect branch can be misdirected speculatively into executable memory whose address the attacker groomed.

The pack allocator reuses freed chunks, so a new program can be placed at the very same address an older, attacker-controlled program occupied. Any predictor state (BTB/BHB entries) left behind by the old occupant — or trained by the attacker against it — still refers to that address, but the code there is now different. The upstream fix describes it as:

"When fresh code is written into space that a previous program occupied, an indirect jump into the new program can reuse a branch prediction left behind by the old one."

Flushing the indirect branch predictors (IBPB) before the reused memory is handed out removes that stale predictor state.


2. The fix

The 6-patch series (mainline hashes):

#CommitSubject
196cce16e26dd02a8678f1e87f88a4b5cdb63b995bpf: Support for hardening against JIT spraying (CVE-2026-64508)
2a3af84b0fa00ead01fcd0e28b5d773ff25990a0dx86/bugs: Enable IBPB flush on BPF JIT allocation (this CVE)
30bb99f2cfaae6822d734d69722de30af823efdf3bpf: Restrict JIT predictor flush to cBPF
4a23c1c5396a91680703360d1ee28a44657c503c4bpf: Skip redundant IBPB in pack allocator
5a9b1f19a6a673ba06820898d0f1ad02883ea1639bpf: Prefer packs that won't trigger an IBPB flush on allocation
6b72e29e0f7ee329d89f86db8700c8ea99b4a370abpf: Prefer dirty packs for eBPF allocations

Mechanics (as merged, v7.2-rc2):

  • kernel/bpf/core.c gains a static key bpf_pred_flush_enabled and a static call bpf_arch_pred_flush (default NULL → no CALL emitted). bpf_prog_pack_alloc() invokes it when it hands out a chunk from a pack that "needs a flush" (fresh pack, or a pack whose freed memory has become reusable) and only for classic BPF programs (pr_warn_once for the >pack cBPF corner case). eBPF allocations are steered to already-flushed packs and never flush.

  • arch/x86/kernel/cpu/bugs.c wires the static call to bpf_arch_ibpb(), which issues on_each_cpu(write_ibpb/entry_ibpb) — one IBPB on every CPU — and prints at boot:

    Spectre V2 : Enabling IBPB for BPF
    

    The flush is enabled only when a genuine retpoline sequence is not active (retpoline_seq_enabled()) and the CPU has IBPB. With retpoline, ring-0 indirect predictions are already neutralized, so the flush is intentionally skipped.

2.1 Why this gets observable

  • The flush is an IPI broadcast: on this 12-thread test system one flushed classic attachment costs ~50–80 µs versus ~6 µs without it.
  • bpf_arch_ibpb is a real symbol; its presence/absence in /proc/kallsyms is a cheap patch indicator.
  • With CONFIG_RCU_LAZY=y (Debian default) the JIT frees are deferred by tens of milliseconds, so allocation cycles that reuse memory behave observably differently from tight loops whose frees are still pending.

3. What this PoC demonstrates — and what it does not

Demonstrated:

  1. Host triage — version matrix, kernel symbols, CPU/Spectre status, sysctls and the runtime Enabling IBPB for BPF marker (info).
  2. JIT spray primitive — classic filters whose immediates are found verbatim in executable kernel memory, with the kernel address of the sprayed bytes (spray, three independent evidence paths: eBPF-twin BPF_OBJ_GET_INFO_BY_FD, /proc/kcore pack scan, bpf_jit_enable=2 log dump).
  3. Memory reuse — freed JIT chunks are demonstrably handed out to later programs again (reuse; RCU-aware probing, eBPF jited_ksyms).
  4. Flush observation — an ftrace kprobe on bpf_arch_ibpb counts the actual IBPB broadcasts per reuse cycle: e.g. 30/30 or 19/20 on the patched test kernel (a miss simply means a deferred free had not completed yet), and structurally impossible on a vulnerable kernel (reuse, root).

Not demonstrated (out of scope, honestly):

  • An end-to-end Spectre-v2 exploit. That would additionally need a microarchitecturally usable BTI training primitive and a leakage gadget for the specific CPU. This PoC proves the preconditions and the mitigation behaviour, not data exfiltration.
  • Any architectural escape: the sprayed bytes are data until a speculative redirect reaches them.

Legal/ethical note: run this only on systems you own or are authorized to test. It is non-destructive (filters are detached, sysctls are restored), but it deliberately manipulates executable kernel memory and branch predictors.


4. Requirements

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    851
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    538
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    420
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    357
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    297
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    280

Explore all tools

Browse our collection of tools

View all tools →