提交 fbeb4a9c 编写于 作者: S Serge E. Hallyn 提交者: James Morris

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: NSerge E. Hallyn <serue@us.ibm.com>
Acked-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 13b297d9
......@@ -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) */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册