diff options
author | P.V. Phani Kumar <pvphani@codeaurora.org> | 2016-03-09 12:35:23 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-06 05:22:26 -0700 |
commit | cbb74e22d97462c412b1b691bdf4c28c1f122e22 (patch) | |
tree | 20b1303d48864623851fdd2d31d7cfb1987a1f7f | |
parent | aed4865b21a8394b397b3d9001e59247ec003295 (diff) |
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
-rwxr-xr-x | platform/msm_shared/dev_tree.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/msm_shared/dev_tree.c b/platform/msm_shared/dev_tree.c index 5cd65761..f120927d 100755 --- a/platform/msm_shared/dev_tree.c +++ b/platform/msm_shared/dev_tree.c @@ -1269,6 +1269,12 @@ int update_device_tree(void *fdt, const char *cmdline, 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) |