FreeRTOS-Kernel/include
kar-rahul-aws 97050a17aa
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.
2023-07-13 16:51:04 +05:30
..
atomic.h Normalize line endings and whitespace in source files 2022-11-29 15:38:47 -08:00
CMakeLists.txt Fix circular dependency in CMake project (#700) 2023-07-10 15:08:59 -07:00
croutine.h Remove empty expression statement compiler warning (#692) 2023-07-06 10:44:24 +08:00
deprecated_definitions.h Normalize line endings and whitespace in source files 2022-11-29 15:38:47 -08:00
event_groups.h Add functions to get the buffers of statically created objects (#641) 2023-03-22 15:27:57 -07:00
FreeRTOS.h Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
list.h Feature/fixing clang gnu compiler warnings (#620) 2023-02-23 23:35:04 +05:30
message_buffer.h Add functions to get the buffers of statically created objects (#641) 2023-03-22 15:27:57 -07:00
mpu_prototypes.h Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
mpu_wrappers.h Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
newlib-freertos.h Paranthesize expression-like macro (#668) 2023-04-28 14:05:56 -07:00
picolibc-freertos.h Fix TLS and stack alignment when using picolibc (#637) 2023-03-06 11:59:39 +05:30
portable.h Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
projdefs.h Add missing FreeRTOS+ defines 2023-03-14 09:23:57 -07:00
queue.h Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
semphr.h Remove empty expression statement compiler warning (#692) 2023-07-06 10:44:24 +08:00
stack_macros.h Remove empty expression statement compiler warning (#692) 2023-07-06 10:44:24 +08:00
StackMacros.h Normalize line endings and whitespace in source files 2022-11-29 15:38:47 -08:00
stdint.readme Normalize line endings and whitespace in source files 2022-11-29 15:38:47 -08:00
stream_buffer.h Add functions to get the buffers of statically created objects (#641) 2023-03-22 15:27:57 -07:00
task.h Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
timers.h Add functions to get the buffers of statically created objects (#641) 2023-03-22 15:27:57 -07:00