Re: [PATCH 2/2] ext4: Fix zalloc()

2024-07-12 Thread Richard Weinberger
Am Freitag, 12. Juli 2024, 13:15:56 CEST schrieb 'Heinrich Schuchardt' via upstream: > Memalign() is called in many code locations. > > If memalign() has a bug, it needs to be fixed in memalign. We should not > try to work around it in all callers. Agreed, I did already: See https://lists.denx.d

Re: [PATCH 2/2] ext4: Fix zalloc()

2024-07-12 Thread Heinrich Schuchardt
On 02.07.24 21:42, Richard Weinberger wrote: The zalloc() function suffers from two problems. 1. If memalign() fails it will return NULL and memset() will use a NULL pointer. 2. memalign() itself seems to crash when more than 2^32 bytes are requested. So, check the return value of memalign() and

Re: [PATCH 2/2] ext4: Fix zalloc()

2024-07-12 Thread Richard Weinberger
Tom, Am Donnerstag, 11. Juli 2024, 17:45:17 CEST schrieb Tom Rini: > The problem here is that "zalloc" is inline and so this change causes > about 1KiB of growth on platforms which enable ext4 and so at least > mx6sabresd now overflows it's maximum size. Looking harder, I think the > best solution

Re: [PATCH 2/2] ext4: Fix zalloc()

2024-07-11 Thread Tom Rini
On Tue, Jul 02, 2024 at 09:42:23PM +0200, Richard Weinberger wrote: > The zalloc() function suffers from two problems. > 1. If memalign() fails it will return NULL and memset() will use a NULL > pointer. > 2. memalign() itself seems to crash when more than 2^32 bytes are requested. > > So, check

[PATCH 2/2] ext4: Fix zalloc()

2024-07-02 Thread Richard Weinberger
The zalloc() function suffers from two problems. 1. If memalign() fails it will return NULL and memset() will use a NULL pointer. 2. memalign() itself seems to crash when more than 2^32 bytes are requested. So, check the return value of memalign() and allocate only of size is less than CONFIG_SYS_