platform: msm_shared: Ensure DT updates stays within aboot range.
Add error condition check to ensure updates to DT entry should
not overshoot aboot memory region.
Change-Id: Idc3971434dd18ddea3e1a07ad7a0d25ad86f6094
CRs-Fixed:977684
diff --git a/platform/msm_shared/dev_tree.c b/platform/msm_shared/dev_tree.c
index 5cd6576..f120927 100755
--- a/platform/msm_shared/dev_tree.c
+++ b/platform/msm_shared/dev_tree.c
@@ -1269,6 +1269,12 @@
return ret;
}
+ if (check_aboot_addr_range_overlap((uint32_t)fdt,
+ (fdt_totalsize(fdt) + DTB_PAD_SIZE))) {
+ dprintf(CRITICAL, "Error: Fdt addresses overlap with aboot addresses.\n");
+ return ret;
+ }
+
/* Add padding to make space for new nodes and properties. */
ret = fdt_open_into(fdt, fdt, fdt_totalsize(fdt) + DTB_PAD_SIZE);
if (ret!= 0)