ta: qcom_pas: verify firmware image before bringing up the peripheral#16
Open
zelvam95 wants to merge 1 commit into
Open
ta: qcom_pas: verify firmware image before bringing up the peripheral#16zelvam95 wants to merge 1 commit into
zelvam95 wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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