summaryrefslogtreecommitdiff
path: root/kexec
diff options
context:
space:
mode:
authorZhaofeng Li <hello@zhaofeng.li>2021-09-13 20:51:40 -0700
committerSimon Horman <horms@verge.net.au>2021-09-14 13:22:14 +0200
commit1d0275858f526a15733c29d18fac0d2347ec3496 (patch)
tree19a2dcef257f3339598eb435b864d4370554ba0b /kexec
parent4f8d667fc52375494db6d7413a0b15411d102e60 (diff)
downloadkexec-tools-1d0275858f526a15733c29d18fac0d2347ec3496.tar.gz
multiboot2: Use rel_min and rel_max for buffer destinations
This would segfault if mhi.rel_tag didn't exist. Signed-off-by: Zhaofeng Li <hello@zhaofeng.li> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec')
-rw-r--r--kexec/arch/i386/kexec-mb2-x86.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kexec/arch/i386/kexec-mb2-x86.c b/kexec/arch/i386/kexec-mb2-x86.c
index 6bbe35e..f3c6438 100644
--- a/kexec/arch/i386/kexec-mb2-x86.c
+++ b/kexec/arch/i386/kexec-mb2-x86.c
@@ -582,7 +582,7 @@ int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
/* Pick the next aligned spot to load it in. Always page align. */
addr = add_buffer(info, buf, mod_size, mod_size, getpagesize(),
- mhi.rel_tag->min_addr, mhi.rel_tag->max_addr, 1);
+ rel_min, rel_max, 1);
/* Add the module command line */
sprintf(mod_clp, "%s", mod_command_line);
@@ -602,7 +602,7 @@ int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
return -1;
addr = add_buffer(info, mbi_buf, mbi_bytes, mbi_bytes, 4,
- mhi.rel_tag->min_addr, mhi.rel_tag->max_addr, 1);
+ rel_min, rel_max, 1);
elf_rel_get_symbol(&info->rhdr, "entry32_regs", &regs, sizeof(regs));
regs.eax = MULTIBOOT2_BOOTLOADER_MAGIC;