> NOTE: the directory name `cve112479` is stale. CVE-2026-112479 is the USB entry in the iOS 27.2 notes; everything below is AppleAVE2 (AVEVideoEncoder) work. No CVE ID has been matched to these findings yet. > Reachability caveat: AppleAVE2 is the hardware video ENCODER driver. These parameters arrive through an encode session configuration (VTCompressionSession path), so reaching this code needs an app that is encoding HEVC with attacker-influenced parameters, not passive decode of a file. The 27.2 notes list eight AVEVideoEncoder entries, one worded as code execution; which entry (if any) matches is unknown. # AppleAVE2 — AVE_HEVC_CheckVPSExtBounds (patched build) Tooling: rea 6.7.0, provider ghidra 12.1.4, commands `function`, `xrefs`, `decompile`, `search` only. Function-scoped. Artifact (after): ex_after/com.apple.driver.AppleAVE2, sha256 d95ad9eff108837f4ddf155cf018d8293751f395d2719a5137284ba1aa3b7b18 All addresses are Ghidra analysis addresses (image base 0xfffffff00729d6d0). ## Step 1 — anchor 0xfffffff0073048fa - 0xfffffff0073048fa is NOT code. `rea function` at it fails: "No procedure exists at the requested address". It is the C string "AVE_HEVC_CheckVPSExtBounds" (a __func__ literal in __cstring). - `rea xrefs` at it returns 10 references, all inside one function: 0xfffffff00875e814, e888, e8fc, e938, e9c4, e9fc, ea4c, eaa0, eb24, eb58 (all 0xfffffff00875xxxx). - Containing function (rea function at 0xfffffff00875e814): - start 0xfffffff00875e6c8, end 0xfffffff00875eb9f (inclusive; last insn `retab` at 0xfffffff00875eb9c), 1240 bytes, contiguous. - Ghidra name FUN_fffffff00875e6c8; stable name from its own __func__ literal: AVE_HEVC_CheckVPSExtBounds. - Signature as recovered: (x0 = param_1 passed through to log calls only, x1 = pointer P to a struct). Returns w0 = 0 or 0xfffffc17. ## Step 2 — callers (name = __func__ literal each caller itself references) | Caller start | Call site (bl 0xfffffff00875e6c8) | __func__ literal | literal address | |---|---|---|---| | 0xfffffff00875d8d4 | 0xfffffff00875dd1c | AVE_HEVC_CheckInfo | 0xfffffff007300637 | | 0xfffffff00875fa10 | 0xfffffff00875fad0 | AVE_Client_CheckDMVInfo | 0xfffffff007301804 | | 0xfffffff0087604d8 | 0xfffffff00876059c | AVE_Client_CheckGGMInfo | 0xfffffff007301929 | | 0xfffffff00876108c | 0xfffffff00876114c | AVE_Client_CheckMCTFInfo | 0xfffffff007301941 | | 0xfffffff008761c10 | 0xfffffff008761cd4 | AVE_Client_CheckLRMEInfo | 0xfffffff007301a32 | - A sixth incoming reference from 0xfffffff00ba4850a (inside __LINKEDIT, no source procedure): nature unknown (likely function-starts/symbol metadata; not verified). - Every caller passes x1 = info + 0x1880 (`mov w8,#0x1880; add x1,x2X,x8` immediately before the bl), so P+off == info+0x1880+off. ## Step 3 — verdict: the compares GATE; they do not log-and-continue ### 3a. Compared values, struct offsets (relative to P = x1 = x20), field names Field names are taken from the assert-expression strings the function passes to its log calls; pairing a name to an offset is direct only where one value is logged with one expression. | Insn | Load | Compare / branch | Named by string | |---|---|---|---| | 0xfffffff00875e6f0 | `ldr w8, [x1, #0x4]` | e6f4 `cmp w8, #0x40` ; e6f8 `b.cs 0xfffffff00875e7c0` | "pVPS->vps_max_layers_minus1 < (63 + 1)" (0xfffffff007304915) — direct | | e704 / e708 | `ldr w10, [x20, #0xf78]` ; `ldrb w9, [x23]` (x23 = P+0x1a40) | e70c `add w10,w10,w9` ; e710 `add w10,w10,#0x1` ; e714 `cmp w10, #0x41` ; e718 `b.cs 0xfffffff00875e82c` | "(uint32_t)pVPS->vps_num_layer_sets_minus1 + 1 + pVPS->num_add_layer_sets <= (63 + 1)" (0x...730498d). Which of +0xf78 / +0x1a40 is which name: inferred (u32 @+0xf78 = vps_num_layer_sets_minus1, u8 @+0x1a40 = num_add_layer_sets), not proven | | e724 | `ldrb w11, [x24]` (x24 = P+0x2a45) | e728 `add w10,w10,w11` ; e72c `cmp w10, #0x40` ; e730 `b.hi 0xfffffff00875e89c` | "(uint32_t)pVPS->num_add_olss + ..." (0x...7304a3d); +0x2a45 = num_add_olss by elimination (inferred) | | e744 | `ldrb w10, [x23, w10, UXTW]` (x23 = P+0x17fb, index i) | e748 `cmp w10, #0x40` ; e74c `b.cs 0xfffffff00875e96c` | "pVPS->layer_id_in_nuh[i] < (63 + 1)" (0x...7304af8) — direct | | e790 | `ldrb w14, [x14, x13]` (x14 = P+0x1a41 + j*0x40, x13 = k from 1) summed into w23 | e7a4 `cmp w23, #0x41` ; e7a8 `b.cs 0xfffffff00875ead0` | "layerNumSum <= (63 + 1)" (0x...7304b79); log text "highest_layer_idx_plus1 sum" | ### 3b. Every failing branch ends in an error return, never back in the walk - All five failure targets (e7c0, e82c, e89c, e96c, ead0) run a log sequence and reach 0xfffffff00875eb84 `mov w0, #0xfffffc17`, then the epilogue at eb88..eb9c `retab`. - CFG evidence (rea basic_blocks): e7c0 -> {e7d0, eb84}; e7d0 -> {e7f8, e91c}; e7f8 -> e910 -> e914 -> eb84; e91c -> eb84. Same shape for e82c, e89c, e96c, ead0. No successor of any failure block is a loop block (e740..e7b4). - The only path to `mov w0, #0x0` (e7b8) is fall-through after all compares pass. ### 3c. Does the compared value bound the index used afterwards? - vps_max_layers_minus1 (P+0x4): YES. Loaded once into w8 at e6f0; no instruction writes w8 between e6f0 and e7b4. The same w8 is the loop bound: - walk 1: e750 `add w10, w22, #0x1` ; e754 `cmp w10, w8` ; e758 `b.ls 0xfffffff00875e740` -> i = 0..w8 (inclusive), reads P+0x17fb+i, max i = 0x3f. - walk 2 inner: e76c `cmp w8, #0x1` ; e770 `csinc w11, w8, wzr, hi` ; e774/e778 -> count = max(w8,1); e77c `cbz w8` skips when 0; k = 1..count, reads P+0x1a41 + j*0x40 + k, max k = 0x3f (stays inside the 0x40-byte row). - P+0x4 is re-read only on the failure/log path (e7ec `ldr w8, [x20, #0x4]`), after the decision. - num_add_layer_sets (P+0x1a40, w9): YES for the outer loop of walk 2: e75c `cbz w9` ; e7ac `add x22,x22,#0x1` ; e7b0 `cmp x22, x9` ; e7b4 `b.ne 0xfffffff00875e77c` -> j = 0..w9-1. w9 not rewritten between e708 and e7b4. - P+0xf78 and P+0x2a45: compared only as part of sums; NOT used as an index or loop bound inside this function. Whether they bound an index elsewhere: unknown. - layer_id_in_nuh[i] values (P+0x17fb+i): each compared < 0x40; not used as an index inside this function. Later use: unknown. - The u32 at P+0xf78 could wrap the 32-bit sum on its own, but each caller rejects info+0x27f8 (= P+0xf78) > 0xf before the call (e.g. AVE_HEVC_CheckInfo 0xfffffff00875dccc `ldr w8,[x20,#0x27f8]` ; `cmp w8,#0xf` ; `b.hi`; AVE_Client_CheckDMVInfo 0xfffffff00875fa78 same). ### 3d. Callers also gate on the return value - All five: the instruction after the bl is `cbz w0, `; non-zero falls into a log block using assert string "ret == 0" (0xfffffff0072ea7a2) and message "HEVC VPS extension layer/OLS counts are out of range %d". - AVE_HEVC_CheckInfo: dd20 `cbz w0, 0xfffffff00875e258` ; dd24 `mov x21, x0` ; ... e42c `b 0xfffffff00875db94` ; db94 `mov x0, x21` ; dbb4 `retab`. (The other log variant branches dd84 -> 0xfffffff00875daec -> 0xfffffff00875dc44; that block's exit was not read: unknown, though dd34 `cbz w0, 0xfffffff00875db94` shows the same exit is used when logging is off.) - AVE_Client_CheckDMVInfo: fad4 `cbz w0, 0xfffffff00875fedc` ; fad8 `mov x20, x0` ; fb3c bl log ; fb40 `b 0xfffffff00875fe50` ; fe50 `mov x0, x20` ; fe6c `retab`. - GGM / MCTF / LRME: `cbz w0` at 0xfffffff0087605a0 / 0xfffffff008761150 / 0xfffffff008761cd8 followed by `mov x20, x0`; their exit blocks were not read individually: unknown (same shape observed up to the log call). ### 3e. Not established - Where the validated fields are consumed after these Check* functions return (the walk being protected outside this function): unknown. - Whether the struct can change between this check and that later use: unknown. ## Step 4 — old build Artifact (before): ex_before/com.apple.driver.AppleAVE2, sha256 92bde300729b8a0080627a523e0eff847dc1baebe3c70fdf42a957258231e3aa Scope note: `rea search` over Ghidra-defined strings only; an empty result does not prove the bytes are absent from the file. ### 4a. __func__ literals in the old build | Name (from step 2) | Old literal address | Old function (start..end) | refs to literal old / new | |---|---|---|---| | AVE_HEVC_CheckInfo | 0xfffffff0072ff51e | 0xfffffff008732d80..0xfffffff008733323 (361 insns) | 12 / 30 | | AVE_Client_CheckDMVInfo | 0xfffffff0072fff98 | 0xfffffff0087340c4..0xfffffff0087343d3 (196 insns) | 6 / 24 | | AVE_Client_CheckGGMInfo | 0xfffffff0072fffef | 0xfffffff0087343d4..0xfffffff0087348a7 (309 insns) | 10 / 26 | | AVE_Client_CheckMCTFInfo | not found (search "MCTFInfo" -> []) | unknown | - | | AVE_Client_CheckLRMEInfo | not found (search "LRMEInfo" -> []) | unknown | - | | AVE_HEVC_CheckVPSExtBounds | not found (search "VPSExt" -> []) | unknown | - | - Also empty in the old build: search "HEVC VPS" -> [], search "vps_max_layers" -> []. None of the VPS log/assert strings of the new checker or of the callers' "HEVC VPS ..." messages is a defined string in the old build. - Whether MCTF/LRME equivalents exist in the old build under another name or without a __func__ literal: unknown (not enumerated, by scope). ### 4b. AVE_HEVC_CheckInfo — same region, old vs new Shared lead-in (identical shape in both builds): per-layer loop, frame-dimension call, separate_colour_plane loop. - old: 0xfffffff008733050 `bl 0xfffffff008746dcc` ; 3054 `cbz w0, 0xfffffff0087330cc` ; 30cc `ldr w8,[x21,#0x68]` ... 30e0 `mov x10,#0x1c4` ; 30e4 `madd x23,x22,x9,x10` ; 30e8 `ldr w11,[x24,x23]` ; 30ec `cbnz w11, 0xfffffff00873321c` ; 30f8 `b.ne 0xfffffff0087330e4` - new: 0xfffffff00875dbd0 `bl 0xfffffff008774bac` ; dbd4 `cbz w0, 0xfffffff00875dc4c` ; dc4c..dc78 same loop with `mov x10,#0x1c4`. What the OLD build does next, in full, to the function's end: ``` 0xfffffff0087330fc: ldr w8, [x21, #0x510] 0xfffffff008733100: cmp w8, #0x9 0xfffffff008733104: b.cs 0xfffffff0087331b0 ; "number of sub layer is out of range" 0xfffffff008733108: mov w20, #0x0 0xfffffff00873310c: b 0xfffffff008733014 ; return 0 ``` What the NEW build has at that point: ``` dc7c..dca0 second per-layer loop: ldr w11,[x26, i*0x1c74+0x1f4] ; cmp w11,#0xd ; b.cs dca4: ldr w8,[x20,#0x510] ; sub w8,w8,#0x1 ; cmp w8,#0x7 ; b.cs dcb4: ldr w8,[x20,#0x768] ; cmp w8,#0x8 ; b.cs dcc0: ldr w8,[x20,#0x1888] ; cmp w8,#0x6 ; b.hi ("HEVC VPS count is out of range" block at dfd8) dccc: ldr w8,[x20,#0x27f8] ; cmp w8,#0xf ; b.hi dcd8: ldr w8,[x20,#0x2c10] ; cmp w8,#0x10 ; b.hi dce4: ldur x8,[x29,#-0x58] ; ldrb w8,[x8] (info+0x42c7) ; cmp w8,#0x1 ; b.hi dcf4: ldr w8,[x20,#0x27f4] ; cmp w8,#0x3f ; b.cs dd00: ldur x22,[x29,#-0x60] ; ldrb w8,[x22] (info+0x32c0) ; cmp w8,#0x41 ; b.cs 0xfffffff00875e1ec ("num_add_layer_sets" block) dd10: mov w8,#0x1880 ; add x1,x20,x8 ; mov x0,x19 ; bl 0xfffffff00875e6c8 (AVE_HEVC_CheckVPSExtBounds) dd20: cbz w0, 0xfffffff00875e258 -> further SPS/PPS/RPS/MCTF count loops (strings listed below) ``` Present in old at this point: the 0x510 compare only (as `cmp w8,#0x9 ; b.cs`), then return 0. Absent in old (instruction-level): every load in old AVE_HEVC_CheckInfo uses one of the offsets 0x3c, 0x64, 0x68, 0x4f8, 0x510, or base info+0x4348 with stride 0x1c74 (+0x1c0, +0x1c4). There is no load from any offset between 0x510 and 0x4348, i.e. no read of any VPS-region field, and no call to a VPS checker (old callees: 0xfffffff008746dcc, 0xfffffff00887390c, plus log helpers 0xfffffff0087ed13c/ed184/ed1bc, 0xfffffff00886350c, 0xfffffff0088928c8, 0xfffffff0088929a8). Strings referenced by new AVE_HEVC_CheckInfo and not by old: "HEVC VPS extension layer/OLS counts are out of range", "HEVC VPS count is out of range", "HEVC VPS num_add_layer_sets is out of range", "HEVC log2_max_pic_order_cnt_lsb_minus4 is out of range", "HEVC SPS count is out of range", "HEVC PPS count is out of range", "HEVC RPS count is out of range", "HEVC MCTF strength count out of range", "number of temporal layers (prop) is out of range". Layout note: the per-layer array base is info+0x4348 in old and info+0x4350 in new, so old-build offsets of the VPS fields may differ from the new ones by 8: unknown. ### 4c. AVE_Client_CheckDMVInfo — old Whole old function (decompiled, 3 checks only): 1. 0xfffffff0087340f4 `ldr w1,[x3,#0x5a4]` ; 40f8 `ldr w2,[x3,#0x5a8]` ; 4100 `bl 0xfffffff00874d0d0` ; 4104 `cbz w0` — "frame dimension is out of range". 2. 4188 `ldr w8,[x20,#0x1b7c]` / 4190 `ldr w9,[x22,#0x3c]` / 4194 `cmp w8,w9` ; 419c `ldr w8,[x20,#0x1b80]` / 41a4 `ldr w9,[x22,#0x40]` — "frame dimension doesn't match between prepare and start". 3. `FUN_fffffff0088760d4(*(client+0x38))` then `FUN_fffffff0088583d4(.., info+0x1650)` — "wrong DLB configuration". Offsets loaded in old: 0x38, 0x3c, 0x40, 0x60, 0x5a4, 0x5a8, 0x1650 (address-of), 0x1b7c, 0x1b80. Absent in old: the entire block the new build runs first (new 0xfffffff00875fa3c..fad4: info+0x68, +0x510, +0x768, +0x1888, +0x27f8, +0x2c10, +0x42c7, +0x27f4, +0x32c0 compares, then `bl 0xfffffff00875e6c8`). No VPS-region load and no VPS checker call in old. ### 4d. AVE_Client_CheckGGMInfo — old Old opening: 0xfffffff008734404 `ldr w8,[x3,#0x68]` ; 440c `cmp w8,#0x1` ; 4410 `b.hi` ; per-layer loop 4430..444c calling 0xfffffff00887390c ; 4450 `ldp w3,w4,[x22,#0x3c]` ; 4464 `bl 0xfffffff008746dcc`. Offsets loaded in old: 0x38, 0x3c, 0x40, 0x60, 0x68, 0x1650, 0x1b7c, 0x1b80, base 0x4348 stride 0x1c74. Absent in old: same VPS block as DMV (new 0xfffffff008760550..0x87605a0). No VPS-region load, no VPS checker call. The rest of old GGM past 0xfffffff0087344f4 was read only as an offset/callee/string inventory of that one function, not line by line. ### 4e. Summary of what is established - Established: in the old build, none of the three surviving callers reads any field in the VPS region or calls a VPS bounds checker; the checker function and all of its strings are not found. - Established: in the new build, the checker rejects out-of-range values before its own array walks, and all five callers return its error. - Unknown: which later function walks layer_id_in_nuh / highest_layer_idx_plus1 (the consumer the check protects), and therefore whether the old build was reachable with out-of-range values there. - Unknown: mapping to a specific CVE ID. The directory is named cve112479 (the USB entry); this code is the HEVC encoder driver. # Part 2 — consumer hunt (three literals) and AVE_PSInfo_Make ## P2.1 — search hits in ex_after | Literal searched | Hit address | String | Referenced from | |---|---|---|---| | `pInfo->sHEVC_VPS` | 0xfffffff0073009cb | "pInfo->sHEVC_VPS.vps_max_sub_layers_minus1 < 7 && ... vps_max_layer_id < (64 - 1)" | 10 refs, two in each of the five Check* callers from step 2 (0x...875e038, 875e1b0, 875fd34, 875fe14, 8760800, 87608e0, 87613b0, 8761490, 8761f38, 8762018) | | `pInfo->sHEVC_VPS` | 0xfffffff007300b12 | "pInfo->sHEVC_VPS.num_add_layer_sets <= (63 + 1)" | 10 refs, same five functions (0x...875e234, 875e3a4, 875feb8, 875ffcc, 8760988, 8760ad0, 8761534, 8761650, 87620bc, 87621c8) | | `pVPS->layer_id_in_nuh` | 0xfffffff007304af8 | "pVPS->layer_id_in_nuh[i] < (63 + 1)" | 2 refs, both inside AVE_HEVC_CheckVPSExtBounds (0x...875e9b8, 875ea94) | | `too many parameter sets` | 0xfffffff00731b120 / 0xfffffff007371c30 | "... too many parameter sets %d %d %d %p %d" (with / without newline) | 0xfffffff00881e480 / 0xfffffff00881e5d0 — function 0xfffffff00881df70 | | `too many parameter sets` | 0xfffffff00731b327 / 0xfffffff007371dd2 | "... too many parameter sets %p %d %d %d %p %d" | 0xfffffff00881eb88 / 0xfffffff00881ecfc — function 0xfffffff00881e65c | - Result for the VPS fields: none of the three literals leads to a consumer. The two `pInfo->sHEVC_VPS` strings and the `layer_id_in_nuh` string are all inside the validators already analysed. The function that later walks layer_id_in_nuh / highest_layer_idx_plus1 is still unknown. - The third literal leads to a different function with its own index and its own bound, below. ## P2.2 — AVE_PSInfo_Make (new build), two overloads Stable name from __func__ literal "AVE_PSInfo_Make" (new 0xfffffff00731aff4). - Overload A: 0xfffffff00881df70..0xfffffff00881e65b. Args: w0 eType, w1 iLayerID, w2 iBits, x3 psPSContext. Callers: 0xfffffff0086fe420, 0xfffffff00882a070, 0xfffffff00889f45c, 0xfffffff0088b76f8, 0xfffffff0088b93a4 (not examined). - Overload B: 0xfffffff00881e65c..0xfffffff00881ed8b. Args: x0 piPSData, w1 eType, w2 iLayerID, w3 iBits, x4 psPSContext. Caller: 0xfffffff00881edd4 (not examined). The "walk" is an append into a table inside psPSContext (ctx): - index: iNum = u32 at ctx+0x0. Register w25 (A) / w26 (B). - element: ctx + 4 + iNum*0x10, four ints {eType, iLayerID, iOffset, iSize}. Assert string names it psPSInfo->saBuf[iNum]. - new bound, overload A: ``` 0xfffffff00881e2a8: ldr w25, [x21] 0xfffffff00881e2ac: cmp w25, #0x15 0xfffffff00881e2b0: b.cs 0xfffffff00881e414 ; "too many parameter sets", returns 0xfffffc15 0xfffffff00881e2b4: add x8, x21, #0x4 0xfffffff00881e2b8: lsl x9, x25, #0x4 0xfffffff00881e2c0: add x26, x8, w9, SXTW 0xfffffff00881e2d0: stp w19, w20, [x26] ``` - new bound, overload B: 0xfffffff00881e9ac `ldr w26, [x23]` ; e9b0 `cmp w26, #0x15` ; e9b4 `b.cs 0xfffffff00881eb1c` ; e9d4 `stp w20, w21, [x27]`. - Assert text: "0 <= iNum && iNum < (1 + ((2) < ((63 + 1)) ? (2) : ((63 + 1))) * (1 + 9 ))" = iNum < 21 = 0x15. - The bound is the function's own counter at ctx+0x0, read once per call. It is NOT one of the fields the VPS validator clamps (info+0x1880+0x4, +0x1a40, +0x17fb). Whether those VPS fields determine how many times the callers invoke this function: unknown. - Second, pre-existing limit in both builds: iOffset = previous iOffset + previous iSize; iSize = iBits >> 3; the count is incremented only if iOffset + iSize < 0x801 (signed compare). Data area begins at ctx+0x154 (overload B: `add x0, x8, #0x154` before the copy call), so table capacity is (0x154 - 4) / 0x10 = 21 entries, matching the new bound. ## P2.3 — AVE_PSInfo_Make (old build) __func__ literal "AVE_PSInfo_Make" at old 0xfffffff007319255, 28 refs. - Overload A: 0xfffffff0087f0004..0xfffffff0087f060f. Overload B: 0xfffffff0087f0610..0xfffffff0087f0c5f. - search "too many parameter sets" in old -> [] ; search "PS data overflows" in old -> 4 hits (0xfffffff007319381, 0xfffffff0073194fa, 0xfffffff00736e903, 0xfffffff00736ea63). Same region, old overload A — no compare on the index before the store: ``` 0xfffffff0087f00a8: tst w22, #0x7 0xfffffff0087f00ac: b.eq 0xfffffff0087f033c 0xfffffff0087f033c: mov x8, x21 0xfffffff0087f0340: ldrsw x25, [x8], #0x4 ; iNum, sign-extended; x8 = ctx+4 0xfffffff0087f0344: lsl x9, x25, #0x4 0xfffffff0087f0348: cmp x9, w9, SXTW ; pointer-arithmetic overflow trap only (0x2bad tag), not a table bound 0xfffffff0087f034c: add x26, x8, w9, SXTW 0xfffffff0087f0358: csel x26, x26, x16, eq 0xfffffff0087f035c: stp w19, w20, [x26] ; write {eType, iLayerID} ... 0xfffffff0087f04fc: asr w9, w22, #0x3 0xfffffff0087f0500: stp w8, w9, [x26, #0x8] ; write {iOffset, iSize} 0xfffffff0087f0504: add w8, w8, w22, ASR #0x3 0xfffffff0087f0508: cmp w8, #0x801 0xfffffff0087f050c: b.ge 0xfffffff0087f0520 ; "PS data overflows" 0xfffffff0087f0514: add w8, w25, #0x1 0xfffffff0087f0518: str w8, [x21] ; iNum++ ``` Old overload B is the same shape: 0xfffffff0087f0964 `ldrsw x26, [x8], #0x4` ; 0980 `stp w20, w21, [x27]` ; 0b30 `stp w8, w9, [x27, #0x8]` ; 0b38 `cmp w10, #0x801` ; 0b3c `b.ge` ; 0b44 `add x8, x23, w8, SXTW` ; 0b48 `add x0, x8, #0x154` ; 0b50 `bl 0xfffffff008892978` (copy) ; 0b58..0b60 iNum++. Present in old: eType 1..6 check, iLayerID < 2 check, (iBits & 7) == 0 check, the 0x801 data-total check. Absent in old: any compare of iNum against 0x15 (or any constant) before the 16-byte store. ## P2.4 — direct answer - Does the old build index past the array? YES, in AVE_PSInfo_Make, for the saBuf table: the store at ctx+4+iNum*0x10 has no upper bound on iNum. - By how much: 16 bytes per call beyond entry 20. The first out-of-range entry (iNum == 21) lands at ctx+0x154, i.e. on the first 16 bytes of the data area in the same context. Each further successful call moves 16 bytes on. The only stop is the data-total check, which limits bytes of PS data (0x800), not the entry count; with small or zero-length entries the count is not limited by it. The data area is 0x800 bytes = 128 entries, so writes leave the data area from iNum == 149 (ctx+0x954) onward. The size of the context object beyond ctx+0x954 is unknown. - Condition: more than 21 successful calls to AVE_PSInfo_Make on one psPSContext without the count being reset. Whether any of the six callers can do that, and what controls the number of calls: unknown — callers not examined. - Written values at an out-of-range entry: {eType (1..6), iLayerID (0..1), iOffset (running total), iSize (iBits>>3)}. - Relation to the VPS validator: not the same field. This is a second, independent bound added in the same update. ## P2.5 — discriminating outcome - For the VPS fields (+0x4, +0x1a40, +0x17fb): undecided. No consumer found, so "defence-in-depth vs trusted count" cannot be called from this evidence. - For AVE_PSInfo_Make: the old walk trusts its count. This is a real missing bound, fixed in the new build. Reachability rests on the callers (unknown). # Part 3 — callers of AVE_PSInfo_Make, call counts, context lifetime Names below are from the two string arguments each function passes to its own log calls (class, method); pairing is as logged. ## P3.1 — the five direct callers (new build): single call each, not in a loop | Caller | Name | Call site | In a cycle of its CFG | w0 (type) | w1 (layer) | w2 (bits) | x3 (ctx) | |---|---|---|---|---|---|---|---| | 0xfffffff0086fe420 | AVC_SPS::Generate | 0xfffffff0086fe8b0 | no | `mov w0,#0x2` | `mov w1,#0x0` | `ldr w2,[x22,#0x8]` | x20 = arg x1 | | 0xfffffff00882a070 | HEVC_VPS::Generate | 0xfffffff00882a39c | no | `mov w0,#0x1` | `mov w1,#0x0` | `ldr x8,[x19,#0x10]` ; `ldr w2,[x8,#0x8]` | x21 = arg x2 | | 0xfffffff00889f45c | AVC_PPS::Generate | 0xfffffff00889f9c4 | no | `mov w0,#0x3` | `mov w1,#0x0` | `ldr w2,[x24,#0x8]` | x23 = arg x4 | | 0xfffffff0088b76f8 | HEVC_SPS::Generate | 0xfffffff0088b7be4 | no | `mov w0,#0x2` | x24 = arg x4 | `ldr w2,[x19,#0x8]` | x21 = arg x5 | | 0xfffffff0088b93a4 | HEVC_PPS::Generate | 0xfffffff0088b9a38 | no | `mov w0,#0x3` | x21 = arg x3 | `ldr w2,[x24,#0x8]` | x22 = arg x5 | - These are parameter-set GENERATORS (the encoder writing its own VPS/SPS/PPS through a syntax writer), not parsers. w2 is the bit count the syntax writer reports (+0x8 of the writer object). - Stored values: type is a constant 1/2/3; layer is 0 or the layer index passed down (0 or 1, see loops below); size = bits >> 3 of the generated parameter set; offset = running sum. None is read directly from an input bitstream. Size depends on what the generator emits for the session configuration: indirectly influenced, degree unknown. ## P3.2 — loops are one level up (new build) - AVE_PSGen::GenerateVPS 0xfffffff00880d708: one call to HEVC_VPS::Generate (site 0xfffffff00880d7d0), no loop. - AVE_PSGen::GenerateSPS 0xfffffff00880daa4: codec at this+0x10. ==1: one AVC SPS. ==2: fixed two-iteration loop over layer index 0,1, skipping a layer whose object pointer at this+0x30+i*8 is null. Bound is a constant (2). - AVE_PSGen::GeneratePPS 0xfffffff00880dec4: ==1: AVC_PPS::Generate-all 0xfffffff00889f9d4 with count `*(u32)(cfg+0x2138)`. ==2: fixed two-iteration layer loop calling HEVC_PPS::GenerateAll 0xfffffff0088b9a58 with count `*(u32)(cfg+0x2138)`, mode `*(u32)(cfg+0x26c)`, source ctx `cfg+0x24e0`, destination ctx = caller's ctx. cfg = *(this+8). - AVC_PPS (0xfffffff00889f9d4) and HEVC_PPS::GenerateAll (0xfffffff0088b9a58): `if (9 < count) -> "too many PPS", return 0xfffffc17`, else loop i = 0..count-1 calling the per-PPS generator. Assert string "iNum <= 9". - So the designed maximum per context is 1 VPS + 2 SPS + 2 layers x 9 PPS = 21, which is exactly the new bound in AVE_PSInfo_Make (0x15) and the table capacity. - The PPS count is a configuration field (cfg+0x2138), not a NAL/bitstream count. Where that field is set and whether it is user-controlled: unknown. ## P3.3 — the copy path (this is where the count can run away) HEVC_PPS::GenerateAll, new 0xfffffff0088b9a58 (same logic in old 0xfffffff00888b5f0): - if mode == 2: n = count of type-3 entries in the SOURCE ctx (helper 0xfffffff00881ed8c). If n > 0: log "already generated before", call AVE_PSInfo_CopyType(src, 3, dst) and return, instead of generating. - AVE_PSInfo_CopyType, new 0xfffffff00881edd4: `for (i = 0; i < *src; i++) if (src.saBuf[i].type == 3) AVE_PSInfo_Make(overload B)(src data + off, 3, layer, size<<3, dst)`, and `*src` is re-read after every append. No filter on layer. - New build adds, before the loop: ``` 0xfffffff00881ee78: cmp x19, x21 ; src vs dst 0xfffffff00881ee7c: b.eq 0xfffffff00881f104 ; "source and destination alias", returns 0xfffffc17 ``` Strings "psPSCtxSrc != psPSCtxDst" (0xfffffff00731b48c) and "source and destination alias" are new. - Old AVE_PSInfo_CopyType 0xfffffff0087f0ca8: the checks are `cbz x19` / `cbz x21` / `sub w8,w20,#0x1 ; cmp w8,#0x5 ; b.hi` then straight to 0xfffffff0087f0d4c `ldr w8,[x19]` and the loop. There is no register-register compare of x19 and x21 anywhere in the function; search for "source and destination alias" and "psPSCtxSrc != psPSCtxDst" in old -> not found. Loop tail (decompile): `iVar1 = *param_1; lVar4 = lVar4 + 1; } while (lVar4 < iVar1);` (instruction addresses of the tail not captured). When are src and dst the same object? - AVE_PSGen::Init, new 0xfffffff00880bff8: when codec != 3 and (`*(cfg+0x1f6c) == 0x14` or `*(cfg+0x26c) == 2`), it zeroes cfg+0x24e0..cfg+0x2633 and calls GenerateVPS/SPS/PPS with x1 = x25 = cfg+0x24e0 (`mov w9,#0x24e0` at 0xfffffff00880c80c; `mov x1,x25` before each of the three calls at 0xfffffff00880c878, 0xfffffff00880cba0, 0xfffffff00880cde4). GeneratePPS passes src = cfg+0x24e0 as well. So in Init, src == dst. - Old AVE_PSGen::Init 0xfffffff0087de0b4: same condition (offsets 0x1f64 / 0x26c), ctx = cfg+0x24d8, and old GeneratePPS 0xfffffff0087dff58 passes src = cfg+0x24d8. Same aliasing. - Sequence in Init for HEVC with mode == 2: layer 0 finds no type-3 entries in src, so it generates `count` PPS into the ctx. Layer 1 (only if the object pointer at this+0x48 is non-null) now finds n > 0 and calls CopyType(src, 3, dst) with src == dst. - Old build: every appended entry is type 3 and increments `*src`, which the loop re-reads, so the loop does not terminate on the count. It ends only when AVE_PSInfo_Make returns an error; in old the only such error is the data-total check (offset + size >= 0x801). - New build: stopped twice over (alias check; and the 0x15 cap in AVE_PSInfo_Make). The other caller, AVE_CHM_SetDataInfo_Header (new 0xfffffff0087320f4, old 0xfffffff008707864): runs the three generators only when `*(cfg+0x26c) == 2` and a per-frame flag; dst = frameInfo+0x30, zeroed immediately before (stores of 0 to +0x30..+0x183), src = cfg+0x24e0 (old 0x24d8). Not aliased. Per pass it appends 1 + up to 2 + (all type-3 entries of src, once per layer). With a well-formed src of at most 9 PPS that is at most 21; with a src that already holds more, it exceeds 21 in the old build. ## P3.4 — counter writers and reset - Writes to ctx+0x0: only AVE_PSInfo_Make (old A: 0xfffffff0087f0518 `str w8,[x21]`; old B: 0xfffffff0087f0b60 `str w8,[x23]`), +1 per successful append; and the zeroing in Init / SetDataInfo_Header right before each generation pass (both builds). - So the counter IS reset at the start of every pass in the two callers examined. The overflow is not accumulation across passes; it is within one pass via the copy path. ## P3.5 — allocation - The context is NOT its own allocation. It is embedded: at cfg+0x24e0 (old 0x24d8) inside the object AVE_PSGen points to at this+0x8, and at frameInfo+0x30 inside the per-frame object. - Layout of one context: +0x0 count, +0x4 table (21 x 0x10 = 0x150), +0x154 data (0x800), ends at +0x954. - Enclosing object size: unknown. Lower bound for the cfg object from offsets used in GeneratePPS: fields at cfg+0x9b18 + layer*0x2180 are read, so it extends past cfg+0xbc98; the ctx ends at cfg+0x2e34. - kalloc_type: `rea search '^site\.'` finds 94 "site." strings (e.g. site.AVE_PSGen 0xfffffff0073253ad, site._S_AVE_Client 0xfffffff007304bff, site.HEVC_PPS 0xfffffff007319357), so the driver uses typed allocation sites generally. Which site allocates the cfg object or the frame-info object, its size, and its zone: unknown — the allowed tools search strings and names, they do not decode __kalloc_type descriptor records. ## P3.6 — direct answers - Is any caller "a loop over parsed NALs with no cap"? NO. All generation loops are bounded by constants (2 layers) or by a config count capped at 9 in BOTH builds. - Maximum calls on one context: - new build: 21 (enforced in AVE_PSInfo_Make). - old build, generation only: 21 by construction, never exceeding the table. - old build, copy path with src == dst (Init, HEVC, mode 2, second layer present, PPS count >= 1): not bounded by any count. It stops when total copied PPS bytes reach 0x800, i.e. roughly 0x800 / (PPS size in bytes) appends. PPS size unknown, so the number is unknown; it exceeds 21 whenever the generated PPS are smaller than about 97 bytes each. - Does the write leave the allocation? Not established, and probably not: entry k is written at ctx+4+16k. k >= 21 lands in the context's own data area; k >= 149 passes the end of the context (ctx+0x954) into following fields of the SAME enclosing object, which extends at least 0x8e00 bytes further. Leaving the enclosing allocation would need thousands of appends; the 0x800-byte cap allows at most 2048 even at 1 byte each. So: intra-object corruption (table -> data area -> neighbouring cfg fields), not a cross-allocation overflow, on this evidence. - Unknowns that decide reachability: whether mode 2 with a second HEVC layer and src == dst can actually be configured (what sets cfg+0x26c and this+0x48); what happens once appended entries and copied PPS bytes overlap in the data area (entries are then read back from overwritten memory — not analysed). ## P3.7 — CVE match (27.2 notes, AVEVideoEncoder, eight entries) | CVE | Impact wording | Fix wording | |---|---|---| | CVE-2026-112705 | app may cause unexpected system termination | out-of-bounds write | | CVE-2026-112689 | system termination or corrupt kernel memory | out-of-bounds write | | CVE-2026-112470 | system termination or corrupt kernel memory | out-of-bounds write | | CVE-2026-112469 | system termination or corrupt kernel memory | out-of-bounds write | | CVE-2026-112468 | system termination or corrupt kernel memory | out-of-bounds write | | CVE-2026-112466 | system termination or read kernel memory | out-of-bounds read | | CVE-2026-114025 | "A user may be able to cause unexpected app termination or arbitrary code execution" (added 20 Nov) | out-of-bounds write | | CVE-2026-112465 | system termination or read kernel memory (added 20 Nov) | out-of-bounds read | - Not one but five entries read as out-of-bounds write with kernel memory corruption or termination. The wording does not distinguish them, so neither the AVE_PSInfo_Make / CopyType fix nor the VPS bounds fix can be assigned a CVE from the notes alone: unknown. - The two out-of-bounds READ entries do not fit the AVE_PSInfo_Make write. The VPS validator guards reads in its own walks, so it is at least compatible with a read entry: not established. - Which iOS build ex_before comes from was not recorded here; if it is older than 27.1, some of these changes may belong to an earlier update. # Part 4 — zeroing vs layer loop, +0x26c, copy loop arithmetic, neighbouring fields (ex_after) Correction of names: there is no `AVE_PSGen::GenerateAll`. The log strings give `HEVC_PPS::GenerateAll` (0xfffffff0088b9a58); the layer loop is in `AVE_PSGen::GeneratePPS` (0xfffffff00880dec4). The object called "cfg" in part 3 is Init's third argument; it carries the same +0x1b84/+0x1b88 fields the Check* functions log as `pClient->sSessionCfg.sRes.iWidth/iHeight`, so it is the client object (name inferred from that match). ## P4.1 — zeroing and layer loop AVE_PSGen::Init 0xfffffff00880bff8 (x23 = this, x8 = *(this+8) = client): ``` 0xfffffff00880c7dc: ldr w8, [x23, #0x10] ; codec 0xfffffff00880c7e0: cmp w8, #0x3 0xfffffff00880c7e4: b.ne 0xfffffff00880c7f0 0xfffffff00880c7f0: ldr x8, [x23, #0x8] 0xfffffff00880c7f4: ldr w9, [x8, #0x1f6c] 0xfffffff00880c7f8: cmp w9, #0x14 0xfffffff00880c7fc: b.eq 0xfffffff00880c80c 0xfffffff00880c800: ldr w9, [x8, #0x26c] 0xfffffff00880c804: cmp w9, #0x2 0xfffffff00880c808: b.ne 0xfffffff00880c7e8 ; skip generation 0xfffffff00880c80c: mov w9, #0x24e0 0xfffffff00880c810: str wzr, [x8, #0x2630] 0xfffffff00880c814: add x25, x8, x9 ; ctx = client+0x24e0 0xfffffff00880c818: movi v0.2D, #0x0 0xfffffff00880c81c: str q0, [x8, #0x2620] ... 19 more `str q0, [x8, #off]` stepping down by 0x10 ... 0xfffffff00880c86c: str q0, [x8, #0x24e0] 0xfffffff00880c870: mov x0, x23 0xfffffff00880c874: mov x1, x25 0xfffffff00880c878: bl 0xfffffff00880d708 ; GenerateVPS 0xfffffff00880cba0: bl 0xfffffff00880daa4 ; GenerateSPS (x1 = x25) 0xfffffff00880cde4: bl 0xfffffff00880dec4 ; GeneratePPS (x1 = x25) ``` - Range zeroed: client+0x24e0 .. +0x2633 = 0x154 bytes = count + 21-entry table. The 0x800 data area is not zeroed. - The zero is straight-line code in Init, executed once per Init call, before the first generator call. It is not inside any loop and not inside the layer loop. Layer loop, AVE_PSGen::GeneratePPS 0xfffffff00880dec4 (HEVC branch): ``` 0xfffffff00880dfc4: mov x22, #0x0 ; layer index 0xfffffff00880dfc8: add x23, x28, #0x40 ; this+0x40: per-layer PPS objects 0xfffffff00880dfd4: mov w8, #0x1 0xfffffff00880dfe0: mov w20, #0x24e0 0xfffffff00880dfe4: mov x24, x8 ; loop head 0xfffffff00880dfe8: ldr x0, [x23, x22, LSL #0x3] 0xfffffff00880dfec: cbz x0, 0xfffffff00880e040 ; layer absent -> skip 0xfffffff00880dff4: ldr x8, [x28, #0x8] 0xfffffff00880dff8: ldr w2, [x8, #0x2138] ; PPS count 0xfffffff00880e014: ldr w6, [x8, #0x26c] ; mode 0xfffffff00880e018: ldur x9, [x29, #-0x58] ; 0xfffffff00880e01c: str x9, [sp] ; dst ctx (9th arg) 0xfffffff00880e028: add x7, x8, x20 ; src ctx = client+0x24e0 0xfffffff00880e02c: mov x5, x22 0xfffffff00880e030: bl 0xfffffff0088b9a58 ; HEVC_PPS::GenerateAll 0xfffffff00880e038: cbnz w0, 0xfffffff00880e2c4 ``` - Back edge: block 0xfffffff00880e040..0xfffffff00880e04c branches to 0xfffffff00880dfe4 (CFG; the instructions of that block were not printed, the two-iteration shape is from the decompile: `lVar7 = 1; bVar1 = false; } while (bVar4);`). - No store of zero to the ctx exists between 0xfffffff00880dfe4 and the back edge, nor anywhere in GeneratePPS or HEVC_PPS::GenerateAll. - Answer: the zero runs once per Init (and once per pass in AVE_CHM_SetDataInfo_Header), never per layer. It sits in a different function, before the call that contains the layer loop. Nothing clears the count between layer 0 and layer 1, which is what lets layer 1 see layer 0's PPS entries. "Once per session" in the strict sense is not established: how many times Init runs per session is unknown (its caller is AVE_MD_SVE::InitComponents 0xfffffff008867cf8). ## P4.2 — stores to +0x26c - Not found. The `search` tool matches strings and procedure names; it cannot search for an instruction pattern, so a store to client+0x26c cannot be located without enumerating functions, which is out of scope. - In every function analysed so far there are only READS of +0x26c: Init 0xfffffff00880c124, c348, c800, cf60; GeneratePPS 0xfffffff00880e014, e314; AVE_CHM_SetDataInfo_Header 0xfffffff0087321d8, 0xfffffff008732228. No `str`/`stp` with `#0x26c` in any of them. - One level up: AVE_MD_SVE::InitComponents passes the client pointer through unchanged (0xfffffff008867f74 `ldr x2,[x19,#0x20]`) and takes the codec from the neighbouring field (0xfffffff008867f78 `ldr w3,[x2,#0x270]`). It does not write +0x26c. - Value stored, writer, and whether it comes from a client-settable property or an internal constant: unknown. Only the tested value is known (2 selects the path). ## P4.3 — AVE_PSInfo_CopyType loop (new 0xfffffff00881edd4) ``` 0xfffffff00881ee80: ldr w8, [x19] ; *src 0xfffffff00881ee84: cmp w8, #0x1 0xfffffff00881ee88: b.lt 0xfffffff00881efa8 0xfffffff00881ee8c: mov x23, #0x0 ; i 0xfffffff00881ee90: add x25, x19, #0x4 ; src table 0xfffffff00881ee94: add x24, x19, #0x154 ; src data 0xfffffff00881ee9c: add x28, x25, x23, LSL #0x4 0xfffffff00881eeb0: ldr w9, [x28] ; entry type 0xfffffff00881eeb4: cmp w9, w20 0xfffffff00881eeb8: b.ne 0xfffffff00881ef9c 0xfffffff00881ef74: ldp w2, w8, [x28, #0x4] ; layer, offset 0xfffffff00881ef7c: ldr w9, [x28, #0xc] ; size 0xfffffff00881ef80: lsl w3, w9, #0x3 0xfffffff00881ef84: add x0, x24, x8 ; src data + offset 0xfffffff00881ef8c: mov x4, x21 ; dst 0xfffffff00881ef90: bl 0xfffffff00881e65c ; AVE_PSInfo_Make overload B 0xfffffff00881ef94: cbnz w0, 0xfffffff00881f1c0 0xfffffff00881ef98: ldr w8, [x19] ; re-read *src 0xfffffff00881ef9c: add x23, x23, #0x1 0xfffffff00881efa0: cmp x23, w8, SXTW 0xfffffff00881efa4: b.lt 0xfffffff00881ee9c ; loop condition: i < *src (re-read each pass) ``` The stores happen in the callee, overload B (new 0xfffffff00881e65c): ``` 0xfffffff00881e9d4: stp w20, w21, [x27] ; store 1: {type, layer} 8 bytes at dst+4+16*iNum 0xfffffff00881ebfc: stp w8, w9, [x27, #0x8] ; store 2: {offset, size} 8 bytes 0xfffffff00881ec04: cmp w10, #0x801 ; 0xfffffff00881ec08: b.ge ... ; data-total check, AFTER both stores 0xfffffff00881ec14: add x0, x8, #0x154 ; 0xfffffff00881ec1c: bl 0xfffffff0088c0de8 ; copy `size` bytes to dst+0x154+offset 0xfffffff00881ec2c: str w8, [x23] ; count++ (4 bytes at dst+0) ``` Per iteration: 16 bytes of table entry, plus `size` bytes of data, plus the 4-byte count. Both table stores precede the 0x801 check, so the iteration that fails the check has still written its 16-byte entry. What the 0x800 cap allows (old build, src == dst, no 0x15 check): the loop appends until the running data total would exceed 0x800. With s = bytes per PPS and ignoring the VPS/SPS bytes already present, successful appends are about 0x800 / s, plus one final entry written before the failing check. - entries beyond the 21-entry table = (0x800 / s) - 21 (+1), each 16 bytes. - s = 64: 32 entries, 11 past the table, 176 bytes, all inside the context's data area. - s = 16: 128 entries, 107 past the table, 1,712 bytes, still inside the data area (which ends at entry 149). - s = 8: 256 entries, 235 past the table, 3,760 bytes; the last 107 entries (1,712 bytes) fall after the end of the context. - hard ceiling at s = 1: 2,048 entries, 32,432 bytes past the table. The real s is unknown (generated PPS size was not measured), so the actual total is unknown. This arithmetic also assumes entries read back from the overlapped data area stay well-formed, which was not analysed. ## P4.4 — fields after the data area - `xrefs` takes an address or symbol, not a struct offset, so a per-field cross-reference is not possible with the allowed tools. What follows is every access at client+0x2e34 .. +0x33ff seen in the functions already analysed (Init, GenerateVPS/SPS/PPS, AVE_CHM_SetDataInfo_Header, InitComponents). The end of the enclosing object and a complete field list: unknown. Highest offset seen written on this object: +0xde10 (Init), so it is at least 0xde11 bytes. - Context at client+0x24e0 ends at client+0x2e34. | Offset (client+) | Seen in | Access | Relative to generation in Init | |---|---|---|---| | 0x2e34 | Init | address passed (with +0x32bc, then +0x331c) to 0x...88aff0 and the call before it — "init avc sps/pps" | before | | 0x2e3c | Init | read/address | before | | 0x2e44 | GeneratePPS, AVC branch | read as an argument to the AVC PPS generator | during, AVC codec only | | 0x2e54 | Init | write | before | | 0x2eb1 | Init | write (bool) | before | | 0x2ec8, 0x2ed0, 0x2ed5 | Init | write (1) | before | | 0x32bc, 0x331c | Init | address passed | before | - In Init, nothing after the three generator calls reads any of these: the success path goes to 0xfffffff00880d350, which is the exit logging. - AVE_CHM_SetDataInfo_Header reads none of them. - Whether any of them is read later in the session by functions not analysed: unknown. The offsets suggest this region holds the AVC parameter-set state (inferred from the "init avc sps/pps" calls); for an HEVC session whether that region is used at all is unknown. # Part 5 — who sets +0x26c, and whether size is read back (ex_after; tools + search-bytes, trace-native-values, inspect-native-instruction) ## P5.1 — byte-pattern search for stores covering client+0x26c Searched range: __text 0xfffffff0086ec810..0xfffffff0088c0707 (1,916,664 bytes), each search reported `complete: true`. The "64-bit, 128-bit and stp patterns" were not given in the request; the encodings below are derived here. A 32-bit or 64-bit `stp` cannot reach this offset (imm7 range), so only the Q-register `stp` forms apply. | Encoding searched | Pattern / mask | Hits | Instruction-aligned hits | |---|---|---|---| | `str wN, [xM, #0x26c]` | `00 6C 02 B9` / `00 FC FF FF` | 1 | 0xfffffff008763154 | | `str xN, [xM, #0x268]` (covers +0x26c) | `00 34 01 F9` / `00 FC FF FF` | 0 | - | | `str qN, [xM, #0x260]` | `00 98 80 3D` / `00 FC FF FF` | 0 | - | | `stp qA, qB, [xM, #0x260]` | `00 00 13 AD` / `00 80 FF FF` | 4 | 0xfffffff00882b4f4, 0xfffffff00889ee58 | | `stp qA, qB, [xM, #0x250]` | `00 80 12 AD` / `00 80 FF FF` | 5 | 0xfffffff0088757f8 | - inspect-native-instruction: 0xfffffff00882b4f4 = `stp q0,q0,[sp, #0x260]`; 0xfffffff00889ee58 = `stp q0,q0,[sp, #0x260]`; 0xfffffff0088757f8 = `stp q0,q0,[sp, #0x250]`. All three are stack zeroing (base sp), not the client object. The six unaligned hits are not instructions. - 0xfffffff008763154 = bytes `886e02b9` = `str w8,[x20, #0x26c]`, in function 0xfffffff008762e88, __func__ literal "AVE_Client_Verify" (0xfffffff007301eb5). - Not covered by these searches: stores through a computed address (`add xN, xM, #0x26c` then `str [xN]`, or a register index), and block writes (copy/zero calls) that span +0x26c. So "the only direct store" is established; "the only write" is not. ## P5.2 — the store and the value AVE_Client_Verify 0xfffffff008762e88..0xfffffff00876317b (x20 = arg x0 = pClient, x21 = arg x2 = pInfo): ``` 0xfffffff008762eb4: bl 0xfffffff0087624fc ; validation dispatcher (caller of the Check* functions) 0xfffffff008762ebc: cbz w0, 0xfffffff008762f2c ; continue only on success ("initial info is wrong" otherwise) 0xfffffff008762f2c: mov w8, #0x1b48 0xfffffff008762f30: add x0, x20, x8 0xfffffff008762f34: mov x1, x21 0xfffffff008762f38: mov w2, #0x5c0 0xfffffff008762f3c: bl 0xfffffff0088c0de8 ; copy pInfo[0..0x5c0) -> pClient+0x1b48 ... 0xfffffff008763144: ldr w8, [x20, #0x268] 0xfffffff008763148: cmp w8, #0x1 0xfffffff00876314c: b.ne 0xfffffff008763158 0xfffffff008763150: ldr w8, [x20, #0x1ba4] 0xfffffff008763154: str w8, [x20, #0x26c] ``` - trace-native-values on the function: the stored value is LOAD(x0 + 0x1ba4) (nodes 0xfffffff008763150#433/#434), stored to x0 + 0x26c (0xfffffff008763154#436). No constant feeds it. - Level 1: pClient+0x1ba4 lies inside the block copied at 0xfffffff008762f3c, so it equals pInfo+0x5c (0x1ba4 - 0x1b48). - Level 2: pInfo is arg x2 of AVE_Client_Verify. Callers: AVE_Client_Prepare 0xfffffff0087688ec (call site 0xfffffff0087689cc, `mov x2, x23`, x23 = its arg x3) and AVE_Client_Start 0xfffffff008769328 (call site 0xfffffff0087698e8, `mov x2, x27`, x27 = its arg x5). Their callers (0xfffffff0088a7698, 0xfffffff0088a8174) were not examined. - Classification: neither a constant nor a table. It is a field of the caller-supplied "info" structure (pInfo+0x5c), copied in after the Check* validation passes. That this structure is filled from user-client input is inferred (it is the structure the Check* functions validate and log as "initial info"), not shown at instruction level. - Whether pInfo+0x5c is itself range-checked: none of the Check* functions analysed (AVE_HEVC_CheckInfo, CheckDMVInfo, CheckGGMInfo) loads offset 0x5c. The dispatcher 0xfffffff0087624fc and the MCTF/LRME checks were not searched for it: unknown. ## P5.3 — which function sets +0x26c to 2, and when - AVE_Client_Verify sets pClient+0x26c = pInfo+0x5c when pClient+0x268 == 1. It becomes 2 when the supplied info has 2 at +0x5c. If pClient+0x268 != 1 the field keeps whatever it held before (initial value unknown; no other direct store exists). - pClient+0x268 is written at 0xfffffff008765d74 `str w27, [x19, #0x268]` in AVE_Client_Init (0xfffffff008765654, caller 0xfffffff008767220), next to `str w22, [x19, #0x270]` (codec). The origin of w27 was not traced: unknown. The second `#0x268` store hit (0xfffffff00879d878, AVE_Prop_Cfg_AVC_Init) writes a different structure. - AVE_Client_Verify also shows what surrounds the context in the client object: pClient+0x221c..0x24df is a copy of pInfo+0x15bc.. (0x2c4 bytes), the context is +0x24e0..0x2e33, and for HEVC (codec 2) the validated parameter sets are copied to pClient+0x3760 (from pInfo+0x1880, 0x2ad0 bytes: the VPS), +0x6230 (pInfo+0x4350, 0x38e8), +0x9b18 (pInfo+0x7c38, 0x4300), +0xde18, +0xe9e0. The PPS count used by GeneratePPS (pClient+0x2138) is pInfo+0x14d8 (copied by the 0x114-byte block at 0xfffffff008762f54). ## P5.4 — is `size` read back? Yes. Two read-backs, both in the old build as well (same instruction shapes at old 0xfffffff0087f0e40..0e4c and 0xfffffff0087f09a4): 1. Source entry, in AVE_PSInfo_CopyType: ``` 0xfffffff00881ef74: ldp w2, w8, [x28, #0x4] ; layer, offset of source entry i 0xfffffff00881ef78: sxtw x8, w8 0xfffffff00881ef7c: ldr w9, [x28, #0xc] ; size of source entry i 0xfffffff00881ef80: lsl w3, w9, #0x3 ; passed as iBits 0xfffffff00881ef84: add x0, x24, x8 ; source data pointer = src+0x154+offset ``` The `size` stored at 0xfffffff00881ebfc is `asr w9, w22, #0x3` of that argument, so each appended entry's size is the size read from source entry i. It is not computed from anything else. 2. Previous destination entry, in AVE_PSInfo_Make overload B: ``` 0xfffffff00881e9fc: ldp w9, w8, [x10] ; offset, size of entry iNum-1 0xfffffff00881ea00: add w8, w9, w8 ; new offset ``` When src == dst (old build), source entries with index >= 21 sit in the data area, the same memory the copy call at 0xfffffff00881ec1c writes PPS bytes into (dst+0x154+offset). Whether a copied PPS lands on an entry that has not been read yet depends on PPS size s and count N; with source index i lagging the append index n by N, and entry e at data offset 16*(e-21), the copy for append n (offset about n*s) hits a still-unread entry when 336/(16-s) < n <= (336+16N)/(16-s). That window is non-empty for any s < 16 with N >= 1, and empty for s >= 16. This is arithmetic on the layout assuming equal-sized PPS and ignoring the VPS/SPS bytes; it has not been run. What a corrupted entry does when read (instruction-level facts): - type field overwritten: the entry is copied only if `cmp w9, w20` (type == 3) matches at 0xfffffff00881eeb4; otherwise skipped. - layer field overwritten: overload B rejects layer >= 2 ("wrong layer ID", returns 0xfffffc17), which ends the copy loop (0xfffffff00881ef94 `cbnz w0`). - size / offset fields overwritten: size is used as `asr w9, w22, #3` after the `lsl #3`, i.e. as a signed value; the only limit is 0xfffffff00881ec04 `cmp w10, #0x801` / `b.ge` (signed) on offset + size. A large positive size fails the check and ends the loop. A size whose shifted value is negative passes it, lowers the running total (so the 0x800 cap no longer bounds the number of iterations), and reaches 0xfffffff00881ec0c `sxtw x2, w9` as the length of the copy call. The source pointer uses the entry's offset sign-extended (0xfffffff00881ef78), with no range check in CopyType. Answer: a corrupted size is re-read and can inflate the loop's progress; it can also become the copy length and, via the next entry's offset, the copy destination. Whether the bytes that land in a size field can be chosen (they are bytes of encoder-generated PPS), and the real PPS size, are unknown. Nothing here was executed. # Part 6 — layer array, user-client boundary, PPS size floor, VPS blob consumers (ex_after) ## P6.0 — caveat carried forward (load-bearing, unresolved) `pClient+0x268 == 1` gates the assignment `pClient+0x26c = pInfo+0x5c` in AVE_Client_Verify. +0x268 is written once, at 0xfffffff008765d74 `str w27, [x19, #0x268]` in AVE_Client_Init, from an argument that has NOT been traced. If that argument is a fixed hardware/config constant other than 1, mode 2 cannot be selected through the info structure and everything in parts 3–6 about the copy path is unreachable from an app. This is as decisive as the PPS size. Status: unknown. ## P6.1 — the two-entry array in AVE_PSGen::GeneratePPS - The array read at 0xfffffff00880dfe8 `ldr x0, [x23, x22, LSL #0x3]` (x23 = this+0x40) is filled in AVE_PSGen::Init, HEVC branch: ``` for (i = 0; i < *(int *)(pClient + 0x1bb0); i++) { this[6 + i] = FUN_fffffff0088b75bc(alloc(site 0xfffffff007f2b040), pClient + 0x6230 + i*0x1c74); // HEVC SPS object -> this+0x30+8i ... FUN_fffffff0088b75e0(...) // "failed to init hevc sps" this[8 + i] = FUN_fffffff0088b8d84(alloc(site 0xfffffff007f2b080), pClient + 0x9b18 + i*0x2180); // HEVC PPS object -> this+0x40+8i } ``` (decompile of Init; strings "psHEVCPS->pcaHEVC_SPS[i] != nullptr", "psHEVCPS->pcaHEVC_PPS[i] != nullptr". Instruction addresses of this loop were not extracted.) - Slot 1 is non-null exactly when the loop runs a second time, i.e. `*(int *)(pClient+0x1bb0) >= 2`. - Count, level 1: pClient+0x1bb0 is inside the block AVE_Client_Verify copies from pInfo (pInfo[0..0x5c0) -> pClient+0x1b48), so it is pInfo+0x68. - Count, level 2: pInfo+0x68 is the field AVE_HEVC_CheckInfo validates as `0 < pInfo->sSessionCfg.sEnc.iLayerNum && iLayerNum <= 2` (new 0xfffffff00875d914 `ldr w8,[x20,#0x68]` ; `sub w8,w8,#0x1` ; `cmp w8,#0x1` ; `b.hi`). So the array holds 1 or 2 objects, and 2 is an accepted value of a field in the caller-supplied info structure. ## P6.2 — callers of AVE_Client_Prepare / AVE_Client_Start, up to the user client | Function | Name (log strings) | Called from | |---|---|---| | 0xfffffff0087688ec | AVE_Client_Prepare | 0xfffffff0088a7698 | | 0xfffffff0088a7698 | "Prepare" (class string not captured) | 0xfffffff0088a7088 (call site 0xfffffff0088a7294) | | 0xfffffff0088a7088 | AppleAVE2UserClient :: IO_Prepare | no code callers, no incoming code references | | 0xfffffff008769328 | AVE_Client_Start | 0xfffffff0088a8174 | | 0xfffffff0088a8174 | "Start" (class string not captured) | 0xfffffff0088a7b64 (call site 0xfffffff0088a7d70) | | 0xfffffff0088a7b64 | AppleAVE2UserClient :: IO_Start | no code callers, no incoming code references | - IO_Prepare / IO_Start carry the assert strings "pIn != nullptr && inSize >= sizeof(S_AVE_UCInParam_Prepare) && pOut != ..." and the same for S_AVE_UCInParam_Start, plus "faild to map memory" / "pMemMap != nullptr". They take an input structure and size from the caller and map memory: this is the user-client boundary. Stopped here. - That they are entries of the IOUserClient external-method dispatch table is inferred from the class name, the pIn/inSize/pOut signature and the absence of code callers; the table itself was not located. - How the info structure (pInfo) is produced from pIn / the mapped memory inside "Prepare"/"Start" was not traced. ## P6.3 — PPS size floor HEVC_PPS::Generate 0xfffffff0088b93a4 writes, in order: writer init over ctx data (`FUN_fffffff00888c358(writer, 0, ctx+0x154+offset, 0x800-offset, 1)`), NAL header `FUN_fffffff0088b6cd4(0x22, 0, 1, writer)`, RBSP `FUN_fffffff0088b8da8` ("Write_pic_parameter_set_rbsp"), finish `FUN_fffffff00888c8a0`. - NAL header 0xfffffff0088b6cd4: one call to 0xfffffff00888c694 (not examined; may emit a start code or nothing), then `FUN_fffffff00888c62c(writer, (type&0x3f)<<9 | (layer&0x3f)<<3 | tid&7, 0x10)` = 16 bits. - Writer primitives, identified by use: 0xfffffff00888c398 = 1-bit flag; 0xfffffff00888c66c = ue(v); 0xfffffff00888c638 = se(v); 0xfffffff00888c62c(w, v, n) = n fixed bits. - Static call sites in the RBSP writer: 27 flag, 15 ue, 7 se, 2 fixed. Unconditional on the shortest path (num_extra_slice_header_bits == 0, optional blocks off): 5 ue + 3 se + 19 flags + one 3-bit field = at least 5 + 3 + 19 + 3 = 30 bits, plus trailing bits -> 4 bytes. - Lower bound: 4 bytes RBSP + 2 bytes NAL header = 6 bytes, plus whatever 0xfffffff00888c694 emits (unknown, so the floor is 6 and could be 9–10 with a start code). Non-zero ids and offsets add a few bits each. A measured size is not available; nothing was run. - Consequence: the generated PPS is very likely under 16 bytes, which is the regime where copied PPS bytes can land on unread entries (P5.4). ## P6.4 — consumers of the VPS copy at pClient+0x3760 `xrefs` cannot take a struct offset; these come from a byte search for `mov wN, #0x3760` (`00 EC 86 52` / `E0 FF FF FF`, complete over __text): three hits. | Site | Function | Use | |---|---|---| | 0xfffffff008763050 | AVE_Client_Verify | the copy in (pInfo+0x1880 -> pClient+0x3760, 0x2ad0 bytes) | | 0xfffffff00880c540 | AVE_PSGen::Init | passes pClient+0x3760 to the HEVC_VPS object constructor `FUN_fffffff008829f28(obj, pClient+0x3760, pClient+0x7de4)`; the object keeps the pointer | | 0xfffffff008730f84 | AVE_CHM_MakeFwCmd_Start_HEVC (0xfffffff008730c5c) | copies pClient+0x3760 (0x2ad0 bytes) into the firmware start command at cmd+0x3a20; the instruction just before copies pClient+0x24e0 (0x154 bytes, the context count + table) into the command as well | - Offsets formed another way (e.g. `add` with a shifted immediate) are not covered by this search. - The function that walks the VPS blob is the HEVC_VPS writer 0xfffffff00882a49c ("video_parameter_set_rbsp"), called only from HEVC_VPS::Generate (0xfffffff00882a070), which is called from AVE_PSGen::GenerateVPS. It reads every field through the stored pointer and re-reads its loop bounds from the blob on each pass, for example: - `do { ... } while (i <= *(uint *)(blob + 8))` (guarded once by `*(uint *)(blob+8) < 7`), - `if (*(uint *)(blob+0xf74) < 0x3f) for (i = 1; i <= *(uint *)(blob+0xf78); i++) for (j = 0; j <= *(uint *)(blob+0xf74); j++) flag(*(byte *)(blob + 0xf7c + i*0x40 + j))`, - `for (i = 0; i < *(uint *)(blob+0x1390); i++) ue(*(u32 *)(blob+0x1394 + i*4))`, - and the extension writer 0xfffffff00882b478 (not examined). blob+0xf78 and blob+0x1390 have no range check inside this function; they rely on the Check* validation done before the copy. - Does it run after parameter-set generation in the same session? Yes on one path: AVE_CHM_SetDataInfo_Header calls GenerateVPS on every pass it takes (mode 2 and the per-frame flag), which is after Init has already generated VPS/SPS/PPS. Inside Init itself, GenerateVPS runs BEFORE GeneratePPS. When AVE_CHM_MakeFwCmd_Start_HEVC runs relative to Init is unknown (its caller 0xfffffff0087da068 was not examined). ## P6.5 — direct answer (arithmetic on the layout, old-build behaviour, not executed) Notation: s = PPS bytes, N = PPS count (1..9), B0 = bytes of VPS + SPS already in the data area (unknown), entry n at ctx+4+16n, copy for entry n at data offset B0 + (n-3)*s. - First copy that lands on an already-written, not-yet-read entry: the smallest n with n*(16-s) > 336 + B0 - 3s. | s | B0 = 0 | B0 = 120 (illustrative) | |---|---|---| | 6 | entry 32 | entry 44 | | 8 | entry 40 | entry 55 | | 10 | entry 52 | entry 72 | | 12 | entry 76 | entry 106 | So with a PPS at or near the floor, roughly 30–100 entries are appended (10–80 past the table) before a copy first overwrites an unread entry. Whether that particular overwrite hits the size field with the type field still equal to 3 depends on alignment and on the PPS bytes: unknown. - Is index 295 reachable without a corrupted entry? No. On a run with no overwritten entry the count is limited by the data cap to about 3 + (0x800 - B0)/s, which reaches 296 only if s <= (0x800 - B0)/293, i.e. s = 6 with B0 under about 290 bytes; and for s = 6 the first overlap already occurs near entry 32–44. Every path to index 295 passes through entries that have been overwritten. - Whether index 295 is reachable THROUGH overwritten entries (entry skipped when type != 3, loop ended by layer >= 2 or a large positive size, cap defeated by a negative size) depends on the generated PPS bytes: unknown. # Part 7 — the +0x268 gate, and the VPS writer's count-bounded walks (ex_after) ## P7.1 — gate result: +0x268 is the client type chosen when the user client is opened `xrefs` AVE_Client_Init (0xfffffff008765654): one code reference, 0xfffffff008767914, in AVE_Client_Create (0xfffffff008767220); the other (0xfffffff00ba48534) is in __LINKEDIT. Chain, innermost first, each step quoted: 1. AVE_Client_Init: `0xfffffff0087656a4: ldr w27, [x29, #0x18]` (second stack argument) ... `0xfffffff008765754: cmp w27, #0x6` / `b.cs` (reject) ; `0xfffffff00876575c: cmp w27, #0x1` / `b.ne 0xfffffff008765a9c` ... `0xfffffff008765d74: str w27, [x19, #0x268]`. 2. AVE_Client_Create: `0xfffffff00876727c: ldr w28, [x29, #0x10]` (its first stack argument) ; `0xfffffff00876728c: stur x28, [x29, #-0x78]` ; at the call `0xfffffff0087678ec: ldur x8, [x29, #-0x78]` ; `0xfffffff0087678f0: str w8, [sp, #0x8]` ; `0xfffffff008767914: bl 0xfffffff008765654`. 3. Level 1 — AppleAVE2UserClient::Create-client method 0xfffffff0088ad520 (strings "AppleAVE2UserClient", "Create", "failed to create a client"): `0xfffffff0088ad64c: ldr w8, [x19, #0xf4]` ; `0xfffffff0088ad660: str w8, [sp]` ; `0xfffffff0088ad670: bl 0xfffffff008767220`. The value is the user-client object's field +0xf4. (This method is reached from the user client's "Open" handler 0xfffffff0088a5aa4, which takes pIn/pOut.) 4. Level 2 — the only store covering userClient+0xf4 found by byte search (`str w,[x,#0xf4]`: 0 hits; `stur`: 0; `str x,[x,#0xf0]` in the user-client range: 0; `stp w,w,[x,#0xf0]`: 1 hit) is `0xfffffff0088ace4c: stp w0, w25, [x19, #0xf0]` in AppleAVE2UserClient::Init 0xfffffff0088acd24, where w25 = argument x5, checked by `0xfffffff0088acdd8: cmp w25, #0x6` / `b.cs` (assert "AVE_ClientType_None <= type && type < AVE_ClientType_Max"). 5. Its caller, the user-client factory 0xfffffff0088ac68c (strings "AppleAVE2UserClient", "Create", "checking entitlements"): `0xfffffff0088ac73c: and w26, w23, #0xf` ; `0xfffffff0088ac740: sub w8, w26, #0x1` (accepted 1..5) ; `0xfffffff0088ac74c: and w27, w23, #0xfffffff0` ; `0xfffffff0088acbc4: mov x5, x26` ; `0xfffffff0088acbcc: bl 0xfffffff0088acd24`. w23 is its argument w4. If the upper bits (w27) are zero it goes straight to Init; otherwise it calls AVE_Entitlement_Check 0xfffffff0088af1ec first (bit 11 requires the "aocp-client" entitlement; other bits not read). 6. Its caller is AppleAVE2Driver::newUserClient 0xfffffff0088b319c (strings "AppleAVE2Driver", "newUserClient", "ID: %lld Type: %d"; no code callers): `0xfffffff0088b31c8: mov x23, x3` ... `0xfffffff0088b32b8: mov x4, x23` ; `0xfffffff0088b32c0: bl 0xfffffff0088ac68c`. x3 of newUserClient is the `type` argument of the open call. Classification: a client field. pClient+0x268 is the low 4 bits of the connection `type` the opening process passes when it creates the user client (the AVE_ClientType enumerator, 1..5). It is not a device-tree value, a hardware capability constant, or a fixed literal. Type 1 needs no entitlement inside this driver when the upper bits of `type` are zero. Result: the gate is REACHABLE at the level asked — a process that can open this user client can choose type 1, and with it mode = pInfo+0x5c. The documented-dead-end outcome (a fixed non-1 constant making the whole copy path unreachable) did NOT occur; had it, parts 3–6 would have been closed as a dead end, which would have been a legitimate result. Not established, and outside this binary: whether an ordinary sandboxed app is allowed to open AppleAVE2UserClient at all (sandbox profile / IOKit open policy). Which enumerator name corresponds to 1: unknown. ## P7.2 — steering analysis: not done The request to map client-controlled PPS syntax elements onto the byte positions of an overwritten size field was not carried out. Recorded as not done, not as unknown-after-trying. ## P7.3 — VPS writer 0xfffffff00882a49c: the two count-bounded walks x19 = writer object; [x19] = pointer to the VPS blob (pClient+0x3760); [x19,#0x10] = syntax writer. Walk A, bounded by blob+0xf78 (and blob+0xf74): ``` 0xfffffff00882a76c: ldr w1, [x8, #0xf78] ; emitted as ue(v) 0xfffffff00882a77c: ldr w9, [x8, #0xf74] 0xfffffff00882a780: cmp w9, #0x3e 0xfffffff00882a784: b.hi 0xfffffff00882aa00 ; only range check here: +0xf74 <= 0x3e 0xfffffff00882a788: ldr w9, [x8, #0xf78] 0xfffffff00882a78c: cbz w9, 0xfffffff00882a7ec 0xfffffff00882a790: mov w9, #0x1 ; i = 1 0xfffffff00882a794: mov w21, #0x0 ; j = 0 0xfffffff00882a7a0: add x8, x8, #0xf7c 0xfffffff00882a7a4: add x9, x8, x22, LSL #0x6 ; blob + 0xf7c + i*0x40 0xfffffff00882a7b8: ldrb w8, [x9, w21, UXTW] 0xfffffff00882a7c0: bl 0xfffffff00888c398 ; write 1 flag bit 0xfffffff00882a7c8: add w21, w21, #0x1 0xfffffff00882a7d0: ldr w9, [x8, #0xf74] ; re-read 0xfffffff00882a7d4: cmp w21, w9 0xfffffff00882a7d8: b.ls 0xfffffff00882a79c ; j <= +0xf74 0xfffffff00882a7dc: add w9, w22, #0x1 0xfffffff00882a7e0: ldr w10, [x8, #0xf78] ; re-read 0xfffffff00882a7e4: cmp w9, w10 0xfffffff00882a7e8: b.ls 0xfffffff00882a794 ; i <= +0xf78 ``` - No compare of +0xf78 against any constant in this function. The array starts at blob+0xf7c with 0x40-byte rows; the next field read is blob+0x137c, so the array is 0x400 bytes = 16 rows (0..15), matching the caller-side check `vps_num_layer_sets_minus1 < 16`. - Can it leave the blob on a corrupted +0xf78? Yes, as a READ: row i >= 16 is past the array; the blob is 0x2ad0 bytes, so rows from i = 110 on (0xf7c + 110*0x40 = 0x2afc) are past the blob. The pointer-tag check at 0xfffffff00882a7a8 (`eor` / `tst #0xffc0000000000000`) only catches a change in the top address bits, not a row past the array. Each byte read is emitted as one bit into the generated VPS. The walk also stops if the syntax writer returns an error (`cbnz w0, 0xfffffff00882a4e0`); whether the writer errors when its buffer is full was not examined, so the maximum distance is unknown. Walk B, bounded by blob+0x1390: ``` 0xfffffff00882a894: ldr w1, [x8, #0x1390] ; emitted as ue(v) 0xfffffff00882a8a4: ldr w9, [x8, #0x1390] 0xfffffff00882a8a8: cbz w9, 0xfffffff00882a900 0xfffffff00882a8ac: mov x21, #0x0 0xfffffff00882a8b0: mov w22, #0x1394 0xfffffff00882a8b4: mov w23, #0x13d4 0xfffffff00882a8bc: add x8, x8, x22 0xfffffff00882a8c0: ldr w1, [x8, x21, LSL #0x2] ; blob + 0x1394 + 4*i 0xfffffff00882a8c4: bl 0xfffffff00888c66c ; ue(v) 0xfffffff00882a8cc: cbz x21, 0xfffffff00882a8ec 0xfffffff00882a8d8: add x8, x8, x23 0xfffffff00882a8dc: ldrb w8, [x8, x21] ; blob + 0x13d4 + i 0xfffffff00882a8e4: bl 0xfffffff00888c398 ; flag 0xfffffff00882a8ec: add x21, x21, #0x1 0xfffffff00882a8f4: ldr w9, [x8, #0x1390] ; re-read 0xfffffff00882a8f8: cmp x21, x9 0xfffffff00882a8fc: b.cc 0xfffffff00882a8b8 ; i < +0x1390 ``` - No range check on +0x1390 in this function. The u32 array is 0x1394..0x13d3 (16 entries) and the byte array 0x13d4..0x13e3 (16 entries), matching the caller-side check `vps_num_hrd_parameters <= 16`. - Can it leave the blob on a corrupted +0x1390? Yes, as a READ: i >= 16 is past both arrays; 0x1394 + 4*i passes the end of the blob at i >= 1487. Same stop condition (writer error) and same unknown about its limit. Both walks only read from the blob and write bits to the syntax writer; neither stores through an index derived from these counts. They are bounded only by values re-read from the blob, so they depend entirely on the validation done before the copy into pClient+0x3760 — which is what the Check* additions in the new build tighten. Not established: that the AVE_PSInfo runaway can actually modify +0xf78 or +0x1390 (those offsets are about 544 and 609 table entries past the context base), and what the extension writer 0xfffffff00882b478 does. # Part 8 — syntax-writer bound: VPS cascade is a near-miss Sink 0xfffffff00888c398 (bit writer), init 0xfffffff00888c358. - init: [w+0x18] = dest base (caller buf x2, else internal w+0x20); [w+0x10] = capacity (caller size x3, else 0x800); PPS path inits it as (writer, 0, ctx+0x154+offset, 0x800-offset, 1) so cap <= 0x800. - writer: byte index = bitpos>>3 at [w+0x8]; compared to capacity [w+0x10] before BOTH strb stores: 0xfffffff00888c3f0 cmp w8,w9 ; 0xfffffff00888c3f4 b.ge 45c (skip store) 0xfffffff00888c438 cmp w9,w8 ; 0xfffffff00888c43c b.ge 45c 0xfffffff00888c45c returns 0xfffffc05. - VPS walk aborts on the error: each write is followed by `cbnz w0, 0xfffffff00882a4e0`. Conclusion: the syntax writer is BOUNDED. A corrupted vps_num_layer_sets (+0xf78) or vps_num_hrd_parameters (+0x1390) causes an out-of-bounds READ of the blob (stray bytes emitted as bits, bounded output), not an out-of-bounds write. The VPS-cascade escalation from the AVE_PSInfo table overflow is a NEAR-MISS for a write primitive. The only confirmed OOB write remains the AVE_PSInfo_Make table store (parts 3-6), which parts 4-6 found stays within the enclosing client object for realistic PPS sizes. # Scope / purpose note (recorded per request, with the boundary stated) Stated purpose of this analysis: develop a jailbreak primitive for AppleAVE2 on iOS 26.5.2 / 27.0.1. What is documented here: root cause, the patch diff (added bounds checks), impact classification, reachability of the client-type gate, and the near-miss result above. This is vulnerability analysis of an already-patched bug. What is NOT done here, pending explicit authorization context (owned device / coordinated disclosure / sanctioned engagement): input shaping to make the corrupted size field controllable, i.e. turning the intra-object table overflow into a controllable kernel write. That step is weaponization and is held, not "in scope", until that context is given. If the writer stays bounded and the table overflow cannot be driven past the enclosing allocation, this remains a documented near-miss rather than a usable primitive. # Part 9 — payload-copy bounds, and VPS field semantics ## 9.1 payload copy (AVE_PSInfo_Make overload B, called from the alias loop) The alias loop's call at 0xfffffff00881ef90 enters overload B (0xfffffff00881e65c); the payload copy is inside it: ``` 0xfffffff00881ebf8: asr w9, w22, #0x3 ; size = bits (w22) >> 3, ARITHMETIC shift (signed) 0xfffffff00881ebfc: stp w8, w9, [x27, #0x8] ; store {offset,size} into the dst entry 0xfffffff00881ec00: add w10, w8, w22, ASR #0x3 ; offset + size 0xfffffff00881ec04: cmp w10, #0x801 0xfffffff00881ec08: b.ge 0xfffffff00881ec34 ; the ONLY gate: signed (offset+size) < 0x801 0xfffffff00881ec0c: sxtw x2, w9 ; copy length = sign-extended size 0xfffffff00881ec10: add x8, x23, w8, SXTW ; x23 = dst base, + offset (sign-extended) 0xfffffff00881ec14: add x0, x8, #0x154 ; dst + 0x154 + offset 0xfffffff00881ec18: mov x1, x19 ; src 0xfffffff00881ec1c: bl 0xfffffff0088c0de8 ; copy ``` - The copy primitive 0xfffffff0088c0de8 is a 4-instruction tail-call thunk: `ldr x16,[GOT -0xff80d2000+0x9b0]; braa x16` -> imported memcpy/memmove. No internal length clamp; x2 is used as-is. - Offset bound: none of its own. offset is a running total (prev.offset+prev.size, 0xfffffff00881ea00), only constrained by the shared 0x801 check. - Size bound: none of its own. Only the shared signed `offset+size < 0x801`. - Max write past the base (dst+0x154): - positive offset,size: offset+size <= 0x800, so the copy ends at dst+0x954 = end of the context data area; stays inside the enclosing client object -> near-miss. - size with bit31 set: `asr` keeps it negative, `offset+size` is small/negative so the signed compare PASSES, then `sxtw x2,w9` makes the memcpy length a ~2^64 value -> unbounded copy. The destination offset is likewise `SXTW` so a negative offset also moves the base backward. - So the check is insufficient (signed compare + sign-extended length). Whether a negative size/offset is actually reachable depends on the overlap read-back placing such a value in a source entry (Part 5), which is the input-shaping step held pending authorization. With only non-negative values this copy is bounded to the context data area (near-miss). The signed-compare weakness is recorded as an impact fact; it is not demonstrated reachable here. ## 9.2 VPS blob field semantics (resolving the +0xf78 question) VPS writer 0xfffffff00882a49c, blob base = pClient+0x3760: - +0xf74: emitted as 6 fixed bits (0xfffffff00882a758 mov w2,#6); range-checked `<= 0x3e` (0xfffffff00882a780). Role: per-row COUNT/max-index; bounds the inner column loop (j = 0..+0xf74 inclusive). - +0xf78: emitted as ue(v) (0xfffffff00882a76c). Role: ENTRY COUNT (number of layer-set rows), NOT a bit/byte length. Bounds the outer loop i = 1..+0xf78. This resolves the discrepancy: it is a count. - array +0xf7c: row stride 0x40 (i*0x40), next field at +0x137c, so extent = 0x137c-0xf7c = 0x400 bytes = 16 rows x 0x40. Matches Check "vps_num_layer_sets_minus1 < 16". - +0x1390: emitted as ue(v) (0xfffffff00882a894). Role: ENTRY COUNT (vps_num_hrd_parameters). Bounds loop i = 0..+0x1390-1. - array +0x1394: u32, stride 4; array +0x13d4: byte, stride 1; next field +0x13e4. So +0x1394 = 16 x u32 (0x40 bytes), +0x13d4 = 16 x byte (0x10 bytes). Matches Check "vps_num_hrd_parameters <= 16". Neither +0xf78 nor +0x1390 is a length; both are entry counts whose arrays hold 16 entries. In the writer they bound reads only (Part 8: sink is bounded), so corrupting them is an over-read, not a write. # Part 10 — CVE attribution (iOS 27.2, AVEVideoEncoder) Advisory text pulled from https://support.apple.com/en-us/149230 (6 AVEVideoEncoder blocks): - 112705: "unexpected system termination" | "out-of-bounds write ... improved bounds checking" | Marco Schmitt, Andrey Chernykh, Josh Maine (Calif.io) - 112689: "... or corrupt kernel memory" | "out-of-bounds write ... improved input validation" | Franco Belman (Blackwing) - 112470/112469/112468: "... or corrupt kernel memory" | "out-of-bounds write ... improved bounds checking" (shared) | Hcamael and 章鱼哥@aipy - 112466: "... or read kernel memory" | "out-of-bounds read ... improved input validation" | Hcamael and 章鱼哥@aipy - 114025: "A user ... unexpected app termination or arbitrary code execution" | "out-of-bounds write ... improved input validation" | Josh Maine (Calif.io) | Entry added Nov 20 2026 - 112465: "... or read kernel memory" | "out-of-bounds read ... improved bounds checking" | Hcamael and 章鱼哥@aipy | Entry added Nov 20 2026 Diff's added mitigations (all confirmed absent in ex_before 24A446, present in ex_after 24B119): (A) parsed-field validators: AVE_HEVC_CheckVPSExtBounds + expanded checks in AVE_HEVC_CheckInfo/CheckDMVInfo/CheckGGMInfo = "input validation". (B) AVE_PSInfo_Make entry-count cap cmp #0x15; b.cs "too many parameter sets" = "bounds checking" on a write. (C) CopyType alias guard 0xfffffff00881ee78 cmp x19,x21; b.eq "source and destination alias" = logic (no "logic issue" description exists among the 8, so folded into the write fix). Best single match for the analyzed write bug (AVE_PSInfo_Make table overflow via aliased self-copy, 16-byte entries past the 21-slot table into the kernel object): CVE-2026-112470 / -112469 / -112468. Deciding wording: "out-of-bounds write ... corrupt kernel memory" (controlled write into kernel memory, not a crash) + "improved bounds checking" (the literal count cap). Three-CVE cluster, one credit, identical text -> cannot narrow to one. Best match for the read-side hardening (VPS-writer over-reads, bounded sink per Part 8, guarded by (A)): CVE-2026-112466 ("out-of-bounds read ... improved input validation"). Cannot be excluded: - 112689 (write/input-validation) if the table fix is attributed to (A) not (B). - 114025 (write/ACE): the signed compare at 0xfffffff00881ec04 is PRE-EXISTING (in ex_before too); this patch does not fix it, it closes the controllable path upstream via (B)+(C). So an ACE entry fixed here = same overflow by impact angle, not a separate compare fix. Different credit, added later. - 112705 (termination-only) and 112465 (read/bounds-checking): plausible sibling variants, weaker textual fit. Conclusion: NOT a single CVE. The diff is a bundle closing >=1 kernel-corrupting write (best: 112470/469/468 cluster) + VPS over-read hardening (best: 112466); advisory text does not support unique 1:1 attribution. 27.1 vs 27.2: 27.1 published no CVEs (iPhone Duo-only), so all these AVEVideoEncoder CVEs attribute to 27.2. The 24A446->24B119 diff spans 27.0.1->27.1->27.2; a code change could have landed physically in the 27.1 build without a CVE. Cannot bisect 27.1 vs 27.2 at instruction level without the intermediate 27.1 build. 114025/112465 "Entry added Nov 20 2026" = advisory-listing date, not build date. # Part 11 — enclosing allocation resolved (non-negative case = definitive near-miss) Allocation site: AVE_Client_Create 0xfffffff0087678d0, `bl 0xfffffff0088c0778` with x0 = type descriptor DAT_fffffff007f28c40. The allocator 0xfffffff0088c0778 is a braa thunk to import thunk_EXT_FUN_8011000004316e64 taking one descriptor arg = kalloc_type typed allocation. Result becomes the client object (x28 -> passed to AVE_Client_Init as the object base). Typed zone: YES. Descriptor is in __kalloc_type (0xf27540..0xf2c840). kalloc_type_view @ 0xfffffff007f28c40 (64 bytes read): 00000000 00000000 00000000 00000000 ff0b3000 00002000 00000000 00000000 f9812e00 00006000 74000000 d0470100 00000000 00000000 00000000 00000000 +0x10 zv_name -> "site._S_AVE_Client" (0xfffffff007304bff) +0x20 kt_signature -> layout signature string (0x304bf0) +0x28 kt_flags = 0x74 +0x2c kt_size = 0x000147d0 = 83920 bytes Cross-check: highest access on the object = AVE_Client_Verify copy to pClient+0xe9e0 size 0x5dd8, ends 0x147b8 = kt_size - 0x18. Object sized exactly to its last field -> 0x147d0 confirmed. Definitive containment (non-negative, non-corrupted case): - context pClient+0x24e0..+0x2e34 (count + 21-slot table + 0x800 data). - legit PPS size ~6-10B => 0x801 data-total check aborts the loop at ~entry 149 => table write ceiling pClient+0x2e34. - allocation ends pClient+0x147d0. Headroom from clean ceiling = 0x147d0-0x2e34 = 0x1199c (~72KB) inside the object. => non-negative case stays inside the _S_AVE_Client allocation, definitively. Near-miss confirmed. Correction to Part 6: the holding bound is the 0x801 data-total check, NOT the object size. Table slot pClient+0x24e4+16n reaches the allocation boundary only at n ~= 4655 (0x147d0/16). It stays below that because legit entries have non-zero size so the data cap trips first (~entry 149). A sustained zero/near-zero-size run would not be stopped by the data cap and would reach the allocation boundary -> cross-object heap corruption; producing such entries is the corrupted-feedback/shaping regime (not analyzed). ## 2026-12-01 — probe running on device, no entitlements - Install path solved: zsign 1.1.3 seals CodeResources before rewriting Info.plist, so the CodeDirectory special slot -1 goes stale. Workaround: sign twice (pass 1 normalizes the plist, pass 2 seals final bytes). Verified with a CodeDirectory slot-vs-file comparison, not CodeResources alone. - matchService resolves service 5131 (AppleAVE2Driver). - sweepTypes saturated: every type with bit 11 set -> 0xe00002bd (kIOReturnNoMemory). Bits 0-4,5,6,7,8,9,10 and all-ones variants identical. Bit 11 remains the only discriminating bit. Baseline without any entitlement. - Self-check ABSENT for aocp-client, com.apple.security.aocp-client, com.apple.security.iokit-user-client-class. ## 2026-12-01 — type dispatch map, entitlement-free - Types 1-5 -> 0xe00002e2 (kIOReturnNotPermitted). Entitlement-gated. - Types 0,6,7 and ALL bit-11 variants -> 0xe00002bd (kIOReturnNoMemory). - Setting bit 11 selects an ungated class; low bits are ignored when bit 11 is set. Bit 11 is a class selector, not a modifier. - Entitlement in the profile is mandatory. Types outside the profile are rejected at install with 0xe8008015 (entitlements must be a subset of profile Entitlements). - A locally re-signed profile is NOT accepted; the device validates the Apple signature on the profile itself. ## 2026-12-01 — hot vs cold, negative - Screen recording active (AVE encoding) during sweep: no change from cold. - 0,6,7 / bit-11 stay 0xe00002bd. 1-5 stay 0xe00002e2. Properties still unreadable. - Power state is NOT the variable. kIOReturnNoMemory is not "block powered down". - Property reads are gated separately (iokit-get-properties), so no class name available. ## 2026-12-01 — sandbox deny PROVEN - kernel Sandbox: AVEProbe(pid) deny(1) iokit-open-user-client AppleAVE2UserClient - Deny is per-CLASS, not per-type; one report covers all gated attempts. - 1-5 = sandbox deny (0xe00002e2). 0/6/7 + bit-11 = sandbox ALLOWED, driver refuses (0xe00002bd). - Entitlement fixes 1-5 and is mandatory. NoMemory on 0/6/7 is a separate driver-side issue. - No escape is possible; the entitlement compiles an allow rule into the app profile. ## 2026-12-01 — SideStore portal unusable - Install-from-URL and share-sheet both fail: "bundle ID could not be found" (SideStore.OperationError 1), for unsuffixed AND suffixed ID. - Lookup/session failure inside SideStore, not a naming problem. Entitlement injection via SideStore blocked for now. ## 2026-12-01 — property reads denied, service topology - iokit-get-properties denied for every property; only IOClass and parent name/device_type readable. - class AppleAVE2Driver, parent node name="ave", device_type="ave". - Driver publishes (unreadable): IOUserClientClass, AVC/HEVC EncoderMaxPixelRate, AVC/HEVC EncoderChromaFormat, IOAVE{AVC,HEVC}EncoderCapabilities, MCTFChromaFormat, IOAVEMCTFFilterCapabilities, IOPowerManagement. - Confirms HEVC is the target codec path. ## 2026-12-01 — CONCLUSION: entitlement unobtainable on a free team - Sideloadly installs with the custom entitlements file attached, but the installed signature contains exactly the profile's Entitlements and nothing else. Verified via AppProxy entitlements in `pymobiledevice3 apps list`. - The minted profile is `local: true`, TTL 7, and carries only the App ID capability set. - Free-team profiles cannot be given `com.apple.security.iokit-user-client-class`: not a portal checkbox, not a tool field, not a capability the free catalog offers. - Device enforces entitlements ⊆ profile at install (0xe8008015). Confirmed on SideStore, Sideloadly, and a hand-re-signed profile. - Types 1-5 remain unreachable. 0/6/7 reachable but return kIOReturnNoMemory. - PATH FORWARD: paid membership + Capability Request for IOKit User Client Class. - Device is iOS 27.0.1 (handover said 27.2).