From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 ED2883F077F for ; Tue, 9 Jun 2026 10:07:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780999634; cv=none; b=TqXFjS0kymQbu819P345buh0CGf+kh9QVuhwoZF7zK1MiLTpGUAmStjI/YkKhdy6zs32UFMYPllZUjfjrAjRJ1vwcYvwTY2oJQW+ccIPMhEexj/d0fY/2JVHa/dLYJwTv4bbETTik0a3Xewm+9meqU/JufP9rhhO3FZHDbkb9JU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780999634; c=relaxed/simple; bh=4C8PgQ9FE9L7n6/Z7yWqH9fic/Jpg5Q4xG+oktm/EO8=; h=Content-Type:Date:Message-Id:Cc:Subject:From:To:Mime-Version: References:In-Reply-To; b=AxYaFfG8iNRDSJBQV4MPiZkGJOA4l1WxDkqEQoEHNho8hDqxHxTtafu+H68Weus4VR9Ey39pzaIel6JSspiBVH9a7hz59osPVz4QOb9RzvQktN7metNBqeW4qmB4/vJQPlyJVFuR60O+AWIaUbNL58hk3zbrZ85YSKtw1rcrNBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=9elements.com; spf=pass smtp.mailfrom=9elements.com; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b=bdqaCboN; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=9elements.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=9elements.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b="bdqaCboN" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-490b613a17bso52311085e9.3 for ; Tue, 09 Jun 2026 03:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1780999629; x=1781604429; darn=vger.kernel.org; h=in-reply-to:references:mime-version:content-transfer-encoding:to :from:subject:cc:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=24+9tIBKRIB6Fi/lgC4G5fEyDREBkP8hCdRX4h9xXVU=; b=bdqaCboNeSqvPSJGLJTAX4qvk+8Zu3IV9qBSjIMyPqe9aFdw4uQaAFm5TIOks6fBZa 8eIn2+dwlfAshEneN4LYMBxNuzUBiFc7lc3/gJck4ldnCZlXZhrP7OvZbDWwZaj0MCDU C1xGRAGUWMQSULQ+UYoi/IdFRYhygaihCu858NsvtAiyCzJKSmavJU7fz3n9d3k8DVMQ 97YXLvisbgucwWtTxc1FfXJWhHQFZiiFG0twHyWsyGsLO0JAwGWppEyT39Q8/kXXNRcz 9e/0Hc6WzKJmVCrOu+RgCRX1VbUwKCpnuCwF0XYKlAcftM3S7jyGhHCAuNYO/oyatI54 l5Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780999629; x=1781604429; h=in-reply-to:references:mime-version:content-transfer-encoding:to :from:subject:cc:message-id:date:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=24+9tIBKRIB6Fi/lgC4G5fEyDREBkP8hCdRX4h9xXVU=; b=MAKiofOBqYHrD3ABvZkhzvso74drX0rZf2i+4SEme3les+S0GlD4wbhGSv432HE+2f 5ou28XKe+30KD4QSakuh12xsf9bzNochMa/xZbHR+BQd7vNp6cE1eGIKabzUcWsym3YH eVv1LnmF/kimvwdnoCaSi8+hbui9XD1YhvTNgt/e/HKRe/ae9FC/ehMG6dYr7UlNfDKe y6KCz6kK8ftwNziFNZEjvyjtIFC3zcfG6Vyi7Kw4BDaQpcmAk3wPYKOPDq0HAUzOz2CP mwoGjEOQJwp9SQnI3UuBVrM61f2m7B1H12353fhhlrbeF/FpMVvedfrIMxS+WIgiPUVP 5mag== X-Forwarded-Encrypted: i=1; AFNElJ/Zcv/AlDtbgPJhzzKdoSnvuxVvf87mEQzo8TQNK4splOu1u4sHCNV5QMSGzHRtb/WNT8HbbdaabG+YXUI=@vger.kernel.org X-Gm-Message-State: AOJu0Ywbl2HU5lk5T0PUnlYP8YsD1Nr25iLWHzW++VVIOGB9Kkrakr7D TB9ipg4dc6Sbgxg8aHt7kCkMvhPWkGFBWnFhgN364S4ENktGruJsLTJ14R27QmC03A== X-Gm-Gg: Acq92OHiWOYbbFg0SU8Gkr4m0XkPZjSeKbgNODB4Dz0ZkOfjZD/IJ9hoalzx8ao9CNW hQogX3fZw5HTXwtJyIvocF2fNnAVexfolQAFfBpqUZFofi1MDVKHXc0v3FfsPcEnklo/r138g6W spTNvUkERDe4qkEUhVVsaQfDzPqYO7p16Z2Mk16pRtc9uGYQKo1UbgjlRjkC/XDkwvza83kNBTM 87kKDiqG53TB1dHaaXvh9wy5FM5UQvsPZNoEX4sTCwxm9PyysAtlwJ81k6rlrQ20XSTDBrByV0S 6ShCOLRyzeKfQXtHavldcgB9svpIuGdAkyplQHoYVwPCCo40U6jK/tOIT/O1gKBB/QLoQVNLL0H Ms2ioDoIxeCCg95D5rDvz2UtHgDzU19X1l8y5U8T5piiW0wQmqI1aeAikMt7WZ2VeTmx5BJtbWi s5LLaN/3ADmqVHZS08UF+yBKTF5vXRADcH6Orsyv0= X-Received: by 2002:a05:600d:8444:20b0:490:48b7:c1ff with SMTP id 5b1f17b1804b1-490d72239damr17568855e9.17.1780999629113; Tue, 09 Jun 2026 03:07:09 -0700 (PDT) Received: from localhost ([188.111.3.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-46028a6dcbdsm49395986f8f.7.2026.06.09.03.07.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jun 2026 03:07:08 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 Date: Tue, 09 Jun 2026 12:07:07 +0200 Message-Id: Cc: "Jonathan Corbet" , "Shuah Khan" , "Luis Chamberlain" , "Petr Pavlu" , "Daniel Gomez" , "Aaron Tomlin" , , , Subject: Re: [PATCH 1/2] module: add CONFIG_MODULE_RESTRICT_AUTOLOAD From: "Michal Gorlas" To: "Sami Tolvanen" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: aerc 0.21.0 References: <20260515-autoload_restrict-v1-0-40b7c03ddd04@9elements.com> <20260515-autoload_restrict-v1-1-40b7c03ddd04@9elements.com> <20260605182517.GA2939956@google.com> In-Reply-To: <20260605182517.GA2939956@google.com> On Fri Jun 5, 2026 at 8:25 PM CEST, Sami Tolvanen wrote: > On Fri, May 15, 2026 at 07:20:19PM +0200, Michal Gorlas wrote: >> Add CONFIG_MODULE_RESTRICT_AUTOLOAD and modrestrict parameter >> documentation. >>=20 >> Signed-off-by: Michal Gorlas >> --- >> Documentation/admin-guide/kernel-parameters.txt | 5 +++++ >> kernel/module/Kconfig | 15 +++++++++++++++ >> 2 files changed, 20 insertions(+) >>=20 >> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documenta= tion/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 >> =20 >> + modrestrict=3D >> + 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. Right. Will adjust the description here. > >> .async_probe[=3D] [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 >> =20 >> endif # MODULE_SIG || IMA_APPRAISE_MODSIG >> =20 >> +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. Alright, will squash them in v2. Best, Michal