An automatic tool to identify all trampoline functions in FreeRTOS that can cause arbitrary read/write and DoS because of lacking checks.
- install and configure CodeQL in local and also VS Code environment
- import
rtosdatabase
directory to VS Code. rtosdatabse3 is source code data generated by CodeQL for FreeRTOS - In VS Code, run the script
vscode-codeql-starter/codeql-custom-queries-cpp/example.ql
- In
rtosdatabase
directory, we enable all macroes to include all functions withMPU_
prefix. In this way, all potentally vulnerable functions can be analyzed. - We support three analysis targets, including aribitrary write, arbitrary read, and other issues.
- Our static analysis contains false positives (i.e., identified function is free from the reported issue) but no false negative (i.e., not missing any vulnerable function)
- MPU_xStreamBufferSetTriggerLevel
- MPU_xStreamBufferReset
- MPU_vStreamBufferDelete
- MPU_xStreamBufferReceive
- MPU_xStreamBufferSend
- MPU_vEventGroupDelete
- MPU_xEventGroupSync
- MPU_xEventGroupSetBits
- MPU_xEventGroupClearBits
- MPU_xEventGroupWaitBits
- MPU_xEventGroupCreateStatic
- MPU_vTimerSetReloadMode
- MPU_vTimerSetTimerID
- MPU_xQueueGenericReset
- MPU_xQueueSelectFromSet
- MPU_xQueueRemoveFromSet
- MPU_xQueueAddToSet
- MPU_xQueueGenericCreateStatic
- MPU_xQueueGiveMutexRecursive
- MPU_xQueueTakeMutexRecursive
- MPU_xQueueCreateCountingSemaphoreStatic
- MPU_vQueueDelete
- MPU_xQueueSemaphoreTake
- MPU_xQueuePeek
- MPU_xQueueReceive
- MPU_xQueueGenericSend
- MPU_ulTaskGenericNotifyValueClear
- MPU_xTaskGenericNotifyStateClear
- MPU_xTaskGenericNotifyWait
- MPU_xTaskGenericNotify
- MPU_vTaskGetRunTimeStats
- MPU_vTaskList
- MPU_vTaskSetThreadLocalStoragePointer
- MPU_vTaskSetApplicationTaskTag
- MPU_uxTaskGetStackHighWaterMark2
- MPU_uxTaskGetStackHighWaterMark
- MPU_vTaskResume
- MPU_vTaskSuspend
- MPU_vTaskPrioritySet
- MPU_vTaskGetInfo
- MPU_xTaskAbortDelay
- MPU_vTaskDelete
- MPU_xStreamBufferGenericCreateStatic
- MPU_xStreamBufferBytesAvailable
- MPU_xStreamBufferSpacesAvailable
- MPU_xStreamBufferNextMessageLengthBytes
- MPU_xStreamBufferReceive
- MPU_xStreamBufferSend
- MPU_xEventGroupSync
- MPU_xEventGroupSetBits
- MPU_xEventGroupClearBits
- MPU_xEventGroupWaitBits
- MPU_xEventGroupCreateStatic
- MPU_xTimerGetExpiryTime
- MPU_xTimerGetPeriod
- MPU_pcTimerGetName
- MPU_pvTimerGetTimerID
- MPU_xQueueSelectFromSet
- MPU_xQueueGenericCreateStatic
- MPU_xQueueGetMutexHolder
- MPU_xQueueCreateCountingSemaphoreStatic
- MPU_xQueueCreateMutexStatic
- MPU_uxQueueSpacesAvailable
- MPU_uxQueueMessagesWaiting
- MPU_ulTaskGenericNotifyValueClear
- MPU_ulTaskGenericNotifyTake
- MPU_pvTaskGetThreadLocalStoragePointer
- MPU_xTaskGetApplicationTaskTag
- MPU_pcTaskGetName
- MPU_uxTaskPriorityGet
- MPU_xTaskCreateStatic
- MPU_xTaskCreate
- MPU_xQueueGenericCreate
- MPU_xStreamBufferGenericCreate
- MPU_xQueueCreateCountingSemaphore
- MPU_xQueueCreateMutex
- MPU_xQueueCreateSet
- MPU_vQueueAddToRegistry
- MPU_eTaskGetState
- MPU_xStreamBufferIsEmpty
- MPU_xTaskCheckForTimeOut
- MPU_xTaskDelayUntil
- MPU_xStreamBufferIsFull
- MPU_xTimerGenericCommand
- MPU_xTaskCatchUpTicks
- MPU_vQueueUnregisterQueue
- MPU_vTaskDelay
- MPU_uxTaskGetSystemState
- MPU_xTaskCallApplicationTaskHook
- MPU_xTaskGetHandle
- MPU_vTaskSetTimeOutState
- MPU_uxTimerGetReloadMode
- MPU_pcQueueGetName
- MPU_xTimerIsTimerActive
Identifying Trampoline Functions in FreeRTOS that Lack Checks