Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4605183ybb; Tue, 14 Apr 2020 10:30:12 -0700 (PDT) X-Google-Smtp-Source: APiQypLySVq3dCk+mCGcsQMYETBoQW4RwYl8aR4WZm6j3KNkHhD0ZEXlkJcGGKXZ/L70qy+LlH4d X-Received: by 2002:a17:906:6a02:: with SMTP id o2mr1165010ejr.223.1586885412001; Tue, 14 Apr 2020 10:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586885411; cv=none; d=google.com; s=arc-20160816; b=fAMimEjiPTjhM+siuKIE3F7RvLq7xeQs4FgGYa+hQXnvpCrOc8RjmLd4A/OBFU8EDp FiwIZu33rLVhPwDV/U0sqbUV4ADg5BeL02IBIg456lUWr6UeIvS1EZTemkH2FjNjgQu6 KDgeDHcaMGWehjeMZiiPZ0kC6/a0CvnG/fQRPUDZU7SGEdAk8pQuM1jegVJZe2llNyOU BppWLqNanQAKV+/RAZNFsdqv/ke8h5hllzmlZfPJUaan56hLjLbzt3gW/ncT3f8bA5VF X+HsCabaKv7YJEihyJCGZqxJgs0G0xnfBaJ1FRW7v2VO967rLc68DUiVuCb7kQfdULER A/hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zHAnuxPl0MxO8Q75zSsUrJ+Yy5uFFc+UN8zhaur2WQs=; b=FZVnDZz0tT/jPlnco6+FZY/bU3IM7P9TcrPWOdp/le01yf1tvGU8x60kTR7B4wY6wq BGCGcwVppgkA3SHAegF/4MbcnQxuXlNfcW+5iU2PKtRm7QtBlcqurWmtuaKHT0ng80Nr wcYT1xf3Ojv6UxeTv88C8K2iGCBskl8EvhJlINKQPL8z0IHgYHNMNfm2vPtVeQPKmwVi hUvhdT7S/vsdTXZ7VIkZtRlj3lGfO3pDHiN6tTF6xNvVeD2w7ydLB8SxF5Ju/GfuECQX 6KNO7OkoTwxhkKB+7kdrFpcDOMQv+UtmP9jy0z6O9+wtWu7QKIbEU4Rac8v3ijW+N46Y e5rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y5CtSHAX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di18si814977edb.471.2020.04.14.10.29.47; Tue, 14 Apr 2020 10:30:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y5CtSHAX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407688AbgDNRZ7 (ORCPT + 99 others); Tue, 14 Apr 2020 13:25:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:59336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407592AbgDNRZx (ORCPT ); Tue, 14 Apr 2020 13:25:53 -0400 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D967320678; Tue, 14 Apr 2020 17:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586885152; bh=obYyiyTbGmR44FhMsbwJlUxtDZYky71vqYd2njr6jms=; h=From:To:Cc:Subject:Date:From; b=Y5CtSHAXmi8FxInllehx4Q+/hbJorGr7xHnJEh8OrwXaVDRqavymXWjcCkm1uru3O 1GABxm1dHwFsya56CHvjHERqBhyBAbPb6kTashCxR/FbdjwIwIrK+FOWZFQFIXCr0Z oWNdkiHpo0wqWoJxwya4QeXm9f+boK/NKm1jQzHs= From: Eric Biggers To: linux-doc@vger.kernel.org, Jonathan Corbet Cc: linux-kernel@vger.kernel.org, Stephen Kitt , Luis Chamberlain , NeilBrown , Jessica Yu , Andrew Morton Subject: [PATCH] docs: admin-guide: merge sections for the kernel.modprobe sysctl Date: Tue, 14 Apr 2020 10:24:30 -0700 Message-Id: <20200414172430.230293-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.26.0.110.g2183baf09c-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Biggers Documentation for the kernel.modprobe sysctl was added both by commit 0317c5371e6a ("docs: merge debugging-modules.txt into sysctl/kernel.rst") and by commit 6e7158250625 ("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 --- Jon, could you take this through the docs tree as a fix for 5.7? Documentation/admin-guide/sysctl/kernel.rst | 47 +++++++++------------ 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst index 39c95c0e13d30..0d427fd109419 100644 --- a/Documentation/admin-guide/sysctl/kernel.rst +++ b/Documentation/admin-guide/sysctl/kernel.rst @@ -390,9 +390,17 @@ When ``kptr_restrict`` is set to 2, kernel pointers printed using modprobe ======== -This gives the full path of the modprobe command which the kernel will -use to load modules. This can be used to debug module loading -requests:: +The full path to the usermode helper for autoloading kernel modules, +by default "/sbin/modprobe". This binary is executed when the kernel +requests a module. For example, if userspace passes an unknown +filesystem type to mount(), then the kernel will automatically request +the corresponding filesystem module by executing this usermode helper. +This usermode helper should insert the needed module into the kernel. + +This sysctl only affects module autoloading. It has no effect on the +ability to explicitly insert modules. + +This sysctl can be used to debug module loading requests:: echo '#! /bin/sh' > /tmp/modprobe echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe @@ -400,10 +408,15 @@ requests:: chmod a+x /tmp/modprobe echo /tmp/modprobe > /proc/sys/kernel/modprobe -This only applies when the *kernel* is requesting that the module be -loaded; it won't have any effect if the module is being loaded -explicitly using ``modprobe`` from userspace. +Alternatively, if this sysctl is set to the empty string, then module +autoloading is completely disabled. The kernel will not try to +execute a usermode helper at all, nor will it call the +kernel_module_request LSM hook. +If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration, +then the configured static usermode helper overrides this sysctl, +except that the empty string is still accepted to completely disable +module autoloading as described above. modules_disabled ================ @@ -446,28 +459,6 @@ Notes: successful IPC object allocation. If an IPC object allocation syscall fails, it is undefined if the value remains unmodified or is reset to -1. -modprobe: -========= - -The path to the usermode helper for autoloading kernel modules, by -default "/sbin/modprobe". This binary is executed when the kernel -requests a module. For example, if userspace passes an unknown -filesystem type to mount(), then the kernel will automatically request -the corresponding filesystem module by executing this usermode helper. -This usermode helper should insert the needed module into the kernel. - -This sysctl only affects module autoloading. It has no effect on the -ability to explicitly insert modules. - -If this sysctl is set to the empty string, then module autoloading is -completely disabled. The kernel will not try to execute a usermode -helper at all, nor will it call the kernel_module_request LSM hook. - -If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration, -then the configured static usermode helper overrides this sysctl, -except that the empty string is still accepted to completely disable -module autoloading as described above. - nmi_watchdog ============ -- 2.26.0.110.g2183baf09c-goog