Skip to content

Commit b82f3f6

Browse files
LenovoOpenLabpcmoore
authored andcommitted
selinux: remove redundant msg_msg_alloc_security
selinux_msg_msg_alloc_security only calls msg_msg_alloc_security but do nothing else. And also msg_msg_alloc_security is just used by the former. Remove the redundant function to simplify the code. Signed-off-by: Huaisheng Ye <yehs1@lenovo.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent d41415e commit b82f3f6

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

‎security/selinux/hooks.c‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5894,16 +5894,6 @@ static void ipc_init_security(struct ipc_security_struct *isec, u16 sclass)
58945894
isec->sid = current_sid();
58955895
}
58965896

5897-
static int msg_msg_alloc_security(struct msg_msg *msg)
5898-
{
5899-
struct msg_security_struct *msec;
5900-
5901-
msec = selinux_msg_msg(msg);
5902-
msec->sid = SECINITSID_UNLABELED;
5903-
5904-
return 0;
5905-
}
5906-
59075897
static int ipc_has_perm(struct kern_ipc_perm *ipc_perms,
59085898
u32 perms)
59095899
{
@@ -5922,7 +5912,12 @@ static int ipc_has_perm(struct kern_ipc_perm *ipc_perms,
59225912

59235913
static int selinux_msg_msg_alloc_security(struct msg_msg *msg)
59245914
{
5925-
return msg_msg_alloc_security(msg);
5915+
struct msg_security_struct *msec;
5916+
5917+
msec = selinux_msg_msg(msg);
5918+
msec->sid = SECINITSID_UNLABELED;
5919+
5920+
return 0;
59265921
}
59275922

59285923
/* message queue security operations */

0 commit comments

Comments
 (0)