]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: UEFI: Add secure_modules() call
authorMatthew Garrett <matthew.garrett@nebula.com>
Fri, 9 Aug 2013 21:58:15 +0000 (17:58 -0400)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
Provide a single call to allow kernel code to determine whether the system
has been configured to either disable module loading entirely or to load
only modules signed with a trusted key.

Bugzilla: N/A
Upstream-status: Fedora mustard.  Replaced by securelevels, but that was nak'd

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
include/linux/module.h
kernel/module.c

index cc7cba219b207de5536f6f9e9353d1a20201e4af..4948f20d8e36b972d10b1d8c11dc4b388a4bcd4e 100644 (file)
@@ -641,6 +641,8 @@ static inline bool is_livepatch_module(struct module *mod)
 }
 #endif /* CONFIG_LIVEPATCH */
 
+extern bool secure_modules(void);
+
 #else /* !CONFIG_MODULES... */
 
 static inline struct module *__module_address(unsigned long addr)
@@ -750,6 +752,10 @@ static inline bool module_requested_async_probing(struct module *module)
        return false;
 }
 
+static inline bool secure_modules(void)
+{
+       return false;
+}
 #endif /* CONFIG_MODULES */
 
 #ifdef CONFIG_SYSFS
index 3d8f126208e3ae04eeff3fd1b1e00044c0e3d0d2..9a565d51d56d99ab23abe70afae585144a1d3ea1 100644 (file)
@@ -4299,3 +4299,13 @@ void module_layout(struct module *mod,
 }
 EXPORT_SYMBOL(module_layout);
 #endif
+
+bool secure_modules(void)
+{
+#ifdef CONFIG_MODULE_SIG
+       return (sig_enforce || modules_disabled);
+#else
+       return modules_disabled;
+#endif
+}
+EXPORT_SYMBOL(secure_modules);