Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef95f6c3 authored by Vijay Kumar Pendoti's avatar Vijay Kumar Pendoti Committed by Elliot Berman
Browse files

dtc: add integer overflow checks in fdt header



Protect against integer overflows caused by malformed fdt headers.

[eberman@codeaurora.org: most of changes have been fixed in 
commit f858927f ("scripts/dtc: Update to upstream version
v1.4.7-14-gc86da84d30e4"). The upstream was commit eb890c0f77dc
("libfdt: Make fdt_check_header() more thorough"))]
CRs-Fixed: 749977
Change-Id: I51d87038f520bc761b163d291b0138c513c69a33
Signed-off-by: default avatarVijay Kumar Pendoti <vpendo@codeaurora.org>
Signed-off-by: default avatarElliot Berman <eberman@codeaurora.org>
parent e99d7055
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ int fdt_del_node(void *fdt, int nodeoffset)
static void fdt_packblocks_(const char *old, char *new,
			    int mem_rsv_size, int struct_size)
{
	int mem_rsv_off, struct_off, strings_off;
	uint32_t mem_rsv_off, struct_off, strings_off;

	mem_rsv_off = FDT_ALIGN(sizeof(struct fdt_header), 8);
	struct_off = mem_rsv_off + mem_rsv_size;