xref: /linux/kernel/module/Kconfig (revision fc7d5e3210ae083a29ce224ffce18eaf3d1c645a)
173b4fc92SChristophe Leroy# SPDX-License-Identifier: GPL-2.0-only
273b4fc92SChristophe Leroymenuconfig MODULES
373b4fc92SChristophe Leroy	bool "Enable loadable module support"
473b4fc92SChristophe Leroy	modules
512af2b83SMike Rapoport (IBM)	select EXECMEM
673b4fc92SChristophe Leroy	help
773b4fc92SChristophe Leroy	  Kernel modules are small pieces of compiled code which can
873b4fc92SChristophe Leroy	  be inserted in the running kernel, rather than being
973b4fc92SChristophe Leroy	  permanently built into the kernel.  You use the "modprobe"
1073b4fc92SChristophe Leroy	  tool to add (and sometimes remove) them.  If you say Y here,
1173b4fc92SChristophe Leroy	  many parts of the kernel can be built as modules (by
1273b4fc92SChristophe Leroy	  answering M instead of Y where indicated): this is most
1373b4fc92SChristophe Leroy	  useful for infrequently used options which are not required
1473b4fc92SChristophe Leroy	  for booting.  For more information, see the man pages for
1573b4fc92SChristophe Leroy	  modprobe, lsmod, modinfo, insmod and rmmod.
1673b4fc92SChristophe Leroy
1773b4fc92SChristophe Leroy	  If you say Y here, you will need to run "make
1873b4fc92SChristophe Leroy	  modules_install" to put the modules under /lib/modules/
1973b4fc92SChristophe Leroy	  where modprobe can find them (you may need to be root to do
2073b4fc92SChristophe Leroy	  this).
2173b4fc92SChristophe Leroy
2273b4fc92SChristophe Leroy	  If unsure, say Y.
2373b4fc92SChristophe Leroy
2473b4fc92SChristophe Leroyif MODULES
2573b4fc92SChristophe Leroy
26df3e764dSLuis Chamberlainconfig MODULE_DEBUGFS
27df3e764dSLuis Chamberlain	bool
28df3e764dSLuis Chamberlain
29df3e764dSLuis Chamberlainconfig MODULE_DEBUG
30df3e764dSLuis Chamberlain	bool "Module debugging"
31df3e764dSLuis Chamberlain	depends on DEBUG_FS
32df3e764dSLuis Chamberlain	help
33df3e764dSLuis Chamberlain	  Allows you to enable / disable features which can help you debug
34df3e764dSLuis Chamberlain	  modules. You don't need these options on production systems.
35df3e764dSLuis Chamberlain
36df3e764dSLuis Chamberlainif MODULE_DEBUG
37df3e764dSLuis Chamberlain
38df3e764dSLuis Chamberlainconfig MODULE_STATS
39df3e764dSLuis Chamberlain	bool "Module statistics"
40df3e764dSLuis Chamberlain	depends on DEBUG_FS
41df3e764dSLuis Chamberlain	select MODULE_DEBUGFS
42df3e764dSLuis Chamberlain	help
43df3e764dSLuis Chamberlain	  This option allows you to maintain a record of module statistics.
44df3e764dSLuis Chamberlain	  For example, size of all modules, average size, text size, a list
45df3e764dSLuis Chamberlain	  of failed modules and the size for each of those. For failed
46df3e764dSLuis Chamberlain	  modules we keep track of modules which failed due to either the
47df3e764dSLuis Chamberlain	  existing module taking too long to load or that module was already
48df3e764dSLuis Chamberlain	  loaded.
49df3e764dSLuis Chamberlain
50df3e764dSLuis Chamberlain	  You should enable this if you are debugging production loads
51df3e764dSLuis Chamberlain	  and want to see if userspace or the kernel is doing stupid things
52df3e764dSLuis Chamberlain	  with loading modules when it shouldn't or if you want to help
53df3e764dSLuis Chamberlain	  optimize userspace / kernel space module autoloading schemes.
54df3e764dSLuis Chamberlain	  You might want to do this because failed modules tend to use
55df3e764dSLuis Chamberlain	  up significant amount of memory, and so you'd be doing everyone a
56df3e764dSLuis Chamberlain	  favor in avoiding these failures proactively.
57df3e764dSLuis Chamberlain
58df3e764dSLuis Chamberlain	  This functionality is also useful for those experimenting with
59df3e764dSLuis Chamberlain	  module .text ELF section optimization.
60df3e764dSLuis Chamberlain
61df3e764dSLuis Chamberlain	  If unsure, say N.
62df3e764dSLuis Chamberlain
638660484eSLuis Chamberlainconfig MODULE_DEBUG_AUTOLOAD_DUPS
648660484eSLuis Chamberlain	bool "Debug duplicate modules with auto-loading"
658660484eSLuis Chamberlain	help
668660484eSLuis Chamberlain	  Module autoloading allows in-kernel code to request modules through
678660484eSLuis Chamberlain	  the *request_module*() API calls. This in turn just calls userspace
688660484eSLuis Chamberlain	  modprobe. Although modprobe checks to see if a module is already
698660484eSLuis Chamberlain	  loaded before trying to load a module there is a small time window in
708660484eSLuis Chamberlain	  which multiple duplicate requests can end up in userspace and multiple
718660484eSLuis Chamberlain	  modprobe calls race calling finit_module() around the same time for
728660484eSLuis Chamberlain	  duplicate modules. The finit_module() system call can consume in the
738660484eSLuis Chamberlain	  worst case more than twice the respective module size in virtual
748660484eSLuis Chamberlain	  memory for each duplicate module requests. Although duplicate module
758660484eSLuis Chamberlain	  requests are non-fatal virtual memory is a limited resource and each
768660484eSLuis Chamberlain	  duplicate module request ends up just unnecessarily straining virtual
778660484eSLuis Chamberlain	  memory.
788660484eSLuis Chamberlain
798660484eSLuis Chamberlain	  This debugging facility will create pr_warn() splats for duplicate
808660484eSLuis Chamberlain	  module requests to help identify if module auto-loading may be the
818660484eSLuis Chamberlain	  culprit to your early boot virtual memory pressure. Since virtual
828660484eSLuis Chamberlain	  memory abuse caused by duplicate module requests could render a
838660484eSLuis Chamberlain	  system unusable this functionality will also converge races in
848660484eSLuis Chamberlain	  requests for the same module to a single request. You can boot with
858660484eSLuis Chamberlain	  the module.enable_dups_trace=1 kernel parameter to use WARN_ON()
868660484eSLuis Chamberlain	  instead of the pr_warn().
878660484eSLuis Chamberlain
888660484eSLuis Chamberlain	  If the first module request used request_module_nowait() we cannot
898660484eSLuis Chamberlain	  use that as the anchor to wait for duplicate module requests, since
908660484eSLuis Chamberlain	  users of request_module() do want a proper return value. If a call
918660484eSLuis Chamberlain	  for the same module happened earlier with request_module() though,
928660484eSLuis Chamberlain	  then a duplicate request_module_nowait() would be detected. The
938660484eSLuis Chamberlain	  non-wait request_module() call is synchronous and waits until modprobe
948660484eSLuis Chamberlain	  completes. Subsequent auto-loading requests for the same module do
958660484eSLuis Chamberlain	  not trigger a new finit_module() calls and do not strain virtual
968660484eSLuis Chamberlain	  memory, and so as soon as modprobe successfully completes we remove
978660484eSLuis Chamberlain	  tracking for duplicates for that module.
988660484eSLuis Chamberlain
998660484eSLuis Chamberlain	  Enable this functionality to try to debug virtual memory abuse during
1008660484eSLuis Chamberlain	  boot on systems which are failing to boot or if you suspect you may be
1018660484eSLuis Chamberlain	  straining virtual memory during boot, and you want to identify if the
1028660484eSLuis Chamberlain	  abuse was due to module auto-loading. These issues are currently only
1038660484eSLuis Chamberlain	  known to occur on systems with many CPUs (over 400) and is likely the
1048660484eSLuis Chamberlain	  result of udev issuing duplicate module requests for each CPU, and so
1058660484eSLuis Chamberlain	  module auto-loading is not the culprit. There may very well still be
1068660484eSLuis Chamberlain	  many duplicate module auto-loading requests which could be optimized
1078660484eSLuis Chamberlain	  for and this debugging facility can be used to help identify them.
1088660484eSLuis Chamberlain
1098660484eSLuis Chamberlain	  Only enable this for debugging system functionality, never have it
1108660484eSLuis Chamberlain	  enabled on real systems.
1118660484eSLuis Chamberlain
1128660484eSLuis Chamberlainconfig MODULE_DEBUG_AUTOLOAD_DUPS_TRACE
1138660484eSLuis Chamberlain	bool "Force full stack trace when duplicates are found"
1148660484eSLuis Chamberlain	depends on MODULE_DEBUG_AUTOLOAD_DUPS
1158660484eSLuis Chamberlain	help
1168660484eSLuis Chamberlain	  Enabling this will force a full stack trace for duplicate module
1178660484eSLuis Chamberlain	  auto-loading requests using WARN_ON() instead of pr_warn(). You
1188660484eSLuis Chamberlain	  should keep this disabled at all times unless you are a developer
1198660484eSLuis Chamberlain	  and are doing a manual inspection and want to debug exactly why
1208660484eSLuis Chamberlain	  these duplicates occur.
1218660484eSLuis Chamberlain
122df3e764dSLuis Chamberlainendif # MODULE_DEBUG
123df3e764dSLuis Chamberlain
12473b4fc92SChristophe Leroyconfig MODULE_FORCE_LOAD
12573b4fc92SChristophe Leroy	bool "Forced module loading"
12673b4fc92SChristophe Leroy	default n
12773b4fc92SChristophe Leroy	help
12873b4fc92SChristophe Leroy	  Allow loading of modules without version information (ie. modprobe
12973b4fc92SChristophe Leroy	  --force).  Forced module loading sets the 'F' (forced) taint flag and
13073b4fc92SChristophe Leroy	  is usually a really bad idea.
13173b4fc92SChristophe Leroy
13273b4fc92SChristophe Leroyconfig MODULE_UNLOAD
13373b4fc92SChristophe Leroy	bool "Module unloading"
13473b4fc92SChristophe Leroy	help
13573b4fc92SChristophe Leroy	  Without this option you will not be able to unload any
13673b4fc92SChristophe Leroy	  modules (note that some modules may not be unloadable
13773b4fc92SChristophe Leroy	  anyway), which makes your kernel smaller, faster
13873b4fc92SChristophe Leroy	  and simpler.  If unsure, say Y.
13973b4fc92SChristophe Leroy
14073b4fc92SChristophe Leroyconfig MODULE_FORCE_UNLOAD
14173b4fc92SChristophe Leroy	bool "Forced module unloading"
14273b4fc92SChristophe Leroy	depends on MODULE_UNLOAD
14373b4fc92SChristophe Leroy	help
14473b4fc92SChristophe Leroy	  This option allows you to force a module to unload, even if the
14573b4fc92SChristophe Leroy	  kernel believes it is unsafe: the kernel will remove the module
14673b4fc92SChristophe Leroy	  without waiting for anyone to stop using it (using the -f option to
14773b4fc92SChristophe Leroy	  rmmod).  This is mainly for kernel developers and desperate users.
14873b4fc92SChristophe Leroy	  If unsure, say N.
14973b4fc92SChristophe Leroy
15073b4fc92SChristophe Leroyconfig MODULE_UNLOAD_TAINT_TRACKING
15173b4fc92SChristophe Leroy	bool "Tainted module unload tracking"
15273b4fc92SChristophe Leroy	depends on MODULE_UNLOAD
153df3e764dSLuis Chamberlain	select MODULE_DEBUGFS
15473b4fc92SChristophe Leroy	help
15573b4fc92SChristophe Leroy	  This option allows you to maintain a record of each unloaded
15673b4fc92SChristophe Leroy	  module that tainted the kernel. In addition to displaying a
15773b4fc92SChristophe Leroy	  list of linked (or loaded) modules e.g. on detection of a bad
15873b4fc92SChristophe Leroy	  page (see bad_page()), the aforementioned details are also
15973b4fc92SChristophe Leroy	  shown. If unsure, say N.
16073b4fc92SChristophe Leroy
16173b4fc92SChristophe Leroyconfig MODVERSIONS
16273b4fc92SChristophe Leroy	bool "Module versioning support"
1631f9c4a99SLinus Torvalds	depends on !COMPILE_TEST
16473b4fc92SChristophe Leroy	help
16573b4fc92SChristophe Leroy	  Usually, you have to use modules compiled with your kernel.
16673b4fc92SChristophe Leroy	  Saying Y here makes it sometimes possible to use modules
16773b4fc92SChristophe Leroy	  compiled for different kernels, by adding enough information
16873b4fc92SChristophe Leroy	  to the modules to (hopefully) spot any changes which would
16973b4fc92SChristophe Leroy	  make them incompatible with the kernel you are running.  If
17073b4fc92SChristophe Leroy	  unsure, say N.
17173b4fc92SChristophe Leroy
1729c3681f9SSami Tolvanenchoice
1739c3681f9SSami Tolvanen	prompt "Module versioning implementation"
1749c3681f9SSami Tolvanen	depends on MODVERSIONS
1759c3681f9SSami Tolvanen	help
1769c3681f9SSami Tolvanen	  Select the tool used to calculate symbol versions for modules.
1779c3681f9SSami Tolvanen
1789c3681f9SSami Tolvanen	  If unsure, select GENKSYMS.
1799c3681f9SSami Tolvanen
1809c3681f9SSami Tolvanenconfig GENKSYMS
1819c3681f9SSami Tolvanen	bool "genksyms (from source code)"
1829c3681f9SSami Tolvanen	help
1839c3681f9SSami Tolvanen	  Calculate symbol versions from pre-processed source code using
1849c3681f9SSami Tolvanen	  genksyms.
1859c3681f9SSami Tolvanen
1869c3681f9SSami Tolvanen	  If unsure, say Y.
1879c3681f9SSami Tolvanen
188f2856884SSami Tolvanenconfig GENDWARFKSYMS
189f2856884SSami Tolvanen	bool "gendwarfksyms (from debugging information)"
190f2856884SSami Tolvanen	depends on DEBUG_INFO
191f2856884SSami Tolvanen	# Requires full debugging information, split DWARF not supported.
192f2856884SSami Tolvanen	depends on !DEBUG_INFO_REDUCED && !DEBUG_INFO_SPLIT
193f2856884SSami Tolvanen	# Requires ELF object files.
194f2856884SSami Tolvanen	depends on !LTO
1959c3681f9SSami Tolvanen	help
1969c3681f9SSami Tolvanen	  Calculate symbol versions from DWARF debugging information using
1979c3681f9SSami Tolvanen	  gendwarfksyms. Requires DEBUG_INFO to be enabled.
1989c3681f9SSami Tolvanen
1999c3681f9SSami Tolvanen	  If unsure, say N.
2009c3681f9SSami Tolvanenendchoice
201f2856884SSami Tolvanen
20273b4fc92SChristophe Leroyconfig ASM_MODVERSIONS
20373b4fc92SChristophe Leroy	bool
20473b4fc92SChristophe Leroy	default HAVE_ASM_MODVERSIONS && MODVERSIONS
20573b4fc92SChristophe Leroy	help
20673b4fc92SChristophe Leroy	  This enables module versioning for exported symbols also from
20773b4fc92SChristophe Leroy	  assembly. This can be enabled only when the target architecture
20873b4fc92SChristophe Leroy	  supports it.
20973b4fc92SChristophe Leroy
210*fc7d5e32SMatthew Maurerconfig EXTENDED_MODVERSIONS
211*fc7d5e32SMatthew Maurer	bool "Extended Module Versioning Support"
212*fc7d5e32SMatthew Maurer	depends on MODVERSIONS
213*fc7d5e32SMatthew Maurer	help
214*fc7d5e32SMatthew Maurer	  This enables extended MODVERSIONs support, allowing long symbol
215*fc7d5e32SMatthew Maurer	  names to be versioned.
216*fc7d5e32SMatthew Maurer
217*fc7d5e32SMatthew Maurer	  The most likely reason you would enable this is to enable Rust
218*fc7d5e32SMatthew Maurer	  support. If unsure, say N.
219*fc7d5e32SMatthew Maurer
22073b4fc92SChristophe Leroyconfig MODULE_SRCVERSION_ALL
22173b4fc92SChristophe Leroy	bool "Source checksum for all modules"
22273b4fc92SChristophe Leroy	help
22373b4fc92SChristophe Leroy	  Modules which contain a MODULE_VERSION get an extra "srcversion"
22473b4fc92SChristophe Leroy	  field inserted into their modinfo section, which contains a
22573b4fc92SChristophe Leroy	  sum of the source files which made it.  This helps maintainers
22673b4fc92SChristophe Leroy	  see exactly which source was used to build a module (since
22773b4fc92SChristophe Leroy	  others sometimes change the module source without updating
22873b4fc92SChristophe Leroy	  the version).  With this option, such a "srcversion" field
22973b4fc92SChristophe Leroy	  will be created for all modules.  If unsure, say N.
23073b4fc92SChristophe Leroy
23173b4fc92SChristophe Leroyconfig MODULE_SIG
23273b4fc92SChristophe Leroy	bool "Module signature verification"
23373b4fc92SChristophe Leroy	select MODULE_SIG_FORMAT
23473b4fc92SChristophe Leroy	help
23573b4fc92SChristophe Leroy	  Check modules for valid signatures upon load: the signature
23673b4fc92SChristophe Leroy	  is simply appended to the module. For more information see
23773b4fc92SChristophe Leroy	  <file:Documentation/admin-guide/module-signing.rst>.
23873b4fc92SChristophe Leroy
23973b4fc92SChristophe Leroy	  Note that this option adds the OpenSSL development packages as a
24073b4fc92SChristophe Leroy	  kernel build dependency so that the signing tool can use its crypto
24173b4fc92SChristophe Leroy	  library.
24273b4fc92SChristophe Leroy
24373b4fc92SChristophe Leroy	  You should enable this option if you wish to use either
24473b4fc92SChristophe Leroy	  CONFIG_SECURITY_LOCKDOWN_LSM or lockdown functionality imposed via
24573b4fc92SChristophe Leroy	  another LSM - otherwise unsigned modules will be loadable regardless
24673b4fc92SChristophe Leroy	  of the lockdown policy.
24773b4fc92SChristophe Leroy
24873b4fc92SChristophe Leroy	  !!!WARNING!!!  If you enable this option, you MUST make sure that the
24973b4fc92SChristophe Leroy	  module DOES NOT get stripped after being signed.  This includes the
25073b4fc92SChristophe Leroy	  debuginfo strip done by some packagers (such as rpmbuild) and
25173b4fc92SChristophe Leroy	  inclusion into an initramfs that wants the module size reduced.
25273b4fc92SChristophe Leroy
25373b4fc92SChristophe Leroyconfig MODULE_SIG_FORCE
25473b4fc92SChristophe Leroy	bool "Require modules to be validly signed"
25573b4fc92SChristophe Leroy	depends on MODULE_SIG
25673b4fc92SChristophe Leroy	help
25773b4fc92SChristophe Leroy	  Reject unsigned modules or signed modules for which we don't have a
25873b4fc92SChristophe Leroy	  key.  Without this, such modules will simply taint the kernel.
25973b4fc92SChristophe Leroy
26073b4fc92SChristophe Leroyconfig MODULE_SIG_ALL
26173b4fc92SChristophe Leroy	bool "Automatically sign all modules"
26273b4fc92SChristophe Leroy	default y
26373b4fc92SChristophe Leroy	depends on MODULE_SIG || IMA_APPRAISE_MODSIG
26473b4fc92SChristophe Leroy	help
26573b4fc92SChristophe Leroy	  Sign all modules during make modules_install. Without this option,
26673b4fc92SChristophe Leroy	  modules must be signed manually, using the scripts/sign-file tool.
26773b4fc92SChristophe Leroy
26873b4fc92SChristophe Leroycomment "Do not forget to sign required modules with scripts/sign-file"
26973b4fc92SChristophe Leroy	depends on MODULE_SIG_FORCE && !MODULE_SIG_ALL
27073b4fc92SChristophe Leroy
27173b4fc92SChristophe Leroychoice
272f94ce04eSPetr Pavlu	prompt "Hash algorithm to sign modules"
27373b4fc92SChristophe Leroy	depends on MODULE_SIG || IMA_APPRAISE_MODSIG
27473b4fc92SChristophe Leroy	help
27573b4fc92SChristophe Leroy	  This determines which sort of hashing algorithm will be used during
27673b4fc92SChristophe Leroy	  signature generation.  This algorithm _must_ be built into the kernel
27773b4fc92SChristophe Leroy	  directly so that signature verification can take place.  It is not
27873b4fc92SChristophe Leroy	  possible to load a signed module containing the algorithm to check
27973b4fc92SChristophe Leroy	  the signature on that module.
28073b4fc92SChristophe Leroy
281203a6763SEric Biggersconfig MODULE_SIG_SHA1
282f94ce04eSPetr Pavlu	bool "SHA-1"
283203a6763SEric Biggers	select CRYPTO_SHA1
284203a6763SEric Biggers
28573b4fc92SChristophe Leroyconfig MODULE_SIG_SHA256
286f94ce04eSPetr Pavlu	bool "SHA-256"
28773b4fc92SChristophe Leroy	select CRYPTO_SHA256
28873b4fc92SChristophe Leroy
28973b4fc92SChristophe Leroyconfig MODULE_SIG_SHA384
290f94ce04eSPetr Pavlu	bool "SHA-384"
29173b4fc92SChristophe Leroy	select CRYPTO_SHA512
29273b4fc92SChristophe Leroy
29373b4fc92SChristophe Leroyconfig MODULE_SIG_SHA512
294f94ce04eSPetr Pavlu	bool "SHA-512"
29573b4fc92SChristophe Leroy	select CRYPTO_SHA512
29673b4fc92SChristophe Leroy
297446b1e0bSDimitri John Ledkovconfig MODULE_SIG_SHA3_256
298f94ce04eSPetr Pavlu	bool "SHA3-256"
299446b1e0bSDimitri John Ledkov	select CRYPTO_SHA3
300446b1e0bSDimitri John Ledkov
301446b1e0bSDimitri John Ledkovconfig MODULE_SIG_SHA3_384
302f94ce04eSPetr Pavlu	bool "SHA3-384"
303446b1e0bSDimitri John Ledkov	select CRYPTO_SHA3
304446b1e0bSDimitri John Ledkov
305446b1e0bSDimitri John Ledkovconfig MODULE_SIG_SHA3_512
306f94ce04eSPetr Pavlu	bool "SHA3-512"
307446b1e0bSDimitri John Ledkov	select CRYPTO_SHA3
308446b1e0bSDimitri John Ledkov
30973b4fc92SChristophe Leroyendchoice
31073b4fc92SChristophe Leroy
31173b4fc92SChristophe Leroyconfig MODULE_SIG_HASH
31273b4fc92SChristophe Leroy	string
31373b4fc92SChristophe Leroy	depends on MODULE_SIG || IMA_APPRAISE_MODSIG
314203a6763SEric Biggers	default "sha1" if MODULE_SIG_SHA1
31573b4fc92SChristophe Leroy	default "sha256" if MODULE_SIG_SHA256
31673b4fc92SChristophe Leroy	default "sha384" if MODULE_SIG_SHA384
31773b4fc92SChristophe Leroy	default "sha512" if MODULE_SIG_SHA512
318446b1e0bSDimitri John Ledkov	default "sha3-256" if MODULE_SIG_SHA3_256
319446b1e0bSDimitri John Ledkov	default "sha3-384" if MODULE_SIG_SHA3_384
320446b1e0bSDimitri John Ledkov	default "sha3-512" if MODULE_SIG_SHA3_512
32173b4fc92SChristophe Leroy
322c7ff693fSPetr Pavluconfig MODULE_COMPRESS
323c7ff693fSPetr Pavlu	bool "Module compression"
32473b4fc92SChristophe Leroy	help
325c7ff693fSPetr Pavlu	  Enable module compression to reduce on-disk size of module binaries.
32673b4fc92SChristophe Leroy	  This is fully compatible with signed modules.
32773b4fc92SChristophe Leroy
328c7ff693fSPetr Pavlu	  The tool used to work with modules needs to support the selected
329c7ff693fSPetr Pavlu	  compression type. kmod MAY support gzip, xz and zstd. Other tools
330c7ff693fSPetr Pavlu	  might have a limited selection of the supported types.
33173b4fc92SChristophe Leroy
332c7ff693fSPetr Pavlu	  Note that for modules inside an initrd or initramfs, it's more
333c7ff693fSPetr Pavlu	  efficient to compress the whole ramdisk instead.
33473b4fc92SChristophe Leroy
335c7ff693fSPetr Pavlu	  If unsure, say N.
33673b4fc92SChristophe Leroy
337c7ff693fSPetr Pavluchoice
338c7ff693fSPetr Pavlu	prompt "Module compression type"
339c7ff693fSPetr Pavlu	depends on MODULE_COMPRESS
34073b4fc92SChristophe Leroy	help
341c7ff693fSPetr Pavlu	  Choose the supported algorithm for module compression.
34273b4fc92SChristophe Leroy
34373b4fc92SChristophe Leroyconfig MODULE_COMPRESS_GZIP
34473b4fc92SChristophe Leroy	bool "GZIP"
34573b4fc92SChristophe Leroy	help
346c7ff693fSPetr Pavlu	  Support modules compressed with GZIP. The installed modules are
347c7ff693fSPetr Pavlu	  suffixed with .ko.gz.
34873b4fc92SChristophe Leroy
34973b4fc92SChristophe Leroyconfig MODULE_COMPRESS_XZ
35073b4fc92SChristophe Leroy	bool "XZ"
35173b4fc92SChristophe Leroy	help
352c7ff693fSPetr Pavlu	  Support modules compressed with XZ. The installed modules are
353c7ff693fSPetr Pavlu	  suffixed with .ko.xz.
35473b4fc92SChristophe Leroy
35573b4fc92SChristophe Leroyconfig MODULE_COMPRESS_ZSTD
35673b4fc92SChristophe Leroy	bool "ZSTD"
35773b4fc92SChristophe Leroy	help
358c7ff693fSPetr Pavlu	  Support modules compressed with ZSTD. The installed modules are
359c7ff693fSPetr Pavlu	  suffixed with .ko.zst.
36073b4fc92SChristophe Leroy
36173b4fc92SChristophe Leroyendchoice
36273b4fc92SChristophe Leroy
363c7ff693fSPetr Pavluconfig MODULE_COMPRESS_ALL
364c7ff693fSPetr Pavlu	bool "Automatically compress all modules"
365c7ff693fSPetr Pavlu	default y
366c7ff693fSPetr Pavlu	depends on MODULE_COMPRESS
367c7ff693fSPetr Pavlu	help
368c7ff693fSPetr Pavlu	  Compress all modules during 'make modules_install'.
369c7ff693fSPetr Pavlu
370c7ff693fSPetr Pavlu	  Your build system needs to provide the appropriate compression tool
371c7ff693fSPetr Pavlu	  for the selected compression type. External modules will also be
372c7ff693fSPetr Pavlu	  compressed in the same way during the installation.
373c7ff693fSPetr Pavlu
37473b4fc92SChristophe Leroyconfig MODULE_DECOMPRESS
37573b4fc92SChristophe Leroy	bool "Support in-kernel module decompression"
376c7ff693fSPetr Pavlu	depends on MODULE_COMPRESS
37773b4fc92SChristophe Leroy	select ZLIB_INFLATE if MODULE_COMPRESS_GZIP
37873b4fc92SChristophe Leroy	select XZ_DEC if MODULE_COMPRESS_XZ
379169a58adSStephen Boyd	select ZSTD_DECOMPRESS if MODULE_COMPRESS_ZSTD
38073b4fc92SChristophe Leroy	help
38173b4fc92SChristophe Leroy	  Support for decompressing kernel modules by the kernel itself
38273b4fc92SChristophe Leroy	  instead of relying on userspace to perform this task. Useful when
38373b4fc92SChristophe Leroy	  load pinning security policy is enabled.
38473b4fc92SChristophe Leroy
38573b4fc92SChristophe Leroy	  If unsure, say N.
38673b4fc92SChristophe Leroy
38773b4fc92SChristophe Leroyconfig MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
38873b4fc92SChristophe Leroy	bool "Allow loading of modules with missing namespace imports"
38973b4fc92SChristophe Leroy	help
39073b4fc92SChristophe Leroy	  Symbols exported with EXPORT_SYMBOL_NS*() are considered exported in
39173b4fc92SChristophe Leroy	  a namespace. A module that makes use of a symbol exported with such a
392cdd30ebbSPeter Zijlstra	  namespace is required to import the namespace via MODULE_IMPORT_NS("").
39373b4fc92SChristophe Leroy	  There is no technical reason to enforce correct namespace imports,
39473b4fc92SChristophe Leroy	  but it creates consistency between symbols defining namespaces and
39573b4fc92SChristophe Leroy	  users importing namespaces they make use of. This option relaxes this
39673b4fc92SChristophe Leroy	  requirement and lifts the enforcement when loading a module.
39773b4fc92SChristophe Leroy
39873b4fc92SChristophe Leroy	  If unsure, say N.
39973b4fc92SChristophe Leroy
40073b4fc92SChristophe Leroyconfig MODPROBE_PATH
40173b4fc92SChristophe Leroy	string "Path to modprobe binary"
40273b4fc92SChristophe Leroy	default "/sbin/modprobe"
40373b4fc92SChristophe Leroy	help
40473b4fc92SChristophe Leroy	  When kernel code requests a module, it does so by calling
40573b4fc92SChristophe Leroy	  the "modprobe" userspace utility. This option allows you to
40673b4fc92SChristophe Leroy	  set the path where that binary is found. This can be changed
40773b4fc92SChristophe Leroy	  at runtime via the sysctl file
40873b4fc92SChristophe Leroy	  /proc/sys/kernel/modprobe. Setting this to the empty string
40973b4fc92SChristophe Leroy	  removes the kernel's ability to request modules (but
41073b4fc92SChristophe Leroy	  userspace can still load modules explicitly).
41173b4fc92SChristophe Leroy
41273b4fc92SChristophe Leroyconfig TRIM_UNUSED_KSYMS
413d2d5cba5SMasahiro Yamada	bool "Trim unused exported kernel symbols"
41473b4fc92SChristophe Leroy	help
41573b4fc92SChristophe Leroy	  The kernel and some modules make many symbols available for
41673b4fc92SChristophe Leroy	  other modules to use via EXPORT_SYMBOL() and variants. Depending
41773b4fc92SChristophe Leroy	  on the set of modules being selected in your kernel configuration,
41873b4fc92SChristophe Leroy	  many of those exported symbols might never be used.
41973b4fc92SChristophe Leroy
42073b4fc92SChristophe Leroy	  This option allows for unused exported symbols to be dropped from
42173b4fc92SChristophe Leroy	  the build. In turn, this provides the compiler more opportunities
42273b4fc92SChristophe Leroy	  (especially when using LTO) for optimizing the code and reducing
42373b4fc92SChristophe Leroy	  binary size.  This might have some security advantages as well.
42473b4fc92SChristophe Leroy
42573b4fc92SChristophe Leroy	  If unsure, or if you need to build out-of-tree modules, say N.
42673b4fc92SChristophe Leroy
42773b4fc92SChristophe Leroyconfig UNUSED_KSYMS_WHITELIST
42873b4fc92SChristophe Leroy	string "Whitelist of symbols to keep in ksymtab"
42973b4fc92SChristophe Leroy	depends on TRIM_UNUSED_KSYMS
43073b4fc92SChristophe Leroy	help
43173b4fc92SChristophe Leroy	  By default, all unused exported symbols will be un-exported from the
43273b4fc92SChristophe Leroy	  build when TRIM_UNUSED_KSYMS is selected.
43373b4fc92SChristophe Leroy
43473b4fc92SChristophe Leroy	  UNUSED_KSYMS_WHITELIST allows to whitelist symbols that must be kept
43573b4fc92SChristophe Leroy	  exported at all times, even in absence of in-tree users. The value to
43673b4fc92SChristophe Leroy	  set here is the path to a text file containing the list of symbols,
43773b4fc92SChristophe Leroy	  one per line. The path can be absolute, or relative to the kernel
4388d0b7288SYifan Hong	  source or obj tree.
43973b4fc92SChristophe Leroy
44073b4fc92SChristophe Leroyconfig MODULES_TREE_LOOKUP
44173b4fc92SChristophe Leroy	def_bool y
44273b4fc92SChristophe Leroy	depends on PERF_EVENTS || TRACING || CFI_CLANG
44373b4fc92SChristophe Leroy
44473b4fc92SChristophe Leroyendif # MODULES
445