-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hi
We found an integer overflow vulnerability in the memory allocation function of your company's Processor SDK.
In the source code of the pvHeapMalloc function, when wantedSize is incremented, the integer overflow problem is not considered. When wantedSize passes a very large value, such as 0xFFFFFFFF, the actual size obtained is the value of xHeapStrucSize-1.
When a user requests an unreasonably large amount of memory space, a pointer to a very small amount of memory space will eventually be returned to the user.
Suggested Fix
You can refer to the fix for integer overflow in pvPortMalloc in FreeRtos before. (CVE-2021-31571, CVE-2021-31572)
Before it does the self-increment, it checks whether it will overflow after adding ( portBYTE_ALIGNMENT – ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ).