From patchwork Wed Mar 18 23:05:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11446267 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5CA4192A for ; Wed, 18 Mar 2020 23:06:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BFA92076F for ; Wed, 18 Mar 2020 23:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584572798; bh=pyfoelTFUrUS8nqrG9mSLUHYjidpQeeIpDUHP53gjl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hrgDKCEzl7cqBiE1iud33ho4bqbDOLUqTQs+OvzRIa32XKlJqFnmDXwtdX4JH7B85 vVj7RCKBjRxc1ve3gM8O7ruT/CKq0Li6PXh5CUpC/LN57n919qZEBdbqQ8x/0FOb1G d5zABI4NGE0OIaRQcjj3lZLL+Rw3RJdp+aTV44lI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727446AbgCRXGg (ORCPT ); Wed, 18 Mar 2020 19:06:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:37532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbgCRXGP (ORCPT ); Wed, 18 Mar 2020 19:06:15 -0400 Received: from sol.hsd1.ca.comcast.net (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (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 C36EE20772; Wed, 18 Mar 2020 23:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584572775; bh=pyfoelTFUrUS8nqrG9mSLUHYjidpQeeIpDUHP53gjl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S8AP04gTBXOjxzF4km8U9zuui3lKYHUGGlBhXVxY7kAOk6pg/6g11nTfyqHxWFA8x W+cppg3wRVybvoenstFvJIaQeJsJg/jSf/ofDBk6rnTWoma3zxw5F8lX4YIEI8bWFg yzNOYEOVUsFday93oOH4XOBSxIYVnCzpay8/SqUE= From: Eric Biggers To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, Alexei Starovoitov , Andrew Morton , Greg Kroah-Hartman , Jeff Vander Stoep , Jessica Yu , Kees Cook , Luis Chamberlain , NeilBrown Subject: [PATCH v4 3/5] docs: admin-guide: document the kernel.modprobe sysctl Date: Wed, 18 Mar 2020 16:05:13 -0700 Message-Id: <20200318230515.171692-4-ebiggers@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200318230515.171692-1-ebiggers@kernel.org> References: <20200318230515.171692-1-ebiggers@kernel.org> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Eric Biggers Document the kernel.modprobe sysctl in the same place that all the other kernel.* sysctls are documented. Make sure to mention how to use this sysctl to completely disable module autoloading, and how this sysctl relates to CONFIG_STATIC_USERMODEHELPER. Cc: Alexei Starovoitov Cc: Andrew Morton Cc: Greg Kroah-Hartman Cc: Jeff Vander Stoep Cc: Jessica Yu Cc: Kees Cook Cc: Luis Chamberlain Cc: NeilBrown Signed-off-by: Eric Biggers --- Documentation/admin-guide/sysctl/kernel.rst | 25 ++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst index def074807cee9..e3c15660ee5d9 100644 --- a/Documentation/admin-guide/sysctl/kernel.rst +++ b/Documentation/admin-guide/sysctl/kernel.rst @@ -49,7 +49,7 @@ show up in /proc/sys/kernel: - kexec_load_disabled - kptr_restrict - l2cr [ PPC only ] -- modprobe ==> Documentation/debugging-modules.txt +- modprobe - modules_disabled - msg_next_id [ sysv ipc ] - msgmax @@ -444,6 +444,29 @@ l2cr: (PPC only) This flag controls the L2 cache of G3 processor boards. If 0, the cache is disabled. Enabled if nonzero. +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. + +Also see Documentation/debugging-modules.txt. modules_disabled: =================