modules: add ghostlock (CVE-2026-43499, "GhostLock" rtmutex/futex requeue-PI stack UAF)
release / build (arm64) (push) Waiting to run
release / build (x86_64) (push) Waiting to run
release / build (x86_64-static / musl) (push) Waiting to run
release / build (arm64-static / musl) (push) Waiting to run
release / release (push) Blocked by required conditions

Adds the ghostlock module for CVE-2026-43499 ("GhostLock", VEGA / Nebula
Security's "IonStack part II") — a ~15-year race UAF on kernel STACK memory in
the rtmutex/futex requeue-PI path (kernel/locking/rtmutex.c). On the -EDEADLK
deadlock-rollback, remove_waiter() runs against `current` instead of the waiter
task, so a concurrent sched_setattr()-driven PI-chain priority walk on another
CPU clears pi_blocked_on on the wrong task and leaves an on-stack rt_mutex_waiter
dangling. Reachable by any unprivileged user (CVSS 7.8, PR:L) — plain
futex(2) + sched_setattr(2), no userns/CONFIG beyond CONFIG_FUTEX_PI. The
corpus's first rtmutex/futex-PI module and first kernel-stack UAF (all others
are heap/slab).

Introduced 2.6.39; fixed 3bfdc63936dd (7.1-rc1), stable backports
7.0.4 / 6.18.27 / 6.12.86 / 6.6.140 / 6.1.175; 5.15/5.10/5.4/4.19 affected with
no upstream fix. CWE-416; not in KEV.

detect() is a pure version gate over the five-branch backport table. exploit()
forks an isolated child that (A) deterministically confirms the -EDEADLK
remove_waiter() rollback path is reachable (safe — no concurrent walk means no
dangling pointer; validated on real hardware) then (B) exercises the actual race
a hard-bounded 24 iters / 2s with a sibling-CPU sched_setattr(SCHED_BATCH) storm,
and stops. Deliberately under-driven: no copy_from_user widening, no stack-frame
spray/reoccupation, and the KernelSnitch leak -> forged-waiter ->
fops/ashmem/pipe R/W -> cred-patch chain (Android/Pixel-specific, per-build
offsets) is NOT bundled. Returns EXPLOIT_FAIL. Lowest --auto safety rank (11) —
a won race corrupts the kernel stack. Unlike most races it ships a real
detection signature (futex requeue-PI returning EDEADLK + sibling sched_setattr);
auditd/sigma anchor on sched_setattr, falco/eBPF on the EDEADLK tell; no yara.

Wired: registry, Makefile, safety rank 11, version 0.9.13, 9 detect() test rows
(incl. 6.13.0 -> VULNERABLE, the multi-branch "newer than all" case), CVE
metadata (CWE-416 / T1068 / not-KEV; cve_metadata.c + KEV_CROSSREF.md regenerated
-> 13 of 40), README + CVES.md + website counts (45 modules / 40 CVEs),
RELEASE_NOTES v0.9.13, verify-vm target. Also corrects pre-existing
docs/index.html drift left by v0.9.12 (body counts stuck at 43/38 and a missing
bad_epoll corpus pill). Tests: 33 kernel_range + 101 detect, all pass.

