Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
From 0f6eec5ca124baf1372fb4edeacd11a002378f5e Mon Sep 17 00:00:00 2001
|
2014-08-20 17:22:24 +00:00
|
|
|
From: Matthew Garrett <matthew.garrett@nebula.com>
|
|
|
|
Date: Fri, 9 Aug 2013 17:58:15 -0400
|
2015-09-09 15:10:06 +00:00
|
|
|
Subject: [PATCH 01/20] Add secure_modules() call
|
2014-08-20 17:22:24 +00:00
|
|
|
|
|
|
|
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>
|
|
|
|
---
|
2015-06-29 15:24:25 +00:00
|
|
|
include/linux/module.h | 6 ++++++
|
2014-08-20 17:22:24 +00:00
|
|
|
kernel/module.c | 10 ++++++++++
|
2015-06-29 15:24:25 +00:00
|
|
|
2 files changed, 16 insertions(+)
|
2014-08-20 17:22:24 +00:00
|
|
|
|
|
|
|
diff --git a/include/linux/module.h b/include/linux/module.h
|
Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
index 3daf2b3..082298a 100644
|
2014-08-20 17:22:24 +00:00
|
|
|
--- a/include/linux/module.h
|
|
|
|
+++ b/include/linux/module.h
|
Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
@@ -655,6 +655,8 @@ static inline bool is_livepatch_module(struct module *mod)
|
2015-06-29 15:24:25 +00:00
|
|
|
}
|
Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
#endif /* CONFIG_LIVEPATCH */
|
2014-08-20 17:22:24 +00:00
|
|
|
|
|
|
|
+extern bool secure_modules(void);
|
|
|
|
+
|
|
|
|
#else /* !CONFIG_MODULES... */
|
|
|
|
|
|
|
|
/* Given an address, look for it in the exception tables. */
|
Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
@@ -771,6 +773,10 @@ static inline bool module_requested_async_probing(struct module *module)
|
2015-06-29 15:24:25 +00:00
|
|
|
return false;
|
2014-08-20 17:22:24 +00:00
|
|
|
}
|
2015-06-29 15:24:25 +00:00
|
|
|
|
2014-08-20 17:22:24 +00:00
|
|
|
+static inline bool secure_modules(void)
|
|
|
|
+{
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
#endif /* CONFIG_MODULES */
|
|
|
|
|
|
|
|
#ifdef CONFIG_SYSFS
|
|
|
|
diff --git a/kernel/module.c b/kernel/module.c
|
Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
index 5f71aa6..3c38496 100644
|
2014-08-20 17:22:24 +00:00
|
|
|
--- a/kernel/module.c
|
|
|
|
+++ b/kernel/module.c
|
Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
@@ -4199,3 +4199,13 @@ void module_layout(struct module *mod,
|
2014-08-20 17:22:24 +00:00
|
|
|
}
|
|
|
|
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);
|
2015-09-09 15:10:06 +00:00
|
|
|
--
|
Linux v4.6-3623-g0b7962a
ata, regulator, gpio, HID, livepatching, networking, dm, block, vfs, fs,
timers, crypto merges
2016-05-18 15:28:46 +00:00
|
|
|
2.5.5
|
2015-09-09 15:10:06 +00:00
|
|
|
|