s390/kexec_file: Fix potential segment overlap in ELF loader
authorPhilipp Rudo <prudo@linux.ibm.com>
Mon, 1 Apr 2019 10:13:42 +0000 (12:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:42 +0000 (14:50 +0100)
commit232e674ed946ef27a26241db9dedbc4470eaa874
tree8f8bdc83f61434d25563ab93e3d6d2948d5c17d3
parent0701a1d6f101fd7658bc82b3a11941c01273a763
s390/kexec_file: Fix potential segment overlap in ELF loader

[ Upstream commit 6339a3889ad4d0dd930ed7a1e873fb81d3e690f7 ]

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: 8be018827154 ("s390/kexec_file: Add ELF loader")
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/kernel/kexec_elf.c