summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJiri Bohac <jbohac@suse.cz>2019-08-20 02:17:45 +0200
committerJames Morris <jmorris@namei.org>2019-08-20 06:54:15 +0200
commit155bdd30af17e90941589b5db4dab9a29b28c112 (patch)
treed98bbf8e1a8cc25764dfa019a0c1e3efd446a804 /kernel
parentkexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE (diff)
downloadlinux-155bdd30af17e90941589b5db4dab9a29b28c112.tar.xz
linux-155bdd30af17e90941589b5db4dab9a29b28c112.zip
kexec_file: Restrict at runtime if the kernel is locked down
When KEXEC_SIG is not enabled, kernel should not load images through kexec_file systemcall if the kernel is locked down. [Modified by David Howells to fit with modifications to the previous patch and to return -EPERM if the kernel is locked down for consistency with other lockdowns. Modified by Matthew Garrett to remove the IMA integration, which will be replaced by integrating with the IMA architecture policy patches.] Signed-off-by: Jiri Bohac <jbohac@suse.cz> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Matthew Garrett <mjg59@google.com> cc: kexec@lists.infradead.org Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kexec_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index 972931201995..43109ef4d6bf 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -208,7 +208,7 @@ kimage_validate_signature(struct kimage *image)
return ret;
}
- return 0;
+ return security_locked_down(LOCKDOWN_KEXEC);
/* All other errors are fatal, including nomem, unparseable
* signatures and signature check failures - even if signatures