diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-24 10:52:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-25 09:27:07 +0200 |
commit | 8d21690fa82bbc29cc34005103a2eda63eafabf3 (patch) | |
tree | d8ce8f5ed7cf851e1938b3cd96e0ae4860467f3b /arch/arm/boards/raspberry-pi | |
parent | 3b93bcd8db01bbe49249b59b0581b3ba375cb96b (diff) | |
download | barebox-8d21690fa82bbc29cc34005103a2eda63eafabf3.tar.gz barebox-8d21690fa82bbc29cc34005103a2eda63eafabf3.tar.xz |
fdt: Check blob size during unflattening
of_unflatten_dtb() doesn't check the size of the device tree blob
passed to it. Add a size argument end add checks for the size. Some
callers have no idea of the buffer size themselves, INT_MAX is passed
in these cases.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210624085223.14616-4-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/raspberry-pi')
-rw-r--r-- | arch/arm/boards/raspberry-pi/rpi-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c index e326732b3a..6c5df6fd69 100644 --- a/arch/arm/boards/raspberry-pi/rpi-common.c +++ b/arch/arm/boards/raspberry-pi/rpi-common.c @@ -430,7 +430,7 @@ static int rpi_vc_fdt_bootargs(void *fdt) struct device_node *root = NULL, *node; const char *cmdline; - root = of_unflatten_dtb(fdt); + root = of_unflatten_dtb(fdt, INT_MAX); if (IS_ERR(root)) { ret = PTR_ERR(root); root = NULL; |