From: "Ricardo B. Marlière" <rbm@suse.com>
To: "Paul Moore" <paul@paul-moore.com>,
"Ricardo B. Marliere" <ricardo@marliere.net>,
"David Howells" <dhowells@redhat.com>,
"Jarkko Sakkinen" <jarkko@kernel.org>
Cc: "James Morris" <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
keyrings@vger.kernel.org, linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Thomas Weißschuh" <linux@weissschuh.net>
Subject: Re: [PATCH] security: keys: Make sysctl table const
Date: Thu, 27 Feb 2025 07:47:38 -0300 [thread overview]
Message-ID: <D8362ZV7Y4YI.PJTF4OC88RQK@suse.com> (raw)
In-Reply-To: <CAHC9VhQpkyqaJsxj9_d4d6Vpc+FVbSnH_HeAFAVEdj0trGCh1g@mail.gmail.com>
Hi Paul,
On Wed Feb 26, 2025 at 9:21 PM -03, Paul Moore wrote:
> On Thu, Jan 23, 2025 at 2:50 PM Ricardo B. Marliere
> <ricardo@marliere.net> 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 key_sysctls 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/keys/sysctl.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Looks fine to me. David or Jarkko, this looks like something for the
> keys tree, yes?
>
> Reviewed-by: Paul Moore <paul@paul-moore.com>
Thank you for the review, but I believe this has been done here:
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1751f872cc97f992ed5c4c72c55588db1f0021e1
>
>> diff --git a/security/keys/sysctl.c b/security/keys/sysctl.c
>> index 91f000eef3ad82370250e5238d9c9c80757aab61..cde08c478f3272081304e6db34e36b64ce0d321a 100644
>> --- a/security/keys/sysctl.c
>> +++ b/security/keys/sysctl.c
>> @@ -9,7 +9,7 @@
>> #include <linux/sysctl.h>
>> #include "internal.h"
>>
>> -static struct ctl_table key_sysctls[] = {
>> +static const struct ctl_table key_sysctls[] = {
>> {
>> .procname = "maxkeys",
>> .data = &key_quota_maxkeys,
>>
>> ---
>> base-commit: 714d87c90a766e6917f7d69f618b864d350f09d3
>> change-id: 20250123-sysctl_const-pcmoore-fa14389b8329
>>
>> Best regards,
>> --
>> Ricardo B. Marliere <rbm@suse.com>
next prev parent reply other threads:[~2025-02-27 10:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-23 19:50 [PATCH] security: keys: Make sysctl table const Ricardo B. Marliere
2025-02-27 0:21 ` Paul Moore
2025-02-27 10:47 ` Ricardo B. Marlière [this message]
2025-02-27 16:45 ` Paul Moore
2025-03-01 2:00 ` Jarkko Sakkinen
2025-03-01 1:59 ` Jarkko Sakkinen
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=D8362ZV7Y4YI.PJTF4OC88RQK@suse.com \
--to=rbm@suse.com \
--cc=dhowells@redhat.com \
--cc=jarkko@kernel.org \
--cc=jmorris@namei.org \
--cc=keyrings@vger.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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).