Merge tag 'selinux-pr-20190917' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / security / selinux / include / objsec.h
index 91c5395dd20c2aa9d34c93bcfe856c66e5978c0f..586b7abd0aa73804b70aa304bd781b9f30e48f6c 100644 (file)
@@ -37,16 +37,6 @@ struct task_security_struct {
        u32 sockcreate_sid;     /* fscreate SID */
 };
 
-/*
- * get the subjective security ID of the current task
- */
-static inline u32 current_sid(void)
-{
-       const struct task_security_struct *tsec = current_security();
-
-       return tsec->sid;
-}
-
 enum label_initialized {
        LABEL_INVALID,          /* invalid or not initialized */
        LABEL_INITIALIZED,      /* initialized */
@@ -185,4 +175,14 @@ static inline struct ipc_security_struct *selinux_ipc(
        return ipc->security + selinux_blob_sizes.lbs_ipc;
 }
 
+/*
+ * get the subjective security ID of the current task
+ */
+static inline u32 current_sid(void)
+{
+       const struct task_security_struct *tsec = selinux_cred(current_cred());
+
+       return tsec->sid;
+}
+
 #endif /* _SELINUX_OBJSEC_H_ */