Re: [PATCH v2 0/2] of: fdt: fix memory leak and oob writes in fdt_ensure_space

2024-02-01 Thread Sascha Hauer
On Thu, 01 Feb 2024 12:28:48 +0100, Stefan Kerkmann wrote: > I have encountered the oob write while attempting to modify a large FIT > image with of_property. While hunting for the root cause I noticed that > there is a potential memory leak in fdt_ensure_space as well. Both is > fixed in this

Re: [PATCH] mtd: spi-nor: fix format specifier in debug message

2024-02-01 Thread Sascha Hauer
On Thu, 01 Feb 2024 00:03:47 +0100, Ahmad Fatoum wrote: > The type size_t is to be printed with the %zu modifier as it's not > necessarily typedef'ed as unsigned long, even if for barebox purposes, > the sizeof(size_t) is always equal to sizeof(ulong). > > Building the dw-ospi-nor driver for

Re: [PATCH master 0/4] ARM: socfpga: add HANDOFF_FPGA2SDR handling

2024-02-01 Thread Sascha Hauer
On Wed, 31 Jan 2024 23:59:34 +0100, Ahmad Fatoum wrote: > The Quartus headers for Cyclone V can contain a reset mask for the > fpga2sdram bridge, which was so far ignored. This series remedies that. > > Ahmad Fatoum (4): > ARM: socfpga: complete definitions of handoff registers > ARM:

[PATCH] fixup! bootm: add support to boot ZSTD compressed images

2024-02-01 Thread Marco Felsch
--- lib/decompress_unzstd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/decompress_unzstd.c b/lib/decompress_unzstd.c index 42166c21e255..ba8013da7af9 100644 --- a/lib/decompress_unzstd.c +++ b/lib/decompress_unzstd.c @@ -138,11 +138,11 @@ static int INIT

Re: Possible regression 2023.12 -> 2024.01

2024-02-01 Thread Ahmad Fatoum
Hello Alexander, On 31.01.24 12:03, Alexander Shiyan wrote: > ERROR: mmc1: Cannot read MBR/partition table: I/O error > mmc1: registered mmc1 I observe no such issues with v2024.01.0 on the NXP i.MX8MN EVK, which has both SD-Card and eMMC (I booted from SD-Card). Given that you have a known

[PATCH v2 2/2] of: fdt: fix oob writes with large fdt properties

2024-02-01 Thread Stefan Kerkmann
OOB writes can be triggered when fdt->dt_size * 2 is still smaller than the property for which memory should be allocated. This can happen under rare circumstances when editing a fdt with the of_property command and a property is larger than 128k in size. This happend when editing a FIT image

[PATCH v2 0/2] of: fdt: fix memory leak and oob writes in fdt_ensure_space

2024-02-01 Thread Stefan Kerkmann
I have encountered the oob write while attempting to modify a large FIT image with of_property. While hunting for the root cause I noticed that there is a potential memory leak in fdt_ensure_space as well. Both is fixed in this series. Signed-off-by: Stefan Kerkmann --- Changes in v2: - Review

[PATCH v2 1/2] of: fdt: fix memory leak in fdt_ensure_space

2024-02-01 Thread Stefan Kerkmann
If the reallocation failed the old memory remains allocated and is never freed, this is fixed by freeing the old memory on error. Signed-off-by: Stefan Kerkmann Reviewed-by: Ahmad Fatoum --- drivers/of/fdt.c | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-)

Re: [PATCH 2/2] of: fdt: fix oob writes with large ftd properties

2024-02-01 Thread Ahmad Fatoum
On 01.02.24 11:24, Stefan Kerkmann wrote: > Hello Ahmad, > > On 31.01.24 18:21, Ahmad Fatoum wrote: >> On 31.01.24 17:57, Stefan Kerkmann wrote: >>> OOB writes can be triggered when fdt->dt_size * 2 is still smaller than >>> the property for which memory should be allocated. This can happen under

Re: [PATCH 2/2] of: fdt: fix oob writes with large ftd properties

2024-02-01 Thread Stefan Kerkmann
Hello Ahmad, On 31.01.24 18:21, Ahmad Fatoum wrote: On 31.01.24 17:57, Stefan Kerkmann wrote: OOB writes can be triggered when fdt->dt_size * 2 is still smaller than the property for which memory should be allocated. This can happen under rare circumstances when editing a fdt with the

Re: [PATCH 2/2] of: fdt: fix oob writes with large ftd properties

2024-02-01 Thread Stefan Kerkmann
Hi Sascha, On 01.02.24 08:47, Sascha Hauer wrote: In the subject: s/ftd/fdt/ Applied. Sascha On Wed, Jan 31, 2024 at 05:57:00PM +0100, Stefan Kerkmann wrote: OOB writes can be triggered when fdt->dt_size * 2 is still smaller than the property for which memory should be allocated. This

Re: [PATCH 1/2] of: fdt: fix memory leak in fdt_ensure_space

2024-02-01 Thread Stefan Kerkmann
Hello Ahmad, On 31.01.24 18:15, Ahmad Fatoum wrote: Hello Stefan, On 31.01.24 17:56, Stefan Kerkmann wrote: If the reallocation failed the old memory remains allocated and is never freed, this is fixed by freeing the old memory on error. Signed-off-by: Stefan Kerkmann --- drivers/of/fdt.c