summaryrefslogtreecommitdiffstats
path: root/security/smack/smack.h
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2010-12-03 08:21:01 +1100
committerJames Morris <jmorris@namei.org>2010-12-03 08:21:01 +1100
commitfe27d4b012273640e033be80f143bdc54daa8e16 (patch)
tree4e58d69bf300ef2885644ec7f3950dc3fa87be3a /security/smack/smack.h
parentad9c2b048b605fbc8d50526e330b88abdd631ab2 (diff)
parent676dac4b1bee0469d6932f698aeb77e8489f5861 (diff)
downloadop-kernel-dev-fe27d4b012273640e033be80f143bdc54daa8e16.zip
op-kernel-dev-fe27d4b012273640e033be80f143bdc54daa8e16.tar.gz
Merge branch 'smack-next-master' into next
Diffstat (limited to 'security/smack/smack.h')
-rw-r--r--security/smack/smack.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h
index 43ae747..a2e2cdf 100644
--- a/security/smack/smack.h
+++ b/security/smack/smack.h
@@ -51,10 +51,16 @@ struct socket_smack {
*/
struct inode_smack {
char *smk_inode; /* label of the fso */
+ char *smk_task; /* label of the task */
struct mutex smk_lock; /* initialization lock */
int smk_flags; /* smack inode flags */
};
+struct task_smack {
+ char *smk_task; /* label used for access control */
+ char *smk_forked; /* label when forked */
+};
+
#define SMK_INODE_INSTANT 0x01 /* inode is instantiated */
/*
@@ -243,6 +249,30 @@ static inline char *smk_of_inode(const struct inode *isp)
}
/*
+ * Present a pointer to the smack label in an task blob.
+ */
+static inline char *smk_of_task(const struct task_smack *tsp)
+{
+ return tsp->smk_task;
+}
+
+/*
+ * Present a pointer to the forked smack label in an task blob.
+ */
+static inline char *smk_of_forked(const struct task_smack *tsp)
+{
+ return tsp->smk_forked;
+}
+
+/*
+ * Present a pointer to the smack label in the curren task blob.
+ */
+static inline char *smk_of_current(void)
+{
+ return smk_of_task(current_security());
+}
+
+/*
* logging functions
*/
#define SMACK_AUDIT_DENIED 0x1
OpenPOWER on IntegriCloud