|
|
1f73373 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
Jeremy Cline |
d1b6f8c |
From: Jeremy Cline <jcline@redhat.com>
|
|
Jeremy Cline |
d1b6f8c |
Date: Wed, 30 Oct 2019 14:37:49 +0000
|
|
Jeremy Cline |
d1b6f8c |
Subject: [PATCH] s390: Lock down the kernel when the IPL secure flag is set
|
|
Jeremy Cline |
d1b6f8c |
|
|
Jeremy Cline |
d1b6f8c |
Automatically lock down the kernel to LOCKDOWN_CONFIDENTIALITY_MAX if
|
|
Jeremy Cline |
d1b6f8c |
the IPL secure flag is set.
|
|
Jeremy Cline |
d1b6f8c |
|
|
Jeremy Cline |
d1b6f8c |
Upstream Status: RHEL only
|
|
Jeremy Cline |
d1b6f8c |
Suggested-by: Philipp Rudo <prudo@redhat.com>
|
|
Jeremy Cline |
d1b6f8c |
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
|
Jeremy Cline |
d1b6f8c |
---
|
|
Jeremy Cline |
d1b6f8c |
arch/s390/include/asm/ipl.h | 1 +
|
|
Jeremy Cline |
d1b6f8c |
arch/s390/kernel/ipl.c | 5 +++++
|
|
Jeremy Cline |
d1b6f8c |
arch/s390/kernel/setup.c | 4 ++++
|
|
Jeremy Cline |
d1b6f8c |
3 files changed, 10 insertions(+)
|
|
Jeremy Cline |
d1b6f8c |
|
|
Jeremy Cline |
d1b6f8c |
diff --git a/arch/s390/include/asm/ipl.h b/arch/s390/include/asm/ipl.h
|
|
|
fb49733 |
index 7d5cfdda5277..be66ee5d0437 100644
|
|
Jeremy Cline |
d1b6f8c |
--- a/arch/s390/include/asm/ipl.h
|
|
Jeremy Cline |
d1b6f8c |
+++ b/arch/s390/include/asm/ipl.h
|
|
|
fb49733 |
@@ -120,6 +120,7 @@ int ipl_report_add_component(struct ipl_report *report, struct kexec_buf *kbuf,
|
|
Jeremy Cline |
d1b6f8c |
unsigned char flags, unsigned short cert);
|
|
Jeremy Cline |
d1b6f8c |
int ipl_report_add_certificate(struct ipl_report *report, void *key,
|
|
Jeremy Cline |
d1b6f8c |
unsigned long addr, unsigned long len);
|
|
Jeremy Cline |
d1b6f8c |
+bool ipl_get_secureboot(void);
|
|
|
6c2cc50 |
|
|
Jeremy Cline |
d1b6f8c |
/*
|
|
Jeremy Cline |
d1b6f8c |
* DIAG 308 support
|
|
Jeremy Cline |
d1b6f8c |
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
|
|
|
fb49733 |
index ccea9a245867..558f9fbfd114 100644
|
|
Jeremy Cline |
d1b6f8c |
--- a/arch/s390/kernel/ipl.c
|
|
Jeremy Cline |
d1b6f8c |
+++ b/arch/s390/kernel/ipl.c
|
|
|
fb49733 |
@@ -2110,3 +2110,8 @@ int ipl_report_free(struct ipl_report *report)
|
|
Jeremy Cline |
d1b6f8c |
}
|
|
|
6c2cc50 |
|
|
Jeremy Cline |
d1b6f8c |
#endif
|
|
Jeremy Cline |
d1b6f8c |
+
|
|
Jeremy Cline |
d1b6f8c |
+bool ipl_get_secureboot(void)
|
|
Jeremy Cline |
d1b6f8c |
+{
|
|
Jeremy Cline |
d1b6f8c |
+ return !!ipl_secure_flag;
|
|
Jeremy Cline |
d1b6f8c |
+}
|
|
Jeremy Cline |
d1b6f8c |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
|
|
|
fb49733 |
index 5853c9872dfe..fab9bc9889da 100644
|
|
Jeremy Cline |
d1b6f8c |
--- a/arch/s390/kernel/setup.c
|
|
Jeremy Cline |
d1b6f8c |
+++ b/arch/s390/kernel/setup.c
|
|
Jeremy Cline |
d1b6f8c |
@@ -49,6 +49,7 @@
|
|
Jeremy Cline |
d1b6f8c |
#include <linux/memory.h>
|
|
Jeremy Cline |
d1b6f8c |
#include <linux/compat.h>
|
|
Jeremy Cline |
d1b6f8c |
#include <linux/start_kernel.h>
|
|
Jeremy Cline |
d1b6f8c |
+#include <linux/security.h>
|
|
|
6c2cc50 |
|
|
Jeremy Cline |
d1b6f8c |
#include <asm/boot_data.h>
|
|
Jeremy Cline |
d1b6f8c |
#include <asm/ipl.h>
|
|
|
fb49733 |
@@ -1086,6 +1087,9 @@ void __init setup_arch(char **cmdline_p)
|
|
|
6c2cc50 |
|
|
Jeremy Cline |
d1b6f8c |
log_component_list();
|
|
|
6c2cc50 |
|
|
Jeremy Cline |
d1b6f8c |
+ if (ipl_get_secureboot())
|
|
Jeremy Cline |
d1b6f8c |
+ security_lock_kernel_down("Secure IPL mode", LOCKDOWN_INTEGRITY_MAX);
|
|
Jeremy Cline |
d1b6f8c |
+
|
|
Jeremy Cline |
d1b6f8c |
/* Have one command line that is parsed and saved in /proc/cmdline */
|
|
Jeremy Cline |
d1b6f8c |
/* boot_command_line has been already set up in early.c */
|
|
Jeremy Cline |
d1b6f8c |
*cmdline_p = boot_command_line;
|
|
Jeremy Cline |
d1b6f8c |
--
|
|
|
6c2cc50 |
2.26.2
|
|
Jeremy Cline |
d1b6f8c |
|