]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lsm: remove the now superfluous sentinel element from ctl_table array
authorJoel Granados <j.granados@samsung.com>
Thu, 28 Mar 2024 15:57:49 +0000 (16:57 +0100)
committerPaul Moore <paul@paul-moore.com>
Mon, 15 Apr 2024 19:00:00 +0000 (15:00 -0400)
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which will
reduce the overall build time size of the kernel and run time memory
bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)

Remove the sentinel from all files under security/ that register a
sysctl table.

Signed-off-by: Joel Granados <j.granados@samsung.com>
Acked-by: Kees Cook <keescook@chromium.org> # loadpin & yama
Tested-by: Valentin Schneider <vschneid@redhat.com>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
[PM: subject line tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/apparmor/lsm.c
security/keys/sysctl.c
security/loadpin/loadpin.c
security/yama/yama_lsm.c

index cef8c466af80dfd058647a4827c933639bc0772d..6239777090c430efc607e2ac75cd78606812f979 100644 (file)
@@ -2064,7 +2064,6 @@ static struct ctl_table apparmor_sysctl_table[] = {
                .mode           = 0600,
                .proc_handler   = apparmor_dointvec,
        },
-       { }
 };
 
 static int __init apparmor_init_sysctl(void)
index b348e1679d5df6a430aff60853632472df8cbdfb..91f000eef3ad82370250e5238d9c9c80757aab61 100644 (file)
@@ -66,7 +66,6 @@ static struct ctl_table key_sysctls[] = {
                .extra2 = (void *) SYSCTL_INT_MAX,
        },
 #endif
-       { }
 };
 
 static int __init init_security_keys_sysctls(void)
index 8e93cda130f13c334f33add8ee7ae98e53534ae7..93fd4d47b334ae7210dbc0f8c7bcf47817cf3762 100644 (file)
@@ -63,7 +63,6 @@ static struct ctl_table loadpin_sysctl_table[] = {
                .extra1         = SYSCTL_ONE,
                .extra2         = SYSCTL_ONE,
        },
-       { }
 };
 
 static void set_sysctl(bool is_writable)
index 49dc52b454efaa19e4207e4b55569597f5475ad2..b6684a074a59be130bee236d133e8636d2000ecc 100644 (file)
@@ -463,7 +463,6 @@ static struct ctl_table yama_sysctl_table[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = &max_scope,
        },
-       { }
 };
 static void __init yama_init_sysctl(void)
 {