diff options
| author | Rob Herring <robh@kernel.org> | 2016-03-04 08:56:58 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@google.com> | 2018-02-05 08:58:36 -0800 |
| commit | 4d8ea865394ee408d2c5e5c8e317fd952dc0e46f (patch) | |
| tree | 63dae4bde46ee19397f99acaf55f98176e684e03 /scripts/dtc/flattree.c | |
| parent | 8b8ef6794bdba4b5805596c0933bfa0be224b457 (diff) | |
UPSTREAM: scripts/dtc: Update to upstream version 53bf130b1cdd
Sync to upstream dtc commit 53bf130b1cdd ("libfdt: simplify
fdt_node_check_compatible()"). This adds the following commits from
upstream:
53bf130 libfdt: simplify fdt_node_check_compatible()
c9d9121 Warn on node name unit-address presence/absence mismatch
2e53f9d Catch unsigned 32bit overflow when parsing flattened device tree offsets
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit b993734718c0106418e068f21c7be01afc12306c)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'scripts/dtc/flattree.c')
| -rw-r--r-- | scripts/dtc/flattree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c index bd99fa2d33b8..ec14954f5810 100644 --- a/scripts/dtc/flattree.c +++ b/scripts/dtc/flattree.c @@ -889,7 +889,7 @@ struct boot_info *dt_from_blob(const char *fname) if (version >= 3) { uint32_t size_str = fdt32_to_cpu(fdt->size_dt_strings); - if (off_str+size_str > totalsize) + if ((off_str+size_str < off_str) || (off_str+size_str > totalsize)) die("String table extends past total size\n"); inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str); } else { @@ -898,7 +898,7 @@ struct boot_info *dt_from_blob(const char *fname) if (version >= 17) { size_dt = fdt32_to_cpu(fdt->size_dt_struct); - if (off_dt+size_dt > totalsize) + if ((off_dt+size_dt < off_dt) || (off_dt+size_dt > totalsize)) die("Structure block extends past total size\n"); } |
