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

Stefan Kerkmann s.kerkmann at pengutronix.de
Thu Feb 1 03:28:48 PST 2024


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 <s.kerkmann at pengutronix.de>
---
Changes in v2:
- Review feedback from Ahmad and Sascha
- Link to v1: https://lore.kernel.org/r/20240131-fix-fdt-memory-safety-v1-0-3d3a2c797eec@pengutronix.de

---
Stefan Kerkmann (2):
      of: fdt: fix memory leak in fdt_ensure_space
      of: fdt: fix oob writes with large fdt properties

 drivers/of/fdt.c | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)
---
base-commit: cecd3fbea3550532d2175bc13aa479a45e605da0
change-id: 20240131-fix-fdt-memory-safety-b06f9164d953

Best regards,
-- 
Stefan Kerkmann <s.kerkmann at pengutronix.de>




More information about the barebox mailing list