The ultravisor will do an integrity check of the kernel image but we
relocated it so the check will fail. Restore the original image by
relocating it back to the kernel virtual base address.
This works because during build vmlinux is linked with an expected virtual
runtime address of KERNELBASE.
Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init")
Signed-off-by: Thiago Jung Bauermann <redacted>
---
arch/powerpc/include/asm/elf.h | 3 +++
arch/powerpc/kernel/prom_init.c | 11 +++++++++++
arch/powerpc/kernel/prom_init_check.sh | 3 ++-
3 files changed, 16 insertions(+), 1 deletion(-)
@@ -3249,7 +3249,18 @@ static void setup_secure_guest(unsigned long kbase, unsigned long fdt)/* Switch to secure mode. */prom_printf("Switching to secure mode.\n");+/*+*Theultravisorwilldoanintegritycheckofthekernelimagebutwe+*relocateditsothecheckwillfail.Restoretheoriginalimageby+*relocatingitbacktothekernelvirtualbaseaddress.+*/+relocate(KERNELBASE);+ret=enter_secure_mode(kbase,fdt);++/* Relocate the kernel again. */+relocate(kbase);+if(ret!=U_SUCCESS){prom_printf("Returned %d from switching to secure mode.\n",ret);prom_rtas_os_term("Switch to secure mode failed.\n");
The ultravisor will do an integrity check of the kernel image but we
relocated it so the check will fail. Restore the original image by
relocating it back to the kernel virtual base address.
This works because during build vmlinux is linked with an expected virtual
runtime address of KERNELBASE.
Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init")
Signed-off-by: Thiago Jung Bauermann <redacted>
I meant to put a Suggested-by: Paul Mackerras [off-list ref]
Sorry. Will add it if there's a v2.
--
Thiago Jung Bauermann
IBM Linux Technology Center
The ultravisor will do an integrity check of the kernel image but we
relocated it so the check will fail. Restore the original image by
relocating it back to the kernel virtual base address.
This works because during build vmlinux is linked with an expected virtual
runtime address of KERNELBASE.
Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init")
Signed-off-by: Thiago Jung Bauermann <redacted>
I meant to put a Suggested-by: Paul Mackerras [off-list ref]
Sorry. Will add it if there's a v2.
Ping?
--
Thiago Jung Bauermann
IBM Linux Technology Center
On Wed, Sep 11, 2019 at 01:34:33PM -0300, Thiago Jung Bauermann wrote:
The ultravisor will do an integrity check of the kernel image but we
relocated it so the check will fail. Restore the original image by
relocating it back to the kernel virtual base address.
This works because during build vmlinux is linked with an expected virtual
runtime address of KERNELBASE.
Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init")
Signed-off-by: Thiago Jung Bauermann <redacted>
@@ -3249,7 +3249,18 @@ static void setup_secure_guest(unsigned long kbase, unsigned long fdt)/* Switch to secure mode. */prom_printf("Switching to secure mode.\n");+/*+*Theultravisorwilldoanintegritycheckofthekernelimagebutwe+*relocateditsothecheckwillfail.Restoretheoriginalimageby+*relocatingitbacktothekernelvirtualbaseaddress.+*/+relocate(KERNELBASE);+ret=enter_secure_mode(kbase,fdt);++/* Relocate the kernel again. */+relocate(kbase);+if(ret!=U_SUCCESS){prom_printf("Returned %d from switching to secure mode.\n",ret);prom_rtas_os_term("Switch to secure mode failed.\n");
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2019-10-25 11:03:57
Thiago Jung Bauermann [off-list ref] writes:
The ultravisor will do an integrity check of the kernel image but we
relocated it so the check will fail. Restore the original image by
relocating it back to the kernel virtual base address.
This works because during build vmlinux is linked with an expected virtual
runtime address of KERNELBASE.
Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init")
Signed-off-by: Thiago Jung Bauermann <redacted>
---
arch/powerpc/include/asm/elf.h | 3 +++
arch/powerpc/kernel/prom_init.c | 11 +++++++++++
arch/powerpc/kernel/prom_init_check.sh | 3 ++-
3 files changed, 16 insertions(+), 1 deletion(-)
From: Michael Ellerman <hidden> Date: 2019-10-30 12:16:09
On Wed, 2019-09-11 at 16:34:33 UTC, Thiago Jung Bauermann wrote:
The ultravisor will do an integrity check of the kernel image but we
relocated it so the check will fail. Restore the original image by
relocating it back to the kernel virtual base address.
This works because during build vmlinux is linked with an expected virtual
runtime address of KERNELBASE.
Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init")
Signed-off-by: Thiago Jung Bauermann <redacted>