Commit b2d26ece authored by Matthew Garrett's avatar Matthew Garrett Committed by Tim Gardner

Add secure_modules() call

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

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: default avatarMatthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent f9e48f71
......@@ -630,6 +630,8 @@ static inline bool module_requested_async_probing(struct module *module)
return module && module->async_probe_requested;
}
extern bool secure_modules(void);
#else /* !CONFIG_MODULES... */
/* Given an address, look for it in the exception tables. */
......@@ -746,6 +748,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
......
......@@ -4108,3 +4108,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);
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