summaryrefslogtreecommitdiffstats
path: root/kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2014-08-20 13:22:24 -0400
committerJosh Boyer <jwboyer@fedoraproject.org>2014-08-20 13:22:24 -0400
commit6a91557e4cd508858eca5aba5406a9109861d4de (patch)
treec57990ccc4a28a9933db2aebba1006f46c619f44 /kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch
parenta99be7d4cf2fae68a0562a7687d89ee61c6b9f98 (diff)
downloadkernel-6a91557e4cd508858eca5aba5406a9109861d4de.tar.gz
kernel-6a91557e4cd508858eca5aba5406a9109861d4de.tar.xz
kernel-6a91557e4cd508858eca5aba5406a9109861d4de.zip
Patch file cleanup
Do a couple things here: - Split the mega-patches into individual patches. Should help with rebasing. - Make all patches 'git am' acceptable. There should be no functional or actual code differences from before
Diffstat (limited to 'kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch')
-rw-r--r--kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch b/kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch
new file mode 100644
index 000000000..ebd5371f4
--- /dev/null
+++ b/kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch
@@ -0,0 +1,44 @@
+From 8633ed1850c24ea2e52c7c64c293186946935e8a Mon Sep 17 00:00:00 2001
+From: Matthew Garrett <matthew.garrett@nebula.com>
+Date: Fri, 9 Aug 2013 03:33:56 -0400
+Subject: [PATCH] kexec: Disable at runtime if the kernel enforces module
+ loading restrictions
+
+kexec permits the loading and execution of arbitrary code in ring 0, which
+is something that module signing enforcement is meant to prevent. It makes
+sense to disable kexec in this situation.
+
+Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
+---
+ kernel/kexec.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/kernel/kexec.c b/kernel/kexec.c
+index 0b49a0a58102..8e649f7c22e1 100644
+--- a/kernel/kexec.c
++++ b/kernel/kexec.c
+@@ -36,6 +36,7 @@
+ #include <linux/syscore_ops.h>
+ #include <linux/compiler.h>
+ #include <linux/hugetlb.h>
++#include <linux/module.h>
+
+ #include <asm/page.h>
+ #include <asm/uaccess.h>
+@@ -1245,6 +1246,13 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
+ return -EPERM;
+
+ /*
++ * kexec can be used to circumvent module loading restrictions, so
++ * prevent loading in that case
++ */
++ if (secure_modules())
++ return -EPERM;
++
++ /*
+ * Verify we have a legal set of flags
+ * This leaves us room for future extensions.
+ */
+--
+1.9.3
+