aboutsummaryrefslogtreecommitdiffstats

FINDING: the PSP ring frame's fence_addr is not range-checked, unlike cmd_buf

Evidence class: [HW] — Navi 31 / RX 7900 XTX, live sOS/SYS_DRV 0.49.0.54. Status: missing validation CONFIRMED; memory corruption NOT demonstrated.

What was untested

Every other test in this audit varied command content. The ring frame itself (psp_gfx_rb_frame, 64 bytes) is equally host-controlled and carries:

field offset meaning
cmd_buf_addr_lo/hi 0 / 4 where the command lives
fence_addr_lo/hi 12 / 16 an address the PSP writes to
fence_value 20 the value the PSP writes there

cmd_buf was range-checked against the TMR in pass 87. fence_addr had never been tested, even though it is a destination the PSP writes and the host chooses.

Confirmed on hardware

  1. The PSP writes a host-chosen value to a host-chosen address. hw/fence_write.py: fence_value = 0xDEADBEEF, fence_addr = a scratch page ⇒ 0xDEADBEEF appears there.
  2. fence_addr inside the TMR is accepted. hw/fence_tmr2.py tmr: the command completes (response field poisoned beforehand and then written 0x0 by the PSP), the sOS stays alive and the heartbeat advances. Compare cmd_buf inside the TMR, which is rejected. The check applied to one destination is missing on the other.
  3. fence_addr = 0 wedges the PSP — see below.

What is NOT demonstrated: corruption

The write does not appear to land in the trusted region.

  • Read-back is impossible: host reads of the TMR return 0xffffffff (hw/fence_land.py), so the direct question cannot be answered that way.
  • Functional test, dense: hw/fence_spray.py 16384 0x40 — 16,384 host-chosen dwords at 64-byte granularity across the entire first megabyte of the TMR, which is where a loaded TA image lives; all commands completed; the TA's responses to commands 0-5 are identical before and after.

The most likely explanation is that the fence write is issued through a path subject to the same hardware protection that makes host reads return 0xffffffff, so the missing software check is covered by hardware. A sparse first attempt (300 dwords over 19 MB) was discarded as too thin to support any conclusion.

So this is a defence-in-depth gap, not an exercisable primitive: on a part or configuration where that hardware protection is absent or differently scoped, an unchecked fence_addr is a host-chosen dword written to a host-chosen address by trusted firmware.

Sixth DoS trigger: fence_addr = 0

hw/fence_tmr2.py zero: the command completes (resp = 0x0) but the sOS heartbeat regMP0_SMN_C2PMSG_81 is identical before and after (0xf72de67), and the card is unusable afterwards (SMU msg 0x2 timeout). Recovery needs work/atx_power.py cycle 25.

Same class as the five in REPORT-PSP-DOS-TRIGGERS.md: the PSP dies after completing the command, while writing the fence to an unmapped address.

Suggested fixes

  1. Range-check fence_addr exactly as cmd_buf is checked — reject destinations inside the trusted region.
  2. Reject an unmapped or null fence_addr with a status instead of dying on the write.