SPM: Copy iovec parameters into SPE before validation in Library model

In Library model, the NS input/output buffer addresses are
validated inside NS memory before being copied into the Secure
Service. The addresses can be tampered before they are copied from
NS memory into Secure side.

This commit adds a Secure temporary buffer to copy the NS input
and output buffer addresses before them are validated. Then the
addresses are passed to the Secure Service after validation passes.

It can enhance the protection of iovecs against TOCTOU attack.

Change-Id: I2f925bfd90c989934c64b1ec739047cf70cc9218
Signed-off-by: David Hu <david.hu@arm.com>
2 files changed