AppArmor: Abstract use of cred security blob
Don't use the cred->security pointer directly. Provide a helper function that provides the security blob pointer. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: Kees Cook <keescook@chromium.org> [kees: adjusted for ordered init series] Signed-off-by: Kees Cook <keescook@chromium.org>
这个提交包含在:
@@ -23,8 +23,22 @@
|
||||
#include "policy_ns.h"
|
||||
#include "task.h"
|
||||
|
||||
#define cred_label(X) ((X)->security)
|
||||
static inline struct aa_label *cred_label(const struct cred *cred)
|
||||
{
|
||||
struct aa_label **blob = cred->security;
|
||||
|
||||
AA_BUG(!blob);
|
||||
return *blob;
|
||||
}
|
||||
|
||||
static inline void set_cred_label(const struct cred *cred,
|
||||
struct aa_label *label)
|
||||
{
|
||||
struct aa_label **blob = cred->security;
|
||||
|
||||
AA_BUG(!blob);
|
||||
*blob = label;
|
||||
}
|
||||
|
||||
/**
|
||||
* aa_cred_raw_label - obtain cred's label
|
||||
|
在新工单中引用
屏蔽一个用户