Commit 17c953d3 authored by Matthew Garrett's avatar Matthew Garrett Committed by Tim Gardner

kexec: Disable at runtime if the kernel enforces module loading restrictions

BugLink: http://bugs.launchpad.net/bugs/1566221

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: default avatarMatthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 3ee9b6b1
......@@ -17,6 +17,7 @@
#include <linux/syscalls.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/module.h>
#include "kexec_internal.h"
......@@ -131,7 +132,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
int result;
/* We only trust the superuser with rebooting the system. */
if (!capable(CAP_SYS_BOOT) || kexec_load_disabled)
if (!capable(CAP_SYS_BOOT) || kexec_load_disabled || secure_modules())
return -EPERM;
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment