-
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
Add Access Control List to MPU ports #765
Add Access Control List to MPU ports #765
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #765 +/- ##
=======================================
Coverage 94.35% 94.35%
=======================================
Files 6 6
Lines 2443 2443
Branches 598 598
=======================================
Hits 2305 2305
Misses 85 85
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…l-aws/FreeRTOS-Kernel into mpu_wrapper_access_control_list
Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
Signed-off-by: Gaurav Aggarwal <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In mpu_wrappers_v2.c xPortIsAuthorizedToAccessKernelObject
is called even when configENABLE_ACCESS_CONTROL_LIST
is set to 0. The function call and the if statement can't be optimized by compiler when configENABLE_ACCESS_CONTROL_LIST is set to 0.
xCallingTaskIsAuthorizedToAccessTask = xPortIsAuthorizedToAccessKernelObject( CONVERT_TO_INTERNAL_INDEX( lIndex ) );
if( xCallingTaskIsAuthorizedToAccessTask == pdTRUE )
{
xInternalTaskHandle = MPU_GetTaskHandleAtIndex( CONVERT_TO_INTERNAL_INDEX( lIndex ) );
if( xInternalTaskHandle != NULL )
{
xReturn = xTaskAbortDelay( xInternalTaskHandle );
}
}
Suggest we consider to optimize it in future PR or make access control list required in mpu wrapper V2.
The reason we did not do that is to avoid making the code complex to read. |
* Add register test tasks to the CORTEX_MPS2_QEMU_IAR GCC and IAR builds. * Update header comment in the two added files. * Fix header checks * Fix build issue * update IAR version --------- Co-authored-by: none <> Co-authored-by: Rahul Kar <[email protected]> Co-authored-by: Rahul Kar <[email protected]>
Description
This PR adds Access Control to kernel objects on a per task basis to MPU ports. The following needs to be defined in the
FreeRTOSConfig.h
to enable this feature:This PR adds the following new APIs:
An unprivileged task by default has access to itself only and no other kernel object. The application writer needs to explicitly grant an unprivileged task access to all the kernel objects it needs. The best place to do that is before starting the scheduler when all the kernel objects are created.
For example, let's say an unprivileged tasks needs access to a queue and an event group, the application writer needs to do the following:
The application writer MUST revoke all the accesses before deleting a task. Failing to do so will result in undefined behavior. In the above example, the application writer needs to make the following 2 calls before deleting the task:
Test Steps
Tested on the following platforms -
Checklist:
Related Issue
This PR addresses the threat “Unprivileged task accessing valid kernel objects using legitimate system calls” in the FreeRTOS Kernel Threat Model -https://www.freertos.org/security/kernel-threat-model.html.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.