All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] Add secure_modules() call
@ 2013-08-19 16:10 Matthew Garrett
  2013-08-19 16:10 ` [PATCH 02/10] PCI: Lock down BAR access when module security is enabled Matthew Garrett
                   ` (6 more replies)
  0 siblings, 7 replies; 35+ messages in thread
From: Matthew Garrett @ 2013-08-19 16:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-efi, jwboyer, keescook, Matthew Garrett

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.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
---
 include/linux/module.h | 7 +++++++
 kernel/module.c        | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/linux/module.h b/include/linux/module.h
index 46f1ea0..0c266b2 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -509,6 +509,8 @@ int unregister_module_notifier(struct notifier_block * nb);
 
 extern void print_modules(void);
 
+extern bool secure_modules(void);
+
 #else /* !CONFIG_MODULES... */
 
 /* Given an address, look for it in the exception tables. */
@@ -619,6 +621,11 @@ static inline int unregister_module_notifier(struct notifier_block * nb)
 static inline void print_modules(void)
 {
 }
+
+static inline bool secure_modules(void)
+{
+	return false;
+}
 #endif /* CONFIG_MODULES */
 
 #ifdef CONFIG_SYSFS
diff --git a/kernel/module.c b/kernel/module.c
index 2069158..801021e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3852,3 +3852,12 @@ 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
+}
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2013-09-01  8:52 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-19 16:10 [PATCH 01/10] Add secure_modules() call Matthew Garrett
2013-08-19 16:10 ` [PATCH 02/10] PCI: Lock down BAR access when module security is enabled Matthew Garrett
     [not found] ` <1376928619-3775-1-git-send-email-matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>
2013-08-19 16:10   ` [PATCH 03/10] x86: Lock down IO port " Matthew Garrett
2013-08-19 16:10     ` Matthew Garrett
2013-08-19 16:10   ` [PATCH 04/10] ACPI: Limit access to custom_method Matthew Garrett
2013-08-19 16:10     ` Matthew Garrett
     [not found]     ` <1376928619-3775-4-git-send-email-matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>
2013-08-29 17:58       ` Lenny Szubowicz
2013-08-29 17:58         ` Lenny Szubowicz
2013-08-19 16:10   ` [PATCH 10/10] Add option to automatically enforce module signatures when in Secure Boot mode Matthew Garrett
2013-08-19 16:10     ` Matthew Garrett
2013-08-19 16:10 ` [PATCH 05/10] asus-wmi: Restrict debugfs interface when module loading is restricted Matthew Garrett
     [not found]   ` <1376928619-3775-5-git-send-email-matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>
2013-08-19 16:20     ` Kees Cook
2013-08-19 16:20       ` Kees Cook
     [not found]       ` <CAGXu5jJtvVx76ZZrk+s4KwopT-ocZcMbwWNM1ELxH4crm=QGLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-19 17:15         ` Matthew Garrett
2013-08-19 17:15           ` Matthew Garrett
2013-08-29 18:22     ` H. Peter Anvin
2013-08-29 18:22       ` H. Peter Anvin
2013-08-29 18:35       ` Matthew Garrett
2013-08-29 18:35         ` Matthew Garrett
2013-08-29 18:46         ` H. Peter Anvin
2013-08-29 18:46           ` H. Peter Anvin
     [not found]           ` <521F9708.6040902-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-08-29 18:49             ` Matthew Garrett
2013-08-29 18:49               ` Matthew Garrett
2013-08-29 19:05               ` H. Peter Anvin
2013-08-29 19:05                 ` H. Peter Anvin
     [not found]                 ` <521F9B8B.6090300-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-08-29 19:07                   ` Matthew Garrett
2013-08-29 19:07                     ` Matthew Garrett
2013-08-29 19:28                   ` Josh Boyer
2013-08-29 19:28                     ` Josh Boyer
2013-08-19 16:10 ` [PATCH 06/10] Restrict /dev/mem and /dev/kmem " Matthew Garrett
2013-08-19 16:10 ` [PATCH 07/10] acpi: Ignore acpi_rsdp kernel parameter " Matthew Garrett
2013-08-19 16:10 ` [PATCH 08/10] kexec: Disable at runtime if the kernel enforces module loading restrictions Matthew Garrett
     [not found]   ` <1376928619-3775-8-git-send-email-matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>
2013-09-01  8:52     ` Geert Uytterhoeven
2013-09-01  8:52       ` Geert Uytterhoeven
2013-08-19 16:10 ` [PATCH 09/10] x86: Restrict MSR access when module loading is restricted Matthew Garrett

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.