mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo B. Marliere <ricardo@marliere.net>
To: Kees Cook <kees@kernel.org>, Paul Moore <paul@paul-moore.com>,
	 James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>
Cc: linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Ricardo B. Marliere" <rbm@suse.com>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH 1/2] yama: Make sysctl table const
Date: Thu, 23 Jan 2025 16:33:34 -0300	[thread overview]
Message-ID: <20250123-sysctl-kees-v1-1-533359e74d66@suse.com> (raw)
In-Reply-To: <20250123-sysctl-kees-v1-0-533359e74d66@suse.com>

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[] = {
 	{
 		.procname       = "ptrace_scope",
 		.data           = &ptrace_scope,

-- 
2.48.1


  reply	other threads:[~2025-01-23 19:35 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 ` Ricardo B. Marliere [this message]
2025-01-23 23:20   ` [PATCH 1/2] yama: Make sysctl table const Kees Cook
2025-02-11  0:37   ` Kees Cook
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=20250123-sysctl-kees-v1-1-533359e74d66@suse.com \
    --to=ricardo@marliere.net \
    --cc=jmorris@namei.org \
    --cc=kees@kernel.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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®