From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC3503A5E9B for ; Fri, 5 Jun 2026 18:25:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780683926; cv=none; b=LI1fMr7q0HlddOmqEcYgzxyMD/dHD1IwerVMpdUzza+9t0+sHEUYxIWPNVVO5byK2U7oHfKO/sySddFaQ5xAdwK9WatJRKuCNUsxOQ7VNI8t5o/AxNCIX/CIJ3+OYY93LNrlb3+cgKv6l+a3pciUljennsY7hBLWL3KmexsbICY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780683926; c=relaxed/simple; bh=ODQinMMdxsaY6RL0hYX0pZOFbL9zrSNm1pmSWChLaA4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T0dZuDTD4XDDinD0igbN0+CN3Xm0VvCTUgnsebIdoW7bYnEUXW8eE09VILlW/Pvv3hmDzJlkYqZ65+wkObsZuuXpzUG//80MQakDo6VMc8KKG6/WpHTNwkv6Hc59WMWJgQGvi+LnlS2yhLBmcSibkuSUvLusO5CeXYlI+cC2jX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=iiuICafn; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iiuICafn" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2bf2911f93cso117265ad.1 for ; Fri, 05 Jun 2026 11:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780683923; x=1781288723; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6t9Y3TUDX8gOECAz6pcChptmfsUqRuuX+pFwbulAEyA=; b=iiuICafnvH8RuQx0+dpLIBD9tvUC6/HmIb6q3PxVV3k7YDOLj+eAWZ1mShsgSHs6gc MLmStcZp6Z12piph3rME9XGOsVwTXUIVpgWMCcn0cJnFP4MDljuwT6XGfFnf6q0cihs+ oljC4fV43Sid9Fk+C16048vY/jeLcKKMylyKNBQLU8vCdOJVdPN5d5gGa/HyFlIJnaDb +t0jMctZtQq+6FpG3vnM8nw5EQ5Ibd08kiVZWfFlozdfjsCskii1zHWArZjTADziJiWl OyXE/w7tdV2JrybeYlU7AmzoTQP1woikGJZxGwnHeQR5n38StKIZAnsnyir/YROuAOBo YVGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780683923; x=1781288723; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6t9Y3TUDX8gOECAz6pcChptmfsUqRuuX+pFwbulAEyA=; b=eALxzCJgS0dsDUlv/UgXOw7zuP+HRf2PJYJq2VRo3KTiiIU9ehMtmtYlzXtvqpuIV3 M2JTiHTKKwL+bHFZ+PwNkAsI4txCEMVsZZaQaq5qzJVAwom8UkJU3iDjAO2jVaFIiRkE Wc3dg9HHBnSAzuT2ZVNQESqe+P+M4yazCXZkn8hTWv3vp8Trb04dnDn1+uIMI/rxwSce oFIJkMdAbo+M+iZFHlQWnNXIWLUHm9inMGSy7c/ymTwJkht85pswpX9t47BEhTcIq7gq B8IdCu2Qde72fcurJZaaaYs63mEpy/oi1KloKHu0cm1gS/xPCHiC/8EcBWyjCuI2aRm/ gd3Q== X-Forwarded-Encrypted: i=1; AFNElJ/QcbBH3CnZdScguUyN6x4OFajKZFilt9rwYgh1yR5XFW/j0wXYSIjVCtzWxSF2ko3vbg7aYmk2mDjj0UI=@vger.kernel.org X-Gm-Message-State: AOJu0YwrrD0BpyIzeRCrziFMrv0m9vzjvKWB1ZuViCNL6KF5yYuX+xu+ sThYMsP3SK2GUB41MFVQHZ2BTs9jpUgOBtqmSFPxtCObi6L2WBfYAnZgyectXbxSww== X-Gm-Gg: Acq92OHs3K2/Qcu+2/XYFm8vGLOazM0T+rVrHTjGCvSeCBM88dt5Z4FKz/aaPD/nHBN UgmX83KUKociS3u//iDlBia0/Tm/ezmu42Wssjbj9BtxLyl1Dg59CKprL0ADD3/tiLbBEqqZCWz qc/fZawJjbFVar1wF3nJLtTpE+01Mg1WIvYLRZJEeGyuY5NfQh6TBGQbqNimvykhRI4Y358VgP7 wHeoLKAUv6eSFLQEwew7pWtmNtdvbA3JoFmluVijZbTp45w4sHYJ+Pu0FgaL94KYGwcPBrvD9Pf T16yFZucPIr/cQcLS6jGnclwWmdvMVQE4e37czVEgy3TXPpr1DMAZDlJT0n3Mx7AykW6XuEfSbQ tLDhaIxBvSfvZaUlNizccA90j4BgrN9E8+aCUiYC16MLCPvYqCDv2gNZ9oo3eG3sj1ld9NGdYn8 pDN2DM48A1nR5Rl0oGVNu2YtN5wkpymgZq/x5vj+me+7ejlLuL90OruTxkkQmgzxStnLwBcDnL/ 68eEQ== X-Received: by 2002:a17:902:e842:b0:2bd:6dad:3df9 with SMTP id d9443c01a7336-2c1eb744312mr2068635ad.23.1780683922744; Fri, 05 Jun 2026 11:25:22 -0700 (PDT) Received: from google.com (171.46.125.34.bc.googleusercontent.com. [34.125.46.171]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c164f6e86dsm100327885ad.8.2026.06.05.11.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2026 11:25:21 -0700 (PDT) Date: Fri, 5 Jun 2026 18:25:17 +0000 From: Sami Tolvanen To: Michal Gorlas Cc: Jonathan Corbet , Shuah Khan , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Aaron Tomlin , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org Subject: Re: [PATCH 1/2] module: add CONFIG_MODULE_RESTRICT_AUTOLOAD Message-ID: <20260605182517.GA2939956@google.com> References: <20260515-autoload_restrict-v1-0-40b7c03ddd04@9elements.com> <20260515-autoload_restrict-v1-1-40b7c03ddd04@9elements.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260515-autoload_restrict-v1-1-40b7c03ddd04@9elements.com> On Fri, May 15, 2026 at 07:20:19PM +0200, Michal Gorlas wrote: > Add CONFIG_MODULE_RESTRICT_AUTOLOAD and modrestrict parameter > documentation. > > Signed-off-by: Michal Gorlas > --- > Documentation/admin-guide/kernel-parameters.txt | 5 +++++ > kernel/module/Kconfig | 15 +++++++++++++++ > 2 files changed, 20 insertions(+) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 03a550630644..1013104f0943 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -4185,6 +4185,11 @@ Kernel parameters > For details see: > Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst > > + modrestrict= > + Control the restriction of module auto-loading to > + CAP_SYS_ADMIN. If no value is specified, this > + is set to the value of CONFIG_MODULE_RESTRICT_AUTOLOAD. Doesn't this default to true if no bool value is specified? It only uses the config if modrestrict is not passed to the kernel at all. > .async_probe[=] [KNL] > If no value is specified or if the value > specified is not a valid , enable asynchronous > diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig > index 43b1bb01fd27..c9e01bb848c0 100644 > --- a/kernel/module/Kconfig > +++ b/kernel/module/Kconfig > @@ -337,6 +337,21 @@ config MODULE_SIG_HASH > > endif # MODULE_SIG || IMA_APPRAISE_MODSIG > > +config MODULE_RESTRICT_AUTOLOAD > + bool "Restrict module auto-loading to privileged users" > + default n You don't need to specify default n here. Also, I think you can just squash the two patches. There's no benefit in splitting the config/documentation into a separate patch. Sami