diff options
Diffstat (limited to 'security/smack/smack.h')
-rw-r--r-- | security/smack/smack.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h index 43ae747a5aa4..a2e2cdfab4ef 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h | |||
@@ -51,10 +51,16 @@ struct socket_smack { | |||
51 | */ | 51 | */ |
52 | struct inode_smack { | 52 | struct inode_smack { |
53 | char *smk_inode; /* label of the fso */ | 53 | char *smk_inode; /* label of the fso */ |
54 | char *smk_task; /* label of the task */ | ||
54 | struct mutex smk_lock; /* initialization lock */ | 55 | struct mutex smk_lock; /* initialization lock */ |
55 | int smk_flags; /* smack inode flags */ | 56 | int smk_flags; /* smack inode flags */ |
56 | }; | 57 | }; |
57 | 58 | ||
59 | struct task_smack { | ||
60 | char *smk_task; /* label used for access control */ | ||
61 | char *smk_forked; /* label when forked */ | ||
62 | }; | ||
63 | |||
58 | #define SMK_INODE_INSTANT 0x01 /* inode is instantiated */ | 64 | #define SMK_INODE_INSTANT 0x01 /* inode is instantiated */ |
59 | 65 | ||
60 | /* | 66 | /* |
@@ -243,6 +249,30 @@ static inline char *smk_of_inode(const struct inode *isp) | |||
243 | } | 249 | } |
244 | 250 | ||
245 | /* | 251 | /* |
252 | * Present a pointer to the smack label in an task blob. | ||
253 | */ | ||
254 | static inline char *smk_of_task(const struct task_smack *tsp) | ||
255 | { | ||
256 | return tsp->smk_task; | ||
257 | } | ||
258 | |||
259 | /* | ||
260 | * Present a pointer to the forked smack label in an task blob. | ||
261 | */ | ||
262 | static inline char *smk_of_forked(const struct task_smack *tsp) | ||
263 | { | ||
264 | return tsp->smk_forked; | ||
265 | } | ||
266 | |||
267 | /* | ||
268 | * Present a pointer to the smack label in the curren task blob. | ||
269 | */ | ||
270 | static inline char *smk_of_current(void) | ||
271 | { | ||
272 | return smk_of_task(current_security()); | ||
273 | } | ||
274 | |||
275 | /* | ||
246 | * logging functions | 276 | * logging functions |
247 | */ | 277 | */ |
248 | #define SMACK_AUDIT_DENIED 0x1 | 278 | #define SMACK_AUDIT_DENIED 0x1 |