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 2/2] LoadPin: Make sysctl table const
Date: Thu, 23 Jan 2025 16:33:35 -0300	[thread overview]
Message-ID: <20250123-sysctl-kees-v1-2-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 loadpin_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/loadpin/loadpin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c
index 68252452b66cb913638abbca2adea26219e77d37..e2d664b7602629c08c86d6d02158a4e9dd189b1a 100644
--- a/security/loadpin/loadpin.c
+++ b/security/loadpin/loadpin.c
@@ -53,7 +53,7 @@ static bool deny_reading_verity_digests;
 #endif
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_table loadpin_sysctl_table[] = {
+static const struct ctl_table loadpin_sysctl_table[] = {
 	{
 		.procname       = "enforce",
 		.data           = &enforce,

-- 
2.48.1


  parent 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 ` [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
2025-01-23 19:33 ` Ricardo B. Marliere [this message]
2025-01-23 23:20   ` [PATCH 2/2] LoadPin: " 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-2-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®