diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2009-06-02 05:47:19 +0200 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-06-02 07:13:13 +0200 |
commit | fbeb4a9c20d00e2550156f9e5a34473fbde59de2 (patch) | |
tree | d08881a9eb2d768722363d7022d2ae4da81494d9 /security/tomoyo | |
parent | smack: Remove redundant initialization. (diff) | |
download | linux-fbeb4a9c20d00e2550156f9e5a34473fbde59de2.tar.xz linux-fbeb4a9c20d00e2550156f9e5a34473fbde59de2.zip |
tomoyo: avoid get+put of task_struct
Use task_cred_xxx(task, security) in tomoyo_real_domain() to
avoid a get+put of the target cred.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo')
-rw-r--r-- | security/tomoyo/tomoyo.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/security/tomoyo/tomoyo.h b/security/tomoyo/tomoyo.h index 41c6ebafb9c5..f12d5ada7dcb 100644 --- a/security/tomoyo/tomoyo.h +++ b/security/tomoyo/tomoyo.h @@ -90,17 +90,10 @@ static inline struct tomoyo_domain_info *tomoyo_domain(void) return current_cred()->security; } -/* Caller holds tasklist_lock spinlock. */ static inline struct tomoyo_domain_info *tomoyo_real_domain(struct task_struct *task) { - /***** CRITICAL SECTION START *****/ - const struct cred *cred = get_task_cred(task); - struct tomoyo_domain_info *domain = cred->security; - - put_cred(cred); - return domain; - /***** CRITICAL SECTION END *****/ + return task_cred_xxx(task, security); } #endif /* !defined(_SECURITY_TOMOYO_TOMOYO_H) */ |