Skip to content

Commit

Permalink
selinux: remove redundant msg_msg_alloc_security
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
LenovoOpenLab authored and pcmoore committed Jan 10, 2020
1 parent d41415e commit b82f3f6
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -5894,16 +5894,6 @@ static void ipc_init_security(struct ipc_security_struct *isec, u16 sclass)
isec->sid = current_sid();
}

static int msg_msg_alloc_security(struct msg_msg *msg)
{
struct msg_security_struct *msec;

msec = selinux_msg_msg(msg);
msec->sid = SECINITSID_UNLABELED;

return 0;
}

static int ipc_has_perm(struct kern_ipc_perm *ipc_perms,
u32 perms)
{
Expand All @@ -5922,7 +5912,12 @@ static int ipc_has_perm(struct kern_ipc_perm *ipc_perms,

static int selinux_msg_msg_alloc_security(struct msg_msg *msg)
{
return msg_msg_alloc_security(msg);
struct msg_security_struct *msec;

msec = selinux_msg_msg(msg);
msec->sid = SECINITSID_UNLABELED;

return 0;
}

/* message queue security operations */
Expand Down

0 comments on commit b82f3f6

Please sign in to comment.