Skip to content

Commit f8a8c97

Browse files
authored
Merge branch 'main' into fix/doxygen-defgroup-duplicates
2 parents b318686 + 49cec3e commit f8a8c97

7 files changed

Lines changed: 61 additions & 11 deletions

File tree

.github/SECURITY.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## Threat model
2+
3+
Before reporting an issue, please review the FreeRTOS kernel threat model. It
4+
describes the security assumptions the kernel makes, which threats are in scope,
5+
and the protections the kernel does and does not provide. Understanding these
6+
boundaries helps determine whether an observed behavior is a security
7+
vulnerability or expected, documented behavior.
8+
9+
- [FreeRTOS Kernel Threat Model](https://www.freertos.org/Security/02-Kernel-threat-model)
10+
111
## Reporting a Vulnerability
212

313
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security

include/task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNC
10501050
*
10511051
* @return The base priority of xTask.
10521052
*
1053-
* \defgroup uxTaskPriorityGet uxTaskBasePriorityGet
1053+
* \defgroup uxTaskBasePriorityGet uxTaskBasePriorityGet
10541054
* \ingroup TaskCtrl
10551055
*/
10561056
UBaseType_t uxTaskBasePriorityGet( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;

portable/GCC/ARM_CM3_MPU/port.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,19 @@
5555
#define portNVIC_SYSTICK_CLK ( 0 )
5656
#endif
5757

58+
/* Unprivileged critical sections are not supported when using MPU wrappers
59+
* version 2. Default the option to 0 and reject an explicit value of 1. */
5860
#ifndef configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS
59-
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
60-
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
61+
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
62+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0
63+
#else
64+
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
65+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
66+
#endif
67+
#else
68+
#if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) )
69+
#error configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not supported with MPU wrappers version 2 ( configUSE_MPU_WRAPPERS_V1 == 0 ).
70+
#endif
6171
#endif
6272

6373
/* Prototype of all Interrupt Service Routines (ISRs). */

portable/GCC/ARM_CM4_MPU/port.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,19 @@
5959
#define portNVIC_SYSTICK_CLK ( 0 )
6060
#endif
6161

62+
/* Unprivileged critical sections are not supported when using MPU wrappers
63+
* version 2. Default the option to 0 and reject an explicit value of 1. */
6264
#ifndef configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS
63-
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
64-
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
65+
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
66+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0
67+
#else
68+
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
69+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
70+
#endif
71+
#else
72+
#if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) )
73+
#error configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not supported with MPU wrappers version 2 ( configUSE_MPU_WRAPPERS_V1 == 0 ).
74+
#endif
6575
#endif
6676

6777
/* Prototype of all Interrupt Service Routines (ISRs). */

portable/IAR/ARM_CM4F_MPU/port.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,19 @@
6666
#define portNVIC_SYSTICK_CLK_BIT ( 0 )
6767
#endif
6868

69+
/* Unprivileged critical sections are not supported when using MPU wrappers
70+
* version 2. Default the option to 0 and reject an explicit value of 1. */
6971
#ifndef configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS
70-
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
71-
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
72+
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
73+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0
74+
#else
75+
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
76+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
77+
#endif
78+
#else
79+
#if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) )
80+
#error configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not supported with MPU wrappers version 2 ( configUSE_MPU_WRAPPERS_V1 == 0 ).
81+
#endif
7282
#endif
7383

7484
/* Prototype of all Interrupt Service Routines (ISRs). */

portable/RVDS/ARM_CM4_MPU/port.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,19 @@
4848

4949
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
5050

51+
/* Unprivileged critical sections are not supported when using MPU wrappers
52+
* version 2. Default the option to 0 and reject an explicit value of 1. */
5153
#ifndef configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS
52-
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
53-
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
54+
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
55+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0
56+
#else
57+
#warning "configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not defined. We recommend defining it to 0 in FreeRTOSConfig.h for better security."
58+
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 1
59+
#endif
60+
#else
61+
#if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) )
62+
#error configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS is not supported with MPU wrappers version 2 ( configUSE_MPU_WRAPPERS_V1 == 0 ).
63+
#endif
5464
#endif
5565

5666
/* Prototype of all Interrupt Service Routines (ISRs). */

tasks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7362,7 +7362,7 @@ STATIC void prvResetNextTaskUnblockTime( void )
73627362
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
73637363
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
73647364
/* coverity[misra_c_2012_rule_11_5_violation] */
7365-
pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );
7365+
pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );
73667366

73677367
if( pxTaskStatusArray != NULL )
73687368
{
@@ -7531,7 +7531,7 @@ STATIC void prvResetNextTaskUnblockTime( void )
75317531
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
75327532
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
75337533
/* coverity[misra_c_2012_rule_11_5_violation] */
7534-
pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );
7534+
pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );
75357535

75367536
if( pxTaskStatusArray != NULL )
75377537
{

0 commit comments

Comments
 (0)