Commit 97050a1
authored
Memory Protection Unit (MPU) Enhancements (#705)
Memory Protection Unit (MPU) Enhancements
This commit introduces a new MPU wrapper that places additional
restrictions on unprivileged tasks. The following is the list of changes
introduced with the new MPU wrapper:
1. Opaque and indirectly verifiable integers for kernel object handles:
All the kernel object handles (for example, queue handles) are now
opaque integers. Previously object handles were raw pointers.
2. Saving the task context in Task Control Block (TCB): When a task is
swapped out by the scheduler, the task's context is now saved in its
TCB. Previously the task's context was saved on its stack.
3. Execute system calls on a separate privileged only stack: FreeRTOS
system calls, which execute with elevated privilege, now use a
separate privileged only stack. Previously system calls used the
calling task's stack. The application writer can control the size of
the system call stack using new configSYSTEM_CALL_STACK_SIZE config
macro.
4. Memory bounds checks: FreeRTOS system calls which accept a pointer
and de-reference it, now verify that the calling task has required
permissions to access the memory location referenced by the pointer.
5. System call restrictions: The following system calls are no longer
available to unprivileged tasks:
- vQueueDelete
- xQueueCreateMutex
- xQueueCreateMutexStatic
- xQueueCreateCountingSemaphore
- xQueueCreateCountingSemaphoreStatic
- xQueueGenericCreate
- xQueueGenericCreateStatic
- xQueueCreateSet
- xQueueRemoveFromSet
- xQueueGenericReset
- xTaskCreate
- xTaskCreateStatic
- vTaskDelete
- vTaskPrioritySet
- vTaskSuspendAll
- xTaskResumeAll
- xTaskGetHandle
- xTaskCallApplicationTaskHook
- vTaskList
- vTaskGetRunTimeStats
- xTaskCatchUpTicks
- xEventGroupCreate
- xEventGroupCreateStatic
- vEventGroupDelete
- xStreamBufferGenericCreate
- xStreamBufferGenericCreateStatic
- vStreamBufferDelete
- xStreamBufferReset
Also, an unprivileged task can no longer use vTaskSuspend to suspend
any task other than itself.
We thank the following people for their inputs in these enhancements:
- David Reiss of Meta Platforms, Inc.
- Lan Luo, Xinhui Shao, Yumeng Wei, Zixia Liu, Huaiyu Yan and Zhen Ling
of School of Computer Science and Engineering, Southeast University,
China.
- Xinwen Fu of Department of Computer Science, University of
Massachusetts Lowell, USA.
- Yuequi Chen, Zicheng Wang, Minghao Lin of University of Colorado
Boulder, USA.1 parent 18e2937 commit 97050a1
File tree
123 files changed
+94813
-6526
lines changed- .github
- include
- portable
- ARMv8M
- non_secure
- portable
- GCC
- ARM_CM23_NTZ
- ARM_CM23
- ARM_CM33_NTZ
- ARM_CM33
- IAR
- ARM_CM23_NTZ
- ARM_CM23
- ARM_CM33_NTZ
- ARM_CM33
- Common
- GCC
- ARM_CM23_NTZ/non_secure
- ARM_CM23/non_secure
- ARM_CM33_NTZ/non_secure
- ARM_CM33/non_secure
- ARM_CM35P_NTZ/non_secure
- ARM_CM35P/non_secure
- ARM_CM3_MPU
- ARM_CM4_MPU
- ARM_CM55_NTZ/non_secure
- ARM_CM55/non_secure
- ARM_CM85_NTZ/non_secure
- ARM_CM85/non_secure
- IAR
- ARM_CM23_NTZ/non_secure
- ARM_CM23/non_secure
- ARM_CM33_NTZ/non_secure
- ARM_CM33/non_secure
- ARM_CM35P_NTZ/non_secure
- ARM_CM35P/non_secure
- ARM_CM4F_MPU
- ARM_CM55_NTZ/non_secure
- ARM_CM55/non_secure
- ARM_CM85_NTZ/non_secure
- ARM_CM85/non_secure
- RVDS/ARM_CM4_MPU
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
123 files changed
+94813
-6526
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2468 | 2468 | | |
2469 | 2469 | | |
2470 | 2470 | | |
| 2471 | + | |
2471 | 2472 | | |
2472 | 2473 | | |
2473 | 2474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
232 | 250 | | |
233 | 251 | | |
234 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1752 | 1752 | | |
1753 | 1753 | | |
1754 | 1754 | | |
1755 | | - | |
| 1755 | + | |
1756 | 1756 | | |
1757 | 1757 | | |
1758 | 1758 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
3192 | 3197 | | |
3193 | 3198 | | |
3194 | 3199 | | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
3195 | 3208 | | |
3196 | 3209 | | |
3197 | 3210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| 100 | + | |
94 | 101 | | |
95 | 102 | | |
| 103 | + | |
96 | 104 | | |
97 | 105 | | |
| 106 | + | |
98 | 107 | | |
99 | 108 | | |
| 109 | + | |
100 | 110 | | |
101 | 111 | | |
| 112 | + | |
102 | 113 | | |
103 | 114 | | |
| 115 | + | |
104 | 116 | | |
105 | 117 | | |
106 | 118 | | |
| |||
0 commit comments