From: Ricardo B. Marliere <ricardo@marliere.net>
To: John Johansen <john.johansen@canonical.com>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>
Cc: apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Ricardo B. Marliere" <rbm@suse.com>
Subject: [PATCH] apparmor: Make sysctl table const
Date: Thu, 23 Jan 2025 16:57:19 -0300 [thread overview]
Message-ID: <20250123-sysctl_const-jj-v1-1-8b9c04238aeb@suse.com> (raw)
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 apparmor_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/apparmor/lsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 0b4f7e2e4135503f0c78a050e82adb4ff853e9f4..93c7fcd875f764feee7fca6ac302e31ea081d18c 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -2205,7 +2205,7 @@ static int apparmor_dointvec(const struct ctl_table *table, int write,
return proc_dointvec(table, write, buffer, lenp, ppos);
}
-static struct ctl_table apparmor_sysctl_table[] = {
+static const struct ctl_table apparmor_sysctl_table[] = {
#ifdef CONFIG_USER_NS
{
.procname = "unprivileged_userns_apparmor_policy",
---
base-commit: e6b087676954e36a7b1ed51249362bb499f8c1c2
change-id: 20250123-sysctl_const-jj-1cdba6ab00ae
Best regards,
--
Ricardo B. Marliere <rbm@suse.com>
reply other threads:[~2025-01-23 19:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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_const-jj-v1-1-8b9c04238aeb@suse.com \
--to=ricardo@marliere.net \
--cc=apparmor@lists.ubuntu.com \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--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®