Credit: VEGA / Nebula Security (nebusec.ai, NebuSec/CyberMeowfia, Apache-2.0);
upstream fix 3bfdc63936dd (Keenan Dong / Thomas Gleixner).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KUq4DGXSPBmPkAyJ9WnM9n
This commit is contained in:
KaraZajac
2026-07-13 15:43:00 -04:00
parent 95589e26cb
commit 03324c8542
17 changed files with 999 additions and 49 deletions
+75
View File
@@ -73,6 +73,7 @@ extern const struct skeletonkey_module sudo_host_module;
extern const struct skeletonkey_module cifswitch_module;
extern const struct skeletonkey_module nft_catchall_module;
extern const struct skeletonkey_module bad_epoll_module;
extern const struct skeletonkey_module ghostlock_module;
static int g_pass = 0;
static int g_fail = 0;
@@ -935,6 +936,80 @@ static void run_all(void)
&bad_epoll_module, &h_bep_710,
SKELETONKEY_OK);
/* ── ghostlock (CVE-2026-43499) ──────────────────────────────
* Pure version gate over a FIVE-branch backport table (fixed
* 7.0.4 / 6.18.27 / 6.12.86 / 6.6.140 / 6.1.175 on-branch, 7.1+
* inherits mainline; introduced 2.6.39). Unlike bad_epoll's single
* entry, this exercises kernel_range_is_patched()'s "strictly newer
* than ALL entries" mainline-inherit clause: 6.13.x is newer than
* some entries but not all, so it must stay VULNERABLE. The 5.x/4.19
* LTS branches are affected with NO upstream fix. No userns/CONFIG
* precondition (CVSS PR:L, any local user). */
/* 2.6.30 predates PI-futex requeue (introduced 2.6.39) → OK */
struct skeletonkey_host h_ghl_2630 =
mk_host(h_kernel_6_12, 2, 6, 30, "2.6.30-test");
run_one("ghostlock: 2.6.30 predates PI-futex requeue → OK",
&ghostlock_module, &h_ghl_2630,
SKELETONKEY_OK);
/* 5.10.200 — affected LTS with NO upstream stable fix → VULNERABLE */
struct skeletonkey_host h_ghl_510 =
mk_host(h_kernel_6_12, 5, 10, 200, "5.10.200-test");
run_one("ghostlock: 5.10.200 (no upstream fix on 5.10) → VULNERABLE",
&ghostlock_module, &h_ghl_510,
SKELETONKEY_VULNERABLE);
/* 6.1.174 one below the 6.1.175 backport → VULNERABLE */
struct skeletonkey_host h_ghl_61174 =
mk_host(h_kernel_6_12, 6, 1, 174, "6.1.174-test");
run_one("ghostlock: 6.1.174 below the 6.1.175 backport → VULNERABLE",
&ghostlock_module, &h_ghl_61174,
SKELETONKEY_VULNERABLE);
/* 6.1.175 exact backport → OK via patch table */
struct skeletonkey_host h_ghl_61175 =
mk_host(h_kernel_6_12, 6, 1, 175, "6.1.175-test");
run_one("ghostlock: 6.1.175 (exact backport) → OK via patch table",
&ghostlock_module, &h_ghl_61175,
SKELETONKEY_OK);
/* 6.12.85 one below the 6.12.86 backport → VULNERABLE */
struct skeletonkey_host h_ghl_61285 =
mk_host(h_kernel_6_12, 6, 12, 85, "6.12.85-test");
run_one("ghostlock: 6.12.85 below the 6.12.86 backport → VULNERABLE",
&ghostlock_module, &h_ghl_61285,
SKELETONKEY_VULNERABLE);
/* 6.13.0 — newer than 6.12.86 but OLDER than 6.18.27/7.0.4, EOL
* branch with no fix → must stay VULNERABLE ("newer than ALL" test). */
struct skeletonkey_host h_ghl_6130 =
mk_host(h_kernel_6_12, 6, 13, 0, "6.13.0-test");
run_one("ghostlock: 6.13.0 newer than some entries but not all → VULNERABLE",
&ghostlock_module, &h_ghl_6130,
SKELETONKEY_VULNERABLE);
/* 7.0.3 one below the 7.0.4 backport → VULNERABLE */
struct skeletonkey_host h_ghl_7003 =
mk_host(h_kernel_6_12, 7, 0, 3, "7.0.3-test");
run_one("ghostlock: 7.0.3 below the 7.0.4 backport → VULNERABLE",
&ghostlock_module, &h_ghl_7003,
SKELETONKEY_VULNERABLE);
/* 7.0.4 exact backport → OK */
struct skeletonkey_host h_ghl_7004 =
mk_host(h_kernel_6_12, 7, 0, 4, "7.0.4-test");
run_one("ghostlock: 7.0.4 (exact backport) → OK via patch table",
&ghostlock_module, &h_ghl_7004,
SKELETONKEY_OK);
/* 7.1.0 newer than every entry → mainline-inherited fix → OK */
struct skeletonkey_host h_ghl_710 =
mk_host(h_kernel_6_12, 7, 1, 0, "7.1.0-test");
run_one("ghostlock: 7.1.0 above all backports → OK (mainline inherit)",
&ghostlock_module, &h_ghl_710,
SKELETONKEY_OK);
/* ── coverage report ─────────────────────────────────────────
* Iterate the runtime registry (populated by skeletonkey_register_*
* calls in main()) and warn for any module that was not touched