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

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.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>

+9 -9
+1 -1
security/apparmor/lsm.c
··· 1454 1454 .lbs_task = sizeof(struct aa_task_ctx), 1455 1455 }; 1456 1456 1457 - const struct lsm_id apparmor_lsmid = { 1457 + static const struct lsm_id apparmor_lsmid = { 1458 1458 .name = "apparmor", 1459 1459 .id = LSM_ID_APPARMOR, 1460 1460 };
+1 -1
security/bpf/hooks.c
··· 16 16 LSM_HOOK_INIT(task_free, bpf_task_storage_free), 17 17 }; 18 18 19 - const struct lsm_id bpf_lsmid = { 19 + static const struct lsm_id bpf_lsmid = { 20 20 .name = "bpf", 21 21 .id = LSM_ID_BPF, 22 22 };
+1 -1
security/commoncap.c
··· 1441 1441 1442 1442 #ifdef CONFIG_SECURITY 1443 1443 1444 - const struct lsm_id capability_lsmid = { 1444 + static const struct lsm_id capability_lsmid = { 1445 1445 .name = "capability", 1446 1446 .id = LSM_ID_CAPABILITY, 1447 1447 };
+1 -1
security/loadpin/loadpin.c
··· 209 209 return loadpin_check(NULL, (enum kernel_read_file_id) id); 210 210 } 211 211 212 - const struct lsm_id loadpin_lsmid = { 212 + static const struct lsm_id loadpin_lsmid = { 213 213 .name = "loadpin", 214 214 .id = LSM_ID_LOADPIN, 215 215 };
+1 -1
security/safesetid/lsm.c
··· 262 262 return 0; 263 263 } 264 264 265 - const struct lsm_id safesetid_lsmid = { 265 + static const struct lsm_id safesetid_lsmid = { 266 266 .name = "safesetid", 267 267 .id = LSM_ID_SAFESETID, 268 268 };
+1 -1
security/selinux/hooks.c
··· 7031 7031 } 7032 7032 #endif /* CONFIG_IO_URING */ 7033 7033 7034 - const struct lsm_id selinux_lsmid = { 7034 + static const struct lsm_id selinux_lsmid = { 7035 7035 .name = "selinux", 7036 7036 .id = LSM_ID_SELINUX, 7037 7037 };
+1 -1
security/smack/smack_lsm.c
··· 5006 5006 .lbs_xattr_count = SMACK_INODE_INIT_XATTRS, 5007 5007 }; 5008 5008 5009 - const struct lsm_id smack_lsmid = { 5009 + static const struct lsm_id smack_lsmid = { 5010 5010 .name = "smack", 5011 5011 .id = LSM_ID_SMACK, 5012 5012 };
+1 -1
security/tomoyo/tomoyo.c
··· 543 543 } 544 544 } 545 545 546 - const struct lsm_id tomoyo_lsmid = { 546 + static const struct lsm_id tomoyo_lsmid = { 547 547 .name = "tomoyo", 548 548 .id = LSM_ID_TOMOYO, 549 549 };
+1 -1
security/yama/yama_lsm.c
··· 422 422 return rc; 423 423 } 424 424 425 - const struct lsm_id yama_lsmid = { 425 + static const struct lsm_id yama_lsmid = { 426 426 .name = "yama", 427 427 .id = LSM_ID_YAMA, 428 428 };