-
Notifications
You must be signed in to change notification settings - Fork 129
cmse: enable SAU defines for non-secure state #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The SAU register defines and bitfields are still useful for applications that are not running in the secure state. e.g. An application triggers a SecureFault, during which the secure handler preserved the `SFSR` register value in `.noinit` memory. Once rebooted, the non-secure application queries the `SFSR` register and wishes to inspect the bits to determine more precisely the cause. Signed-off-by: Jordan Yates <[email protected]>
|
@JordanYates, sorry for the delay. We discussed this use cases and our security experts doesn't consider this approach desirable from security point of view. One should generally not expose raw information from secure state to non-secure state for processing. Instead, the required processing should be done in secure firmware. The secure firmware can expose required (and considerably non-security related) information to the non-secure side explicitly by using a distinct interface. |
The non-secure state is the state that has communications capabilities (IP, Bluetooth, etc) to send fault reasons to developers so that they can be fixed. Knowing that a secure fault occurred has very little value for debugging unless it is also associated with an address at which it occurred, and ideally what sort of secure fault it was. These two pieces of information are contained in the
What do you define as required processing?
I would consider the What form do you suggest processing the It would be useful to have an idea of what your security experts would consider a good interface for communicating secure fault causes back to the non-secure domain. To be explicit, Trusted-Firmware-M has functionality for retrieving exception information inside the secure fault handler, added explicitly for the purpose of saving that information for later analysis. This contains the SFAR and SFSR registers. This certainly implies that the information ( |
|
Hi @JordanYates , maybe you can take a look at CMSIS-View pack that offers There is also an example for Trust-Zone device (STMicroelectronics B-U585I-IOT02A board) with documentation. That example shows fault analysis also of secure-state faults. |
Thank you for this example, it exactly proves my point why this PR is needed. The non-secure code in the example is copy-pasting the definitions, as they are not available from the common header. |
|
@JonatanAntoni @MiloradCvjetkovic any updates? |
|
@JordanYates, I am still not convinced that exposing all SAU defines regardless of target security state is the correct and clean approach. I am not a security expert and can't judge what sensitive information could get exposed inadvertently by passing raw content of security state registers to non-secure state. |
This PR changes nothing with regards to passing raw content to the non-secure state. It is possible now, it would be possible after, it will always be possible. It is simply whether the definitions are available to the non-secure code. Once the register contents hit the non-secure side, hiding the definition provides nothing with respect to security, since the non-secure side can either:
Then please suggest the subset that would be acceptable. If it is not acceptable to expose any of these defines for some reason, I would love to see the sample code updated to remove the copy paste (since it is apparently a security risk and not acceptable) without losing the functionality. |
The SAU register defines and bitfields are still useful for applications that are not running in the secure state.
e.g. An application triggers a SecureFault, during which the secure handler preserved the
SFSRregister value in.noinitmemory. Once rebooted, the non-secure application queries theSFSRregister and wishes to inspect the bits to determine more precisely the cause.