1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# Lifetime-defect sweep across all twelve TAs
Every defect this round produced was an object-lifetime bug in GCP, so the obvious question
is whether the other eleven TAs share the habit. `fw/ta_lifetime_audit.py` answers it by
detecting the three shapes on decompiled pseudocode — which only became possible after the
signature/type work, since nothing decompiled cleanly before that.
## The detector failed its own control twice
The control is that it must rediscover all three known GCP defects. Two versions did not:
* **v1** matched any lvalue and drowned in loop induction variables — ~50 hits, nearly all
`++i` in library code, and it missed all three controls.
* **v2** still missed `FE0C`, because the neighbouring handle counter
`p_asd_refcount[2] = v9 + 1` shares a base pointer with the refcount and looked like a
rollback.
* **v3** restricts the counter class to *persistent* state (dereferences, struct fields,
indexed slots) and makes the rollback test direction-aware on the exact lvalue. It
rediscovers `FE0C` (A), `FE0D` (A+C) and `FE0F` (B).
Only v3's output is reported here.
## Fleet result
| TA | signatures | assessment |
|---|---|---|
| **gcp** | **9** | 3 known defects + **6 related instances** (below) |
| fp | 4 | false positives: index bounded (`> 3u`), local arrays |
| opm | 2 | false positives — and instructive (below) |
| xgmi | 1 | local counter |
| powerplay | 0 | — |
| auc, csu, merit, oc, rap, tmz, wspe | 0 | — |
**The sloppiness is concentrated in GCP, not endemic.** Seven of twelve TAs have no
signature at all.
## What it found in GCP beyond the known three
* **The liveness-free lookup is a pattern of three**, not one — `FE0F` plus
`GetCryptoSessionByDecodeHandle` and `GetCryptoSessionByUASPHandle`, all scanning
`ctx->crypto` 64 times with no `state` test. Recorded in
`FINDING-GCP-FE0F-STALE-SLOT-LOOKUP.md`.
* **The acquire-gate shape covers three create paths**, not one: `FE0C`,
`cmd01_AllocateDRMSession` and `FE07_CreateAuthenticatedSession`. The `cmd01` hit is
independent static confirmation of something already measured on hardware — a *failed*
`cmd 1` leaves the counter incremented and primes `FE0C` to skip its acquire.
* `FE0B_DestroyAuthenticatedSession` and `FE0A_QueryAuthenticatedSession` also clear a
single field without zero-filling, so the destroy-side residue is not unique to `FE0D`.
## OPM does the same lifecycle correctly — which strengthens the GCP finding
`opm_cmd09` tripped the counter rule, and reading it closes the question the opposite way:
```c
if ( v2 > 0x3F ) return 259; // index bounded
if ( *(_DWORD *)off_4017D8 == 0 ) return 265; // underflow guarded BEFORE the decrement
v5[18] = 0; *v7 = v8 - 1; // decrement only on the validated path
opm_lib_zero_fill_words(dst: v5, len: 0x58u); // the WHOLE slot is zeroed
```
That is precisely the three things `GCP FE0D` fails to do: it bounds the index, it guards
the underflow before decrementing, and it zero-fills the whole slot so no stale handle
survives. Same vendor, same firmware generation, same lifecycle — done correctly.
So GCP's behaviour is **not** a house style or a platform convention that we have
misread. It is a defect specific to that TA, and OPM is the counter-example that proves the
correct pattern was available.
## Known false-positive classes
* local arrays (`v6[0]`) satisfy the "indexed slot" test for persistent state;
* a legitimate decrement followed by an unrelated early return;
* library helpers whose loop counters happen to be pointer dereferences.
All four non-GCP hits fall into these. The detector is a candidate generator; every hit here
was read before being called anything.
================================================================================
# Shared runtime clusters: the "one bug hits all twelve" hypothesis is largely void
40 function bodies are byte-identical across three or more TAs. The attraction was that a
defect in one would be a defect in all twelve at once. Audited by prevalence and size:
| cluster | size | TAs | what it is |
|---|---|---|---|
| `a7ddd513` / `c7dfbb7d` | 4 / 2 B | 11 | `TA_OpenSession` / `TA_CloseSession` stubs — `return 0` |
| `a80dedba` | 78 B | 10 | `zero_fill_words` |
| `b1cf532a` | 148 B | 8 | the entry trampoline |
| `259290c6` | 68 B | 6 | `zero_fill_bytes` |
| `5487ced7`, `db876c77`, `b56825b4` | 696/580/392 B | 4 | **compiler runtime** — `b56825b4` is software division (`a1 -= v1 << 7; a1 -= v1 << 6;` in a shift-subtract loop); the other two decompile to four lines of intrinsics |
**None of the shared code parses attacker data.** The clusters are compiler helpers, memset
variants and entry glue — precisely the code a single toolchain emits into every image. The
parsing and session logic, which is where this round's defects live, is *not* shared: each
TA has its own. So the hypothesis is answered negatively, and cheaply.
## One observation worth keeping: the trampoline hangs on an unknown request type
```c
while ( 1 ) {
__asm { SVC 0xF0 } // wait for a request
v6 = *(_DWORD *)a1;
switch ( v6 ) {
case 1..5: v7 = <entry point>; break;
default: while ( 1 ) ; // <-- spins forever
}
v7(); __asm { SVC 0xF1 }
}
```
An unrecognised request type does not return an error — it **spins in an infinite loop**
inside the TA, in **eight of the twelve** TAs. Whether that is reachable depends on whether
the request word can hold a value outside 1..5 by the time the trampoline reads it; it is
written by the PSP kernel from the `GFX_CMD` path rather than copied straight from host
bytes, so this is recorded as an observation rather than a finding. If it *is* reachable it
is a permanent TA hang requiring a PSP reset, which matches the session-wall behaviour
already documented as a hazard.
|