summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorHuaisheng Ye <yehs1@lenovo.com>2020-01-10 10:58:56 +0100
committerPaul Moore <paul@paul-moore.com>2020-01-10 17:32:13 +0100
commitb82f3f6894ec68dfada736bdf87997b1e0d3b53f (patch)
tree13d6f7ecb8c3ddf9e08aa1bb54763736ca492b74 /security
parentDocumentation,selinux: fix references to old selinuxfs mount point (diff)
downloadlinux-b82f3f6894ec68dfada736bdf87997b1e0d3b53f.tar.xz
linux-b82f3f6894ec68dfada736bdf87997b1e0d3b53f.zip
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>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 63a6e36abe9f..81f570cffee5 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -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)
{
@@ -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 */