aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-23 16:40:29 +0200
committeruser <user@clank>2026-09-23 16:40:29 +0200
commitda9e44456ebbcdf5d05e871317bd1db66d8a2afa (patch)
treeee74280d8f73c16a2cc9717b2e3fd2a3db5dcaab
parentMine the NV22 map and symbol tables: fuse-write and debug-unlock surface found (diff)
downloadamd-psp-re-da9e44456ebbcdf5d05e871317bd1db66d8a2afa.tar.gz
amd-psp-re-da9e44456ebbcdf5d05e871317bd1db66d8a2afa.tar.xz
amd-psp-re-da9e44456ebbcdf5d05e871317bd1db66d8a2afa.zip
Angle: make the PSP the writer -- host-chosen cmd_buf as a confused deputy
Every host-facing parser here is audited and clean, so the remaining asymmetry is not a parser: it is who chooses the addresses the PSP writes to. This builds on an observation already in ATTACK-SURFACE.md, filed under "Incidental (bounded, not security-relevant)": cmd_buf_phy_addr_hi +1 was accepted, i.e. the cmd_buf high dword is not validated the way the app address is. Also attacker-owned memory. The dismissal assumes the address lands in VRAM, where "attacker-owned" is true and the primitive is worthless. But cmd_buf is an MC address, and MC space is not just VRAM -- it also covers the TMR, doorbell/MMIO apertures, and peer devices. The TA response is written INTO cmd_buf, so an unvalidated high dword means the host picks an address that the PSP then writes to, with PSP privilege. Why that is not already ruled out: the project's three relevant dead ends -- TMR is hardware-fenced from the host, no host aperture onto PSP memory, no host-reachable corruptible parser -- are all statements about THE HOST as the actor. None constrains what happens when the PSP performs the access. The TMR fence exists because the PSP is supposed to be the only writer, so a PSP write to a host-chosen TMR address is what the fence permits, not what it blocks. TMR base on this card is known: 0x1300000. Testable now and not before: load_ta.py, built this session, gives direct control of cmd_buf_phy_addr_lo/hi, app_phy_addr_lo/hi and cmd_buf_len on real silicon. Prior TA work used the driver's own buffers and never chose these. The parameter the tree observed as unvalidated has never been pointed anywhere interesting. Test plan is staged read-only first, with RAS cmd 1's known response (ras_status 0, resp_id 0x8000xxxx from HW-RAS-ON-CARD.md) as the signature to look for, then a boundary search on the high dword, and only then a TMR target. Stated as a hypothesis with a mechanism and a test plan, NOT a finding. Nothing has been driven at a non-VRAM address yet, and the most likely refutation is named: the PSP may translate cmd_buf through a TA-private page table that cannot reach the TMR at all. Two angles rejected on the way, recorded so they are not re-tried: * Loader type confusion -- loading ASD ('DR' class) through LOAD_TA to get a host-invokable session. Already closed by FINDING-ASD-IS-DRIVER-CLASS-NOT-INVOKABLE.md: both commands route to tee_load_ta, the class is inside the signed payload, and 'DR'->'AT' fails signature verification. * TA rollback to widen the ASD surface. The unreachability of asd_hdcp2_op_1AA (unbounded loop) and 0x301 (5120-byte write) rests on an emitter census taken on ONE build, while the host chooses which signed build to load -- which looked like a real scope gap. Tested across all ten signed HDCP builds plus DTM using the tree's own fixed emitter scanner: the emitted set is monotonically growing (union 49, newest emits all 49, nothing removed, only 0x208 added at 23.0.0.62), and neither 0x1AA nor 0x301 is emitted by any build. Rollback does not widen the surface. Net effect is to strengthen the existing argument: the census now rests on 10 versions rather than 1. Scanner validated -- the documented 0x1a7/0x18c/0x161 markers appear in every build.
-rw-r--r--psp_out/ANGLE-PSP-AS-CONFUSED-DEPUTY-WRITER.md99
1 files changed, 99 insertions, 0 deletions
diff --git a/psp_out/ANGLE-PSP-AS-CONFUSED-DEPUTY-WRITER.md b/psp_out/ANGLE-PSP-AS-CONFUSED-DEPUTY-WRITER.md
new file mode 100644
index 0000000..0208524
--- /dev/null
+++ b/psp_out/ANGLE-PSP-AS-CONFUSED-DEPUTY-WRITER.md
@@ -0,0 +1,99 @@
+# Angle: the PSP as a confused-deputy writer, via host-chosen buffer addresses
+
+Every host-facing *parser* in this project has been audited and found clean. The
+remaining structural asymmetry is not a parser at all: it is **who chooses the
+addresses the PSP writes to**.
+
+## The observation this builds on (ours, under-read)
+
+`ATTACK-SURFACE.md`, in "Incidental (bounded, not security-relevant)
+observations":
+
+> `cmd_buf_phy_addr_hi` +1 was accepted, i.e. the cmd_buf high dword is not
+> validated the way the app address is. **Also attacker-owned memory.**
+
+The dismissal assumes the address lands in **VRAM**, where "attacker-owned" is
+true and the primitive is worthless. But `cmd_buf` is an **MC address**, and the
+MC address space is not just VRAM. It also covers the TMR, doorbell and MMIO
+apertures, and peer devices over PCIe.
+
+If the high dword is genuinely unvalidated, then the host picks an arbitrary MC
+address that **the PSP subsequently writes to** — because the TA response is
+written into `cmd_buf`. That is a confused deputy: the PSP writes, with PSP
+privilege, to a location the host chose.
+
+## Why this is different from everything already tried
+
+The project's own summary of the dead ends:
+
+* TMR is **hardware-fenced from the host** — host reads return 0xFF, host writes
+ are dropped. True, and that is what kills every direct approach.
+* No host aperture onto PSP memory exists (`FINDING-NO-PSP-MEMORY-APERTURE.md`).
+* No host-reachable-AND-corruptible parser primitive was found.
+
+All three are statements about **the host as the actor**. None of them constrain
+what happens when **the PSP** is the one performing the access. The TMR fence
+exists precisely because the PSP is *supposed* to be the only writer — so a PSP
+write to a host-chosen TMR address is not blocked by the fence, it is exactly
+what the fence permits.
+
+We know the TMR base on this card: `0x1300000` (recorded in
+`ATTACK-SURFACE.md`'s health checks, and one of the "small, unidentified"
+decoding bases in `FINDING-NO-PSP-MEMORY-APERTURE.md`).
+
+## Why it is testable now and was not before
+
+`psp_out/load_ta.py` (built this session) gives direct control of
+`cmd_buf_phy_addr_lo/hi`, `app_phy_addr_lo/hi` and `cmd_buf_len` on a real card.
+Previous TA work drove TAs through the driver's own buffers and never chose
+these addresses. The parameter that the tree observed as unvalidated has never
+been pointed anywhere interesting.
+
+## The experiment, in safety order
+
+1. **Read-only reconnaissance.** Point `cmd_buf` at successively unusual MC
+ addresses and invoke a TA command whose response is a known constant
+ (RAS cmd 1 returns `ras_status = 0` with a known `resp_id` — established in
+ `HW-RAS-ON-CARD.md`, which gives a *signature to look for*). Check whether
+ the write lands, by reading back where readable. Distinguishes "validated and
+ refused" from "accepted and written".
+2. **Boundary search.** Binary-search the accepted range of `cmd_buf_phy_addr_hi`
+ to find what, if anything, bounds it. A refusal boundary is itself the answer.
+3. **TMR target.** Only after 1-2 characterise the behaviour: does a `cmd_buf`
+ inside `0x1300000`'s TMR get written? If yes, that is an arbitrary write into
+ trusted memory, issued by the PSP, at a host-chosen offset.
+
+## What would make this fail, stated up front
+
+* the PSP may translate `cmd_buf` through a TA-private page table that simply
+ cannot reach the TMR;
+* the high dword may be "accepted" at the ring-validation layer and rejected
+ deeper, so +1 passing proves less than it appears;
+* MC addresses outside VRAM may fault harmlessly and wedge the PSP (recoverable
+ — every hardware experiment so far has been, via ATX cycle).
+
+The first of those is the most likely, and would close the angle cleanly.
+
+## Honest status
+
+This is a **hypothesis with a mechanism and a test plan**, not a finding.
+Nothing has been driven at a non-VRAM address yet. Its value is that it attacks
+the one asymmetry the audits do not cover — the audits all ask "can the host
+reach and corrupt X", and this asks "can the host make *the PSP* write to X".
+
+## Rejected on the way here (recorded so they are not re-tried)
+
+* **Loader type confusion** — load ASD (`'DR'` class) via `LOAD_TA` to get a
+ host-invokable session. Closed: `FINDING-ASD-IS-DRIVER-CLASS-NOT-INVOKABLE.md`
+ shows both load commands route to `tee_load_ta`, the class lives inside the
+ signed payload, and flipping `'DR'`->`'AT'` fails signature verification.
+* **TA rollback to widen the ASD opcode surface** — the unreachability of
+ `asd_hdcp2_op_1AA` (unbounded loop) and `0x301` (5120-byte write) rests on an
+ emitter census taken on **one** build, while the host chooses which signed
+ build to load. Tested across all ten signed HDCP builds we hold plus DTM: the
+ emitted set is **monotonically growing** — union 49 opcodes, newest emits all
+ 49, nothing ever removed, only `0x208` added at `23.0.0.62`. Neither `0x1AA`
+ nor `0x301` is emitted by any build. Rollback does not widen the surface, and
+ the census argument is now backed by 10 versions instead of 1. (Scanner
+ validated: the documented markers `0x1a7`/`0x18c`/`0x161` appear in every
+ build.)