security: keys: Make sysctl table const
Subsystems (2)
PATCH 1/1 security: keys: Make sysctl table const
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.
--- security/keys/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/keys/sysctl.c +1 -1
@@ -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,
Signature · 1 line
Ricardo B. Marliere <[email protected]>
Quoted 6 lines · Ricardo B. Marliere
Since commit
7abc9b53bd51("sysctl: allow registration of const structctl_table"), the sysctl registration API allows for structctl_tableto be in read-only memory. Movekey_sysctlsto be declared at build time, instead of having to be dynamically allocated at boot time.
Quoted 6 lines
Cc Thomas Weißschuh <[email protected]>Suggested-by Thomas Weißschuh <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- 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?
Quoted 21 lines
security/keys/sysctl.c +1
-2@@ -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-fa14389b8329Best regards,
--
Ricardo B. Marliere <[email protected]>
Signature · 1 line
paul-moore.com
Hi Paul,
Quoted 15 lines · Paul Moore
Quoted 6 lines · Ricardo B. Marliere
Since commit
7abc9b53bd51("sysctl: allow registration of const structctl_table"), the sysctl registration API allows for structctl_tableto be in read-only memory. Movekey_sysctlsto be declared at build time, instead of having to be dynamically allocated at boot time.Quoted 6 lines
Cc Thomas Weißschuh <[email protected]>Suggested-by Thomas Weißschuh <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- security/keys/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Looks fine to me. David or Jarkko, this looks like something for the keys tree, yes?
Reviewed-by Paul Moore <[email protected]>
Thank you for the review, but I believe this has been done here:
Quoted 22 lines
Quoted 22 lines
security/keys/sysctl.c +1
-2@@ -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-fa14389b8329Best regards,
--
Ricardo B. Marliere <[email protected]>
Paul Moore
maintainerQuoted 16 lines · Ricardo B. Marlière
Quoted 15 lines · Paul Moore
Quoted 12 lines · Ricardo B. Marliere
Since commit
7abc9b53bd51("sysctl: allow registration of const structctl_table"), the sysctl registration API allows for structctl_tableto be in read-only memory. Movekey_sysctlsto be declared at build time, instead of having to be dynamically allocated at boot time.Cc Thomas Weißschuh <[email protected]>Suggested-by Thomas Weißschuh <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- security/keys/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 4 lines
Looks fine to me. David or Jarkko, this looks like something for the keys tree, yes?
Reviewed-by Paul Moore <[email protected]>Thank you for the review, but I believe this has been done here:
Even better :) Thanks for the update Ricardo.
Signature · 1 line
paul-moore.com
Jarkko Sakkinen
maintainerQuoted 20 lines · Paul Moore
Quoted 19 lines · Ricardo B. Marlière
Quoted 18 lines · Paul Moore
Quoted 6 lines · Ricardo B. Marliere
Since commit
7abc9b53bd51("sysctl: allow registration of const structctl_table"), the sysctl registration API allows for structctl_tableto be in read-only memory. Movekey_sysctlsto be declared at build time, instead of having to be dynamically allocated at boot time.Quoted 6 lines
Cc Thomas Weißschuh <[email protected]>Suggested-by Thomas Weißschuh <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- 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?
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Reviewed-by Paul Moore <[email protected]>Thank you for the review, but I believe this has been done here:
Even better :) Thanks for the update Ricardo.
+1
BR, Jarkko
Quoted 15 lines · Paul Moore
Quoted 6 lines · Ricardo B. Marliere
Since commit
7abc9b53bd51("sysctl: allow registration of const structctl_table"), the sysctl registration API allows for structctl_tableto be in read-only memory. Movekey_sysctlsto be declared at build time, instead of having to be dynamically allocated at boot time.Quoted 6 lines
Cc Thomas Weißschuh <[email protected]>Suggested-by Thomas Weißschuh <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- security/keys/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Looks fine to me. David or Jarkko, this looks like something for the keys tree, yes?
Reviewed-by Paul Moore <[email protected]>
I can pick this after back from holiday on next week.
BR, Jarkko