|
|
outside it
New finding, and it corrects a claim in REPORT-PSP-DOS-TRIGGERS.md.
LOAD_TA enforces a floor on cmd_buf_len -- at least 0x1000, measured earlier -- and nothing else. It
never checks the declared length against the memory the host owns at that address, and the PSP then
reads and writes TA parameters anywhere inside [cmd_buf, cmd_buf + cmd_buf_len). The host therefore
chooses the size of the region the PSP will write into, independently of what it allocated.
Demonstrated with allocation A of one page declared as 0x8000, and allocation B a separate page
immediately after it, pre-filled and never given to the TA. Both the control and the aimed case return
success with no data abort and modify B. Reproduced identically after a power cycle.
The control separates two facts. With the displacement at zero, GCP's ordinary output write to
params+0x1950 already lands at B+0x950, because that offset is past the end of A -- so over-declaration
alone is sufficient and no TA defect is needed. Adding GCP's unbounded displacement from
FINDING-GCP-FE09-CONFIGINIT-HOST-OFFSET-WRITE.md puts four bytes at B+0x40, exactly where aimed. The
two defects compose: the missing length validation gives the reach, the missing offset bound gives the
aim.
Earlier work reached the opposite conclusion and the reason is now clear. hw/aperture2.py ran the same
two-allocation shape but with A = 0x8000 and cmd_buf_len = 0x4000, so the declared window ended well
inside A and nothing could reach B. That test was correct for its configuration; the variable that
matters is cmd_buf_len relative to the allocation, and it was only ever varied downward. The claim in
REPORT-PSP-DOS-TRIGGERS.md is annotated in place rather than rewritten.
Impact stated without overreach: the PSP writes outside the object the host granted it, at a host-chosen
offset, with success status. Not demonstrated is a write into another security principal's memory --
this is a single-tenant part and both allocations are ours, which is the limitation that report already
noted. The architectural consequence is that any privilege-separated caller, a guest VM with a VRAM
grant or a restricted process, gets a directed write outside its own allocation, because the PSP takes
the caller's word for how large its buffer is.
|