提交 6339a388 编写于 作者: P Philipp Rudo 提交者: Martin Schwidefsky

s390/kexec_file: Fix potential segment overlap in ELF loader

When loading an ELF image via kexec_file the segment alignment is ignored
in the calculation for the load address of the next segment. When there are
multiple segments this can lead to segment overlap and thus load failure.
Signed-off-by: NPhilipp Rudo <prudo@linux.ibm.com>
Fixes: 8be01882 ("s390/kexec_file: Add ELF loader")
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 f3df44e7
......@@ -53,7 +53,7 @@ static int kexec_file_add_elf_kernel(struct kimage *image,
if (ret)
return ret;
data->memsz += buf.memsz;
data->memsz = ALIGN(data->memsz, phdr->p_align) + buf.memsz;
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册