Skip to content

Commit 52338df

Browse files
ebiggersJonathan Corbet
authored andcommitted
docs: admin-guide: merge sections for the kernel.modprobe sysctl
Documentation for the kernel.modprobe sysctl was added both by commit 0317c53 ("docs: merge debugging-modules.txt into sysctl/kernel.rst") and by commit 6e71582 ("docs: admin-guide: document the kernel.modprobe sysctl"), resulting in the same sysctl being documented in two places. Merge these into one place. Signed-off-by: Eric Biggers <[email protected]> Reviewed-by: Stephen Kitt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Corbet <[email protected]>
1 parent 404e603 commit 52338df

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -390,20 +390,33 @@ When ``kptr_restrict`` is set to 2, kernel pointers printed using
390390
modprobe
391391
========
392392

393-
This gives the full path of the modprobe command which the kernel will
394-
use to load modules. This can be used to debug module loading
395-
requests::
393+
The full path to the usermode helper for autoloading kernel modules,
394+
by default "/sbin/modprobe". This binary is executed when the kernel
395+
requests a module. For example, if userspace passes an unknown
396+
filesystem type to mount(), then the kernel will automatically request
397+
the corresponding filesystem module by executing this usermode helper.
398+
This usermode helper should insert the needed module into the kernel.
399+
400+
This sysctl only affects module autoloading. It has no effect on the
401+
ability to explicitly insert modules.
402+
403+
This sysctl can be used to debug module loading requests::
396404

397405
echo '#! /bin/sh' > /tmp/modprobe
398406
echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe
399407
echo 'exec /sbin/modprobe "$@"' >> /tmp/modprobe
400408
chmod a+x /tmp/modprobe
401409
echo /tmp/modprobe > /proc/sys/kernel/modprobe
402410

403-
This only applies when the *kernel* is requesting that the module be
404-
loaded; it won't have any effect if the module is being loaded
405-
explicitly using ``modprobe`` from userspace.
411+
Alternatively, if this sysctl is set to the empty string, then module
412+
autoloading is completely disabled. The kernel will not try to
413+
execute a usermode helper at all, nor will it call the
414+
kernel_module_request LSM hook.
406415

416+
If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration,
417+
then the configured static usermode helper overrides this sysctl,
418+
except that the empty string is still accepted to completely disable
419+
module autoloading as described above.
407420

408421
modules_disabled
409422
================
@@ -446,28 +459,6 @@ Notes:
446459
successful IPC object allocation. If an IPC object allocation syscall
447460
fails, it is undefined if the value remains unmodified or is reset to -1.
448461

449-
modprobe:
450-
=========
451-
452-
The path to the usermode helper for autoloading kernel modules, by
453-
default "/sbin/modprobe". This binary is executed when the kernel
454-
requests a module. For example, if userspace passes an unknown
455-
filesystem type to mount(), then the kernel will automatically request
456-
the corresponding filesystem module by executing this usermode helper.
457-
This usermode helper should insert the needed module into the kernel.
458-
459-
This sysctl only affects module autoloading. It has no effect on the
460-
ability to explicitly insert modules.
461-
462-
If this sysctl is set to the empty string, then module autoloading is
463-
completely disabled. The kernel will not try to execute a usermode
464-
helper at all, nor will it call the kernel_module_request LSM hook.
465-
466-
If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration,
467-
then the configured static usermode helper overrides this sysctl,
468-
except that the empty string is still accepted to completely disable
469-
module autoloading as described above.
470-
471462
nmi_watchdog
472463
============
473464

0 commit comments

Comments
 (0)