selinux: move the selinux_blob_sizes struct
Paul Moore
maintainerPATCH 1/1 selinux: move the selinux_blob_sizes struct
Move the selinux_blob_sizes struct so it adjacent to the rest of the SELinux initialization code and not in the middle of the LSM hook callbacks.
Signed-off-by Paul Moore <[email protected]>
--- security/selinux/hooks.c | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
security/selinux/hooks.c +21 -21
@@ -7158,27 +7158,6 @@ static int selinux_bpf_token_create(struct bpf_token *token, union bpf_attr *att }#endif -struct lsm_blob_sizes selinux_blob_sizes__ro_after_init = { - .lbs_cred =sizeof (struct cred_security_struct ), - .lbs_task =sizeof (struct task_security_struct ), - .lbs_file =sizeof (struct file_security_struct ), - .lbs_inode =sizeof (struct inode_security_struct ), - .lbs_ipc =sizeof (struct ipc_security_struct ), - .lbs_key =sizeof (struct key_security_struct ), - .lbs_msg_msg =sizeof (struct msg_security_struct ), -#ifdef CONFIG_PERF_EVENTS - .lbs_perf_event =sizeof (struct perf_event_security_struct ), -#endif - .lbs_sock =sizeof (struct sk_security_struct ), - .lbs_superblock =sizeof (struct superblock_security_struct ), - .lbs_xattr_count =SELINUX_INODE_INIT_XATTRS , - .lbs_tun_dev =sizeof (struct tun_security_struct ), - .lbs_ib =sizeof (struct ib_security_struct ), - .lbs_bpf_map =sizeof (struct bpf_security_struct ), - .lbs_bpf_prog =sizeof (struct bpf_security_struct ), - .lbs_bpf_token =sizeof (struct bpf_security_struct ), -}; -#ifdef CONFIG_PERF_EVENTS static int selinux_perf_event_open (int type) {
@@ -7297,6 +7276,27 @@ static const struct lsm_id selinux_lsmid = { .id = LSM_ID_SELINUX, }; +struct lsm_blob_sizes selinux_blob_sizes__ro_after_init = { + .lbs_cred =sizeof (struct cred_security_struct ), + .lbs_task =sizeof (struct task_security_struct ), + .lbs_file =sizeof (struct file_security_struct ), + .lbs_inode =sizeof (struct inode_security_struct ), + .lbs_ipc =sizeof (struct ipc_security_struct ), + .lbs_key =sizeof (struct key_security_struct ), + .lbs_msg_msg =sizeof (struct msg_security_struct ), +#ifdef CONFIG_PERF_EVENTS + .lbs_perf_event =sizeof (struct perf_event_security_struct ), +#endif + .lbs_sock =sizeof (struct sk_security_struct ), + .lbs_superblock =sizeof (struct superblock_security_struct ), + .lbs_xattr_count =SELINUX_INODE_INIT_XATTRS , + .lbs_tun_dev =sizeof (struct tun_security_struct ), + .lbs_ib =sizeof (struct ib_security_struct ), + .lbs_bpf_map =sizeof (struct bpf_security_struct ), + .lbs_bpf_prog =sizeof (struct bpf_security_struct ), + .lbs_bpf_token =sizeof (struct bpf_security_struct ), +}; +/* * IMPORTANT NOTE: When adding new hooks, please be careful to keep this order: * 1. any hooks that don't belong to (2.) or (3.) below,
Signature · 1 line
2.52.0
Quoted 9 lines · Paul Moore
Move the
selinux_blob_sizesstruct so it adjacent to the rest of the SELinux initialization code and not in the middle of the LSM hook callbacks.Signed-off-by Paul Moore <[email protected]>--- security/selinux/hooks.c | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
Merged into selinux/dev.
Signature · 1 line
paul-moore.com