summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorMatthias Maennich <maennich@google.com>2019-09-06 06:32:29 -0400
committerJessica Yu <jeyu@kernel.org>2019-09-10 04:30:27 -0400
commit3d52ec5e5d0dd7f8ca96a68c6756bd96e58b716b (patch)
tree51b5da97980203a40b9b1393ec5da9157d4d3215 /init
parentcb9b55d21fe06ca5e4ba244bb5aac0afeb745c8e (diff)
module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
If MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is enabled (default=n), the requirement for modules to import all namespaces that are used by the module is relaxed. Enabling this option effectively allows (invalid) modules to be loaded while only a warning is emitted. Disabling this option keeps the enforcement at module loading time and loading is denied if the module's imports are not satisfactory. Reviewed-by: Martijn Coenen <maco@android.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig13
1 files changed, 13 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index bd7d650d4a99..cc28561288a7 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2119,6 +2119,19 @@ config MODULE_COMPRESS_XZ
2119 2119
2120endchoice 2120endchoice
2121 2121
2122config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
2123 bool "Allow loading of modules with missing namespace imports"
2124 help
2125 Symbols exported with EXPORT_SYMBOL_NS*() are considered exported in
2126 a namespace. A module that makes use of a symbol exported with such a
2127 namespace is required to import the namespace via MODULE_IMPORT_NS().
2128 There is no technical reason to enforce correct namespace imports,
2129 but it creates consistency between symbols defining namespaces and
2130 users importing namespaces they make use of. This option relaxes this
2131 requirement and lifts the enforcement when loading a module.
2132
2133 If unsure, say N.
2134
2122config TRIM_UNUSED_KSYMS 2135config TRIM_UNUSED_KSYMS
2123 bool "Trim unused exported kernel symbols" 2136 bool "Trim unused exported kernel symbols"
2124 depends on MODULES && !UNUSED_SYMBOLS 2137 depends on MODULES && !UNUSED_SYMBOLS