Add removed unprivileged access check to ARM_CRx_MPU xPortIsAuthorizedToAccessBuffer() (#1016)

* Add in a removed check for if a task is attempting to read a variable from a location it has write access to in xPortIsAuthorizedToAccessBuffer.

* Add in a portDONT_DISCARD symbol as well.
pull/992/head^2
Soren Ptak 10 months ago committed by GitHub
parent 345a86d49b
commit a455b86bd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -598,7 +598,9 @@ static BaseType_t prvMPURegionAuthorizesBuffer( const xMPU_REGION_REGISTERS * xT
if( ulAccessRequested == tskMPU_READ_PERMISSION ) /* RO. */ if( ulAccessRequested == tskMPU_READ_PERMISSION ) /* RO. */
{ {
if( ( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RW_USER_RO ) || if( ( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RW_USER_RO ) ||
( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RO_USER_RO ) ) ( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RO_USER_RO ) ||
( ulMPURegionAccessPermissions == portMPU_REGION_PRIV_RW_USER_RW ) )
{ {
xAccessGranted = pdTRUE; xAccessGranted = pdTRUE;
} }

@ -221,6 +221,13 @@ typedef uint32_t TickType_t;
*/ */
#define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" ) #define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )
/**
* @brief Ensure a symbol isn't removed from the compilation unit.
*
* @ingroup Port Interface Specifications
*/
#define portDONT_DISCARD __attribute__( ( used ) )
/** /**
* @brief Defines if the tick count can be accessed atomically. * @brief Defines if the tick count can be accessed atomically.
* *

Loading…
Cancel
Save