Skip to content

Commit

Permalink
s390/kexec_file: Disable kexec_load when IPLed secure
Browse files Browse the repository at this point in the history
A kernel loaded via kexec_load cannot be verified. Thus disable kexec_load
systemcall in kernels which where IPLed securely. Use the IMA mechanism to
do so.

Signed-off-by: Philipp Rudo <prudo@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Philipp Rudo authored and Martin Schwidefsky committed Apr 29, 2019
1 parent 99feaa7 commit 268a784
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions arch/s390/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ obj-$(CONFIG_JUMP_LABEL) += jump_label.o
obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o
obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o

obj-$(CONFIG_IMA) += ima_arch.o

obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_cpum_cf_common.o
obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf.o perf_cpum_sf.o
obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf_events.o perf_regs.o
Expand Down
14 changes: 14 additions & 0 deletions arch/s390/kernel/ima_arch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0

#include <linux/ima.h>
#include <asm/boot_data.h>

bool arch_ima_get_secureboot(void)
{
return ipl_secure_flag;
}

const char * const *arch_get_ima_policy(void)
{
return NULL;
}
2 changes: 1 addition & 1 deletion include/linux/ima.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern void ima_post_path_mknod(struct dentry *dentry);
extern void ima_add_kexec_buffer(struct kimage *image);
#endif

#if defined(CONFIG_X86) && defined(CONFIG_EFI)
#if (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390)
extern bool arch_ima_get_secureboot(void);
extern const char * const *arch_get_ima_policy(void);
#else
Expand Down

0 comments on commit 268a784

Please sign in to comment.