mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-07-10 13:29:45 -04:00
Defect: vPortGenerateSimulatedInterruptFromWindowsThread() in the MSVC-MingW simulator port performs a shift by a caller-supplied interrupt number without range checking it, giving undefined behavior for out-of-range values. Root cause: the function pends an interrupt via ( 1UL << ulInterruptNumber ) into ulPendingInterrupts, but does not verify ulInterruptNumber is within the width of that variable. A value greater than or equal to portMAX_INTERRUPTS makes the shift undefined. The task-context sibling vPortGenerateSimulatedInterrupt() already performs this bounds check. Fix: gate the operation on ( ulInterruptNumber < portMAX_INTERRUPTS ) in addition to the existing xPortRunning check, mirroring the task-context sibling so both entry points are consistent. A host regression test kept outside this repository demonstrates the fault before the change and its absence afterwards (red then green). |
||
|---|---|---|
| .. | ||
| ARMClang | ||
| ARMv8M | ||
| BCC/16BitDOS | ||
| CCRH/F1Kx | ||
| CCS | ||
| CodeWarrior | ||
| Common | ||
| GCC | ||
| IAR | ||
| Keil | ||
| MemMang | ||
| MikroC/ARM_CM4F | ||
| MPLAB | ||
| MSVC-MingW | ||
| oWatcom/16BitDOS | ||
| Paradigm/Tern_EE | ||
| Renesas | ||
| Rowley | ||
| RVDS | ||
| SDCC/Cygnal | ||
| Softune | ||
| Tasking/ARM_CM4F | ||
| template | ||
| ThirdParty | ||
| WizC/PIC18 | ||
| CMakeLists.txt | ||
| readme.txt | ||
Each real time kernel port consists of three files that contain the core kernel components and are common to every port, and one or more files that are specific to a particular microcontroller and/or compiler. + The FreeRTOS/Source/Portable/MemMang directory contains the five sample memory allocators as described on the https://www.FreeRTOS.org WEB site. + The other directories each contain files specific to a particular microcontroller or compiler, where the directory name denotes the compiler specific files the directory contains. For example, if you are interested in the [compiler] port for the [architecture] microcontroller, then the port specific files are contained in FreeRTOS/Source/Portable/[compiler]/[architecture] directory. If this is the only port you are interested in then all the other directories can be ignored.