Skip to content

ta: qcom_pas: verify firmware image before bringing up the peripheral#16

Open
zelvam95 wants to merge 1 commit into
qualcomm-linux:qcom-nextfrom
zelvam95:feature/plat-qcom-pas-auth
Open

ta: qcom_pas: verify firmware image before bringing up the peripheral#16
zelvam95 wants to merge 1 commit into
qualcomm-linux:qcom-nextfrom
zelvam95:feature/plat-qcom-pas-auth

Conversation

@zelvam95

Copy link
Copy Markdown
Contributor

The PAS Trusted Application brings a peripheral out of reset to run a firmware image loaded into memory by the normal world. The normal world passes the firmware metadata with the init-image command and the image address and size with the authenticate-and-reset command. The latter was forwarded to the platform layer without checking the image.

Verify the image in the TA before forwarding authenticate-and-reset. The image is an ELF file (ELFCLASS32 or ELFCLASS64) accompanied by a hash table holding one digest per loadable segment; each PT_LOAD segment is hashed with the TEE Internal Core digest API and compared, in constant time, against its hash-table entry. The metadata is copied into TA-private memory at init-image so the hash table cannot be modified by the normal world before use. On any mismatch the peripheral is not started.

Gated by CFG_QCOM_PAS_AUTH_LOCAL; when disabled the TA behaves as before.

Signed-off-by: Selvam Sathappan Periakaruppan speriaka@qti.qualcomm.com

The PAS Trusted Application brings a peripheral out of reset to run a
firmware image loaded into memory by the normal world. The normal world
passes the firmware metadata with the init-image command and the image
address and size with the authenticate-and-reset command. The latter was
forwarded to the platform layer without checking the image.

Verify the image in the TA before forwarding authenticate-and-reset. The
image is an ELF file (ELFCLASS32 or ELFCLASS64) accompanied by a hash
table holding one digest per loadable segment; each PT_LOAD segment is
hashed with the TEE Internal Core digest API and compared, in constant
time, against its hash-table entry. The metadata is copied into TA-private
memory at init-image so the hash table cannot be modified by the normal
world before use. On any mismatch the peripheral is not started.

Gated by CFG_QCOM_PAS_AUTH_LOCAL; when disabled the TA behaves as before.

Signed-off-by: Selvam Sathappan Periakaruppan <speriaka@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant