summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2018-03-29 22:01:01 +0100
committerRussell King <rmk@armlinux.org.uk>2018-03-29 22:01:01 +0100
commiteb14a8b55208c1a7320035af045e38ecd6f5458a (patch)
treeccf03439ccbdcc24ee5bac69ab204760722250c0
parentf57f0bf8975d24fe1e7c4936fdfb5c3b123ab75f (diff)
ARM: Ensure kernel size tag is sized appropriatelyHEADmasterarm
Ensure that the kernel size tag is an appropriate size before using the information contained within it. Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r--kexec/arch/arm/kexec-zImage-arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 2a7eea9..2a77e57 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -567,7 +567,7 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
* overwritten.
*/
tag = find_extension_tag(buf, len, ZIMAGE_TAG_KRNL_SIZE);
- if (tag) {
+ if (tag && tag->hdr.size >= 2) {
uint32_t *p = (void *)buf + le32_to_cpu(tag->u.krnl_size.size_ptr);
uint32_t edata_size = le32_to_cpu(get_unaligned(p));
uint32_t bss_size = le32_to_cpu(tag->u.krnl_size.bss_size);