-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ARMv8.1-M: Add task dedicated PAC key support #1195
ARMv8.1-M: Add task dedicated PAC key support #1195
Conversation
d7e9592
to
05a1578
Compare
Thank you for your contribution @AhmedIsmail02! I have reviewed the code and I have the following suggestions -
All of my suggestions are in the following patch - 0001-Code-review-suggestions.patch. Please take a look and let me know what you think. |
d690416
to
506969c
Compare
@aggarg Thank you for the valuable review. |
906aef5
to
5fc248c
Compare
Thanks you, @AhmedIsmail02! I have the following 2 suggestions:
Note that I have not tested the second patch yet. |
ARMv8-M TrustZone variant registers stacking procedure is modified to be consistent with the NTZ port variant where one `stmdb` instruction is used instead of using 'subs' instruction along with `stmia` instruction, also, this result in more efficient context switching handling (lower latency). Signed-off-by: Ahmed Ismail <[email protected]>
To harden the security, each task is assigned a dedicated PAC key, so that attackers needs to guess the all the tasks' PAC keys right to exploit the system using Return Oriented Programming. The kernel is now updated to support the following: * A PAC key set with a random number generated and is pushed onto the task's stack when a task is created. * As part of scheduling, the task's PAC key is stacked/unstacked to/from the task's stack when a task is unscheduled/scheduled from/to run. Signed-off-by: Ahmed Ismail <[email protected]>
5fc248c
to
5720e85
Compare
When MPU wrapper v2 is used, the task's context is stored in TCB and `pxTopOfStack`` member of TCB points to the context location in TCB. We, therefore, need to read PSP to find the task's current top of stack. Signed-off-by: Ahmed Ismail <[email protected]> Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Ahmed Ismail <[email protected]> Signed-off-by: Gaurav Aggarwal <[email protected]>
5720e85
to
326cbe1
Compare
|
Description
To harden the security, each task is assigned with a dedicated PAC key, so that attackers needs to get the all the PAC keys right to exploit the system using Return Oriented Programming. The kernel is updated to support the following:
This commit is an improvement for MR!1216 to support MPU port variants stack overflow check.
Test Steps
Checklist:
Related Issue
Blocks FreeRTOS/FreeRTOS-Partner-Supported-Demos#19
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.