mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
s390/kexec_file: Fix potential segment overlap in ELF loader
[ Upstream commit6339a3889a] 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: Philipp Rudo <prudo@linux.ibm.com> Fixes:8be0188271("s390/kexec_file: Add ELF loader") Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0701a1d6f1
commit
232e674ed9
|
|
@ -58,7 +58,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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user