summaryrefslogtreecommitdiffstats
path: root/security/selinux/exports.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/exports.c')
-rw-r--r--security/selinux/exports.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/security/selinux/exports.c b/security/selinux/exports.c
index 07ddce7..7357cf2 100644
--- a/security/selinux/exports.c
+++ b/security/selinux/exports.c
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/selinux.h>
#include <linux/fs.h>
+#include <linux/ipc.h>
#include "security.h"
#include "objsec.h"
@@ -50,3 +51,13 @@ void selinux_get_inode_sid(const struct inode *inode, u32 *sid)
*sid = 0;
}
+void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid)
+{
+ if (selinux_enabled) {
+ struct ipc_security_struct *isec = ipcp->security;
+ *sid = isec->sid;
+ return;
+ }
+ *sid = 0;
+}
+
OpenPOWER on IntegriCloud