]> www.infradead.org Git - users/hch/misc.git/commitdiff
module: remove CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS missing-imports
authorChristoph Hellwig <hch@lst.de>
Wed, 14 May 2025 13:54:32 +0000 (15:54 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 14 May 2025 13:56:03 +0000 (15:56 +0200)
There is no point in bypassing the namespaces and undo the order
they created.  Anyone having problems had more than 5 years to
sort them out.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Documentation/core-api/symbol-namespaces.rst
kernel/module/Kconfig
kernel/module/main.c
scripts/Makefile.modpost

index 06f766a6aab2446c6218e80fe2573aa79dc59ace..ca7cce745ecf52c480733ff42fa18786087d320a 100644 (file)
@@ -114,12 +114,9 @@ metadata definitions like MODULE_AUTHOR() or MODULE_LICENSE(). Refer to section
 
 At module loading time (e.g. ``insmod``), the kernel will check each symbol
 referenced from the module for its availability and whether the namespace it
-might be exported to has been imported by the module. The default behaviour of
-the kernel is to reject loading modules that don't specify sufficient imports.
-An error will be logged and loading will be failed with EINVAL. In order to
-allow loading of modules that don't satisfy this precondition, a configuration
-option is available: Setting MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y will
-enable loading regardless, but will emit a warning.
+might be exported to has been imported by the module. The kernel rejects
+loading modules that don't specify sufficient imports, an error will be logged
+and loading will be failed with EINVAL.
 
 5. Automatically creating MODULE_IMPORT_NS statements
 =====================================================
index d7762ef5949a2c4d59e366a8fb3b3fd4f0ff2e69..125ed4886bf3561da53d6b3e7b508df4f9ef6982 100644 (file)
@@ -400,19 +400,6 @@ config MODULE_DECOMPRESS
 
          If unsure, say N.
 
-config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
-       bool "Allow loading of modules with missing namespace imports"
-       help
-         Symbols exported with EXPORT_SYMBOL_NS*() are considered exported in
-         a namespace. A module that makes use of a symbol exported with such a
-         namespace is required to import the namespace via MODULE_IMPORT_NS("").
-         There is no technical reason to enforce correct namespace imports,
-         but it creates consistency between symbols defining namespaces and
-         users importing namespaces they make use of. This option relaxes this
-         requirement and lifts the enforcement when loading a module.
-
-         If unsure, say N.
-
 config MODPROBE_PATH
        string "Path to modprobe binary"
        default "/sbin/modprobe"
index a2859dc3eea66ec19991e7e4afb5bbcae2c2d167..043b1bea531b323f4242a911c199d65634693f7c 100644 (file)
@@ -1096,16 +1096,10 @@ static int verify_namespace_is_imported(const struct load_info *info,
                        if (strcmp(namespace, imported_namespace) == 0)
                                return 0;
                }
-#ifdef CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
-               pr_warn(
-#else
                pr_err(
-#endif
                        "%s: module uses symbol (%s) from namespace %s, but does not import it.\n",
                        mod->name, kernel_symbol_name(sym), namespace);
-#ifndef CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
                return -EINVAL;
-#endif
        }
        return 0;
 }
index d7d45067d08b94a82451d66a64eae29b6826e139..95ebefe5b91d896e841589dc46f28568e7176444 100644 (file)
@@ -49,7 +49,7 @@ modpost-args =                                                                                \
        $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)                                  \
        $(if $(KBUILD_MODPOST_WARN),-w)                                                 \
        $(if $(KBUILD_NSDEPS),-d modules.nsdeps)                                        \
-       $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N)       \
+       $(if $(KBUILD_NSDEPS),-N)       \
        $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W)                                  \
        -o $@