lsm: mark the lsm_id variables are marked as static
Subsystems (10)
Paul Moore
maintainerPATCH 1/1 lsm: mark the lsm_id variables are marked as static
As the kernel test robot helpfully reminded us, all of the lsm_id instances defined inside the various LSMs should be marked as static. The one exception is Landlock which uses its lsm_id variable across multiple source files with an extern declaration in a header file.
--- security/apparmor/lsm.c | 2 +- security/bpf/hooks.c | 2 +- security/commoncap.c | 2 +- security/loadpin/loadpin.c | 2 +- security/safesetid/lsm.c | 2 +- security/selinux/hooks.c | 2 +- security/smack/smack_lsm.c | 2 +- security/tomoyo/tomoyo.c | 2 +- security/yama/yama_lsm.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
security/apparmor/lsm.c +1 -1
@@ -1454,7 +1454,7 @@ struct lsm_blob_sizes apparmor_blob_sizes __ro_after_init = { .lbs_task = sizeof(struct aa_task_ctx), }; -const struct lsm_id apparmor_lsmid = { +static const struct lsm_id apparmor_lsmid = { .name ="apparmor" , .id =LSM_ID_APPARMOR , };
security/bpf/hooks.c +1 -1
@@ -16,7 +16,7 @@ static struct security_hook_list bpf_lsm_hooks[] __ro_after_init = { LSM_HOOK_INIT(task_free, bpf_task_storage_free), }; -const struct lsm_id bpf_lsmid = { +static const struct lsm_id bpf_lsmid = { .name ="bpf" , .id =LSM_ID_BPF , };
security/commoncap.c +1 -1
@@ -1441,7 +1441,7 @@ int cap_mmap_file(struct file *file, unsigned long reqprot,#ifdef CONFIG_SECURITY -const struct lsm_id capability_lsmid = { +static const struct lsm_id capability_lsmid = { .name ="capability" , .id =LSM_ID_CAPABILITY , };
security/loadpin/loadpin.c +1 -1
@@ -209,7 +209,7 @@ static int loadpin_load_data(enum kernel_load_data_id id, bool contents)return loadpin_check (NULL , (enum kernel_read_file_id ) id); } -const struct lsm_id loadpin_lsmid = { +static const struct lsm_id loadpin_lsmid = { .name ="loadpin" , .id =LSM_ID_LOADPIN , };
security/safesetid/lsm.c +1 -1
@@ -262,7 +262,7 @@ static int safesetid_task_fix_setgroups(struct cred *new, const struct cred *oldreturn 0 ; } -const struct lsm_id safesetid_lsmid = { +static const struct lsm_id safesetid_lsmid = { .name ="safesetid" , .id =LSM_ID_SAFESETID , };
security/selinux/hooks.c +1 -1
@@ -7031,7 +7031,7 @@ static int selinux_uring_cmd(struct io_uring_cmd *ioucmd) }#endif /* CONFIG_IO_URING */ -const struct lsm_id selinux_lsmid = { +static const struct lsm_id selinux_lsmid = { .name ="selinux" , .id =LSM_ID_SELINUX , };
security/smack/smack_lsm.c +1 -1
@@ -5006,7 +5006,7 @@ struct lsm_blob_sizes smack_blob_sizes __ro_after_init = { .lbs_xattr_count = SMACK_INODE_INIT_XATTRS, }; -const struct lsm_id smack_lsmid = { +static const struct lsm_id smack_lsmid = { .name ="smack" , .id =LSM_ID_SMACK , };
security/tomoyo/tomoyo.c +1 -1
@@ -543,7 +543,7 @@ static void tomoyo_task_free(struct task_struct *task) } } -const struct lsm_id tomoyo_lsmid = { +static const struct lsm_id tomoyo_lsmid = { .name ="tomoyo" , .id =LSM_ID_TOMOYO , };
security/yama/yama_lsm.c +1 -1
@@ -422,7 +422,7 @@ static int yama_ptrace_traceme(struct task_struct *parent)return rc; } -const struct lsm_id yama_lsmid = { +static const struct lsm_id yama_lsmid = { .name ="yama" , .id =LSM_ID_YAMA , };
Signature · 1 line
2.42.1
Quoted 8 lines · Paul Moore
As the kernel test robot helpfully reminded us, all of the
lsm_idinstances defined inside the various LSMs should be marked as static. The one exception is Landlock which uses itslsm_idvariable across multiple source files with an extern declaration in a header file.Reported-by kernel test robot <[email protected]>Suggested-by Casey Schaufler <[email protected]>Signed-off-by Paul Moore <[email protected]>
Quoted 129 lines
--- security/apparmor/lsm.c | 2 +- security/bpf/hooks.c | 2 +- security/commoncap.c | 2 +- security/loadpin/loadpin.c | 2 +- security/safesetid/lsm.c | 2 +- security/selinux/hooks.c | 2 +- security/smack/smack_lsm.c | 2 +- security/tomoyo/tomoyo.c | 2 +- security/yama/yama_lsm.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)security/apparmor/lsm.c +1
-1@@ -1454,7 +1454,7 @@ struct lsm_blob_sizes apparmor_blob_sizes __ro_after_init = { .lbs_task = sizeof(struct aa_task_ctx), }; -const struct lsm_id apparmor_lsmid = { +static const struct lsm_id apparmor_lsmid = { .name ="apparmor" , .id =LSM_ID_APPARMOR , };security/bpf/hooks.c +1
-1@@ -16,7 +16,7 @@ static struct security_hook_list bpf_lsm_hooks[] __ro_after_init = { LSM_HOOK_INIT(task_free, bpf_task_storage_free), }; -const struct lsm_id bpf_lsmid = { +static const struct lsm_id bpf_lsmid = { .name ="bpf" , .id =LSM_ID_BPF , };security/commoncap.c +1
-1@@ -1441,7 +1441,7 @@ int cap_mmap_file(struct file *file, unsigned long reqprot,#ifdef CONFIG_SECURITY -const struct lsm_id capability_lsmid = { +static const struct lsm_id capability_lsmid = { .name ="capability" , .id =LSM_ID_CAPABILITY , };security/loadpin/loadpin.c +1
-1@@ -209,7 +209,7 @@ static int loadpin_load_data(enum kernel_load_data_id id, bool contents)return loadpin_check (NULL , (enum kernel_read_file_id ) id); } -const struct lsm_id loadpin_lsmid = { +static const struct lsm_id loadpin_lsmid = { .name ="loadpin" , .id =LSM_ID_LOADPIN , };security/safesetid/lsm.c +1
-1@@ -262,7 +262,7 @@ static int safesetid_task_fix_setgroups(struct cred *new, const struct cred *oldreturn 0 ; } -const struct lsm_id safesetid_lsmid = { +static const struct lsm_id safesetid_lsmid = { .name ="safesetid" , .id =LSM_ID_SAFESETID , };security/selinux/hooks.c +1
-1@@ -7031,7 +7031,7 @@ static int selinux_uring_cmd(struct io_uring_cmd *ioucmd) }#endif /* CONFIG_IO_URING */ -const struct lsm_id selinux_lsmid = { +static const struct lsm_id selinux_lsmid = { .name ="selinux" , .id =LSM_ID_SELINUX , };security/smack/smack_lsm.c +1
-1@@ -5006,7 +5006,7 @@ struct lsm_blob_sizes smack_blob_sizes __ro_after_init = { .lbs_xattr_count = SMACK_INODE_INIT_XATTRS, }; -const struct lsm_id smack_lsmid = { +static const struct lsm_id smack_lsmid = { .name ="smack" , .id =LSM_ID_SMACK , };security/tomoyo/tomoyo.c +1
-1@@ -543,7 +543,7 @@ static void tomoyo_task_free(struct task_struct *task) } } -const struct lsm_id tomoyo_lsmid = { +static const struct lsm_id tomoyo_lsmid = { .name ="tomoyo" , .id =LSM_ID_TOMOYO , };security/yama/yama_lsm.c +1
-1@@ -422,7 +422,7 @@ static int yama_ptrace_traceme(struct task_struct *parent)return rc; } -const struct lsm_id yama_lsmid = { +static const struct lsm_id yama_lsmid = { .name ="yama" , .id =LSM_ID_YAMA , };
Paul Moore
maintainerQuoted 7 lines · Casey Schaufler
Quoted 5 lines · Paul Moore
As the kernel test robot helpfully reminded us, all of the
lsm_idinstances defined inside the various LSMs should be marked as static. The one exception is Landlock which uses itslsm_idvariable across multiple source files with an extern declaration in a header file.
Quoted 5 lines
Quoted 3 lines
Reported-by kernel test robot <[email protected]>Suggested-by Casey Schaufler <[email protected]>Signed-off-by Paul Moore <[email protected]>Reviewed-by Casey Schaufler <[email protected]>
Thanks Casey, I've gone ahead and merge this into lsm/dev-staging.
Signature · 1 line
paul-moore.com
Quoted 8 lines · Paul Moore
Quoted 7 lines · Casey Schaufler
Quoted 5 lines · Paul Moore
As the kernel test robot helpfully reminded us, all of the
lsm_idinstances defined inside the various LSMs should be marked as static. The one exception is Landlock which uses itslsm_idvariable across multiple source files with an extern declaration in a header file.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Reported-by kernel test robot <[email protected]>Suggested-by Casey Schaufler <[email protected]>Signed-off-by Paul Moore <[email protected]>Reviewed-by Casey Schaufler <[email protected]>Thanks Casey, I've gone ahead and merge this into lsm/dev-staging.
Merged into lsm/dev.
Signature · 1 line
paul-moore.com