diff options
author | Casey Schaufler <casey@schaufler-ca.com> | 2010-12-02 09:43:39 -0500 |
---|---|---|
committer | Casey Schaufler <casey@schaufler-ca.com> | 2010-12-02 09:43:39 -0500 |
commit | 676dac4b1bee0469d6932f698aeb77e8489f5861 (patch) | |
tree | 196b4cb35cf8dfdff0698dc4368cfd00acc7391a /security/smack/smack.h | |
parent | 93ae86e759299718c611bc543b9b1633bf32905a (diff) |
This patch adds a new security attribute to Smack called
SMACK64EXEC. It defines label that is used while task is
running.
Exception: in smack_task_wait() child task is checked
for write access to parent task using label inherited
from the task that forked it.
Fixed issues from previous submit:
- SMACK64EXEC was not read when SMACK64 was not set.
- inode security blob was not updated after setting
SMACK64EXEC
- inode security blob was not updated when removing
SMACK64EXEC
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 |