Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lsm: remove the now superfluous sentinel element from ctl_table array

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>

authored by

Joel Granados and committed by
Paul Moore
74560bb3 4cece764

-4
-1
security/apparmor/lsm.c
··· 2064 2064 .mode = 0600, 2065 2065 .proc_handler = apparmor_dointvec, 2066 2066 }, 2067 - { } 2068 2067 }; 2069 2068 2070 2069 static int __init apparmor_init_sysctl(void)
-1
security/keys/sysctl.c
··· 66 66 .extra2 = (void *) SYSCTL_INT_MAX, 67 67 }, 68 68 #endif 69 - { } 70 69 }; 71 70 72 71 static int __init init_security_keys_sysctls(void)
-1
security/loadpin/loadpin.c
··· 63 63 .extra1 = SYSCTL_ONE, 64 64 .extra2 = SYSCTL_ONE, 65 65 }, 66 - { } 67 66 }; 68 67 69 68 static void set_sysctl(bool is_writable)
-1
security/yama/yama_lsm.c
··· 463 463 .extra1 = SYSCTL_ZERO, 464 464 .extra2 = &max_scope, 465 465 }, 466 - { } 467 466 }; 468 467 static void __init yama_init_sysctl(void) 469 468 {