From: Kees Cook <kees@kernel.org>
To: "Ricardo B. Marliere" <ricardo@marliere.net>
Cc: "Paul Moore" <paul@paul-moore.com>,
"James Morris" <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Ricardo B. Marliere" <rbm@suse.com>,
"Thomas Weißschuh" <linux@weissschuh.net>
Subject: Re: [PATCH 1/2] yama: Make sysctl table const
Date: Mon, 10 Feb 2025 16:37:20 -0800 [thread overview]
Message-ID: <202502101636.C8D3F04@keescook> (raw)
In-Reply-To: <20250123-sysctl-kees-v1-1-533359e74d66@suse.com>
On Thu, Jan 23, 2025 at 04:33:34PM -0300, Ricardo B. Marliere wrote:
> Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
> ctl_table"), the sysctl registration API allows for struct ctl_table to be
> in read-only memory. Move yama_sysctl_table to be declared at build time,
> instead of having to be dynamically allocated at boot time.
>
> Cc: Thomas Weißschuh <linux@weissschuh.net>
> Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
> ---
> security/yama/yama_lsm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
> index e1a5e13ea269d4917fe2c78cb79f1d44881653c2..54bd5f535ac1fef9409ea96ad60825f565318daf 100644
> --- a/security/yama/yama_lsm.c
> +++ b/security/yama/yama_lsm.c
> @@ -454,7 +454,7 @@ static int yama_dointvec_minmax(const struct ctl_table *table, int write,
>
> static int max_scope = YAMA_SCOPE_NO_ATTACH;
>
> -static struct ctl_table yama_sysctl_table[] = {
> +static const struct ctl_table yama_sysctl_table[] = {
This was done via commit 1751f872cc97 ("treewide: const qualify
ctl_tables where applicable").
--
Kees Cook
next prev parent reply other threads:[~2025-02-11 0:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-23 19:33 [PATCH 0/2] security: Constify sysctl tables Ricardo B. Marliere
2025-01-23 19:33 ` [PATCH 1/2] yama: Make sysctl table const Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
2025-02-11 0:37 ` Kees Cook [this message]
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
2025-02-02 11:10 ` kernel test robot
2025-02-11 0:38 ` Kees Cook
2025-02-14 15:54 ` kernel test robot
2025-01-23 23:21 ` [PATCH 0/2] security: Constify sysctl tables Kees Cook
2025-01-24 1:02 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202502101636.C8D3F04@keescook \
--to=kees@kernel.org \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=paul@paul-moore.com \
--cc=rbm@suse.com \
--cc=ricardo@marliere.net \
--cc=serge@hallyn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.