Re: [PATCH 2/4] dlmalloc: Fix integer overflow in request2size()

2024-08-06 Thread Simon Glass
On Fri, 2 Aug 2024 at 04:08, Richard Weinberger wrote: > > req is of type size_t, casting it to long opens the door > for an integer overflow. > Values between LONG_MAX - (SIZE_SZ + MALLOC_ALIGN_MASK) - 1 and LONG_MAX > cause and overflow such that request2size() returns MINSIZE. > > Fix by removi

[PATCH 2/4] dlmalloc: Fix integer overflow in request2size()

2024-08-02 Thread Richard Weinberger
req is of type size_t, casting it to long opens the door for an integer overflow. Values between LONG_MAX - (SIZE_SZ + MALLOC_ALIGN_MASK) - 1 and LONG_MAX cause and overflow such that request2size() returns MINSIZE. Fix by removing the cast. The origin of the cast is unclear, it's in u-boot and pp