Commit d97d51d2 authored by John Johansen's avatar John Johansen

apparmor: rename PFLAG_INVALID to PFLAG_STALE

Invalid does not convey the meaning of the flag anymore so rename it.
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 121d4a91
...@@ -152,7 +152,7 @@ static inline struct aa_profile *aa_current_profile(void) ...@@ -152,7 +152,7 @@ static inline struct aa_profile *aa_current_profile(void)
struct aa_profile *profile; struct aa_profile *profile;
BUG_ON(!cxt || !cxt->profile); BUG_ON(!cxt || !cxt->profile);
if (PROFILE_INVALID(cxt->profile)) { if (profile_is_stale(cxt->profile)) {
profile = aa_get_newest_profile(cxt->profile); profile = aa_get_newest_profile(cxt->profile);
aa_replace_current_profile(profile); aa_replace_current_profile(profile);
aa_put_profile(profile); aa_put_profile(profile);
......
...@@ -46,7 +46,7 @@ extern const char *const aa_profile_mode_names[]; ...@@ -46,7 +46,7 @@ extern const char *const aa_profile_mode_names[];
#define PROFILE_IS_HAT(_profile) ((_profile)->flags & PFLAG_HAT) #define PROFILE_IS_HAT(_profile) ((_profile)->flags & PFLAG_HAT)
#define PROFILE_INVALID(_profile) ((_profile)->flags & PFLAG_INVALID) #define profile_is_stale(_profile) ((_profile)->flags & PFLAG_STALE)
#define on_list_rcu(X) (!list_empty(X) && (X)->prev != LIST_POISON2) #define on_list_rcu(X) (!list_empty(X) && (X)->prev != LIST_POISON2)
...@@ -71,7 +71,7 @@ enum profile_flags { ...@@ -71,7 +71,7 @@ enum profile_flags {
PFLAG_USER_DEFINED = 0x20, /* user based profile - lower privs */ PFLAG_USER_DEFINED = 0x20, /* user based profile - lower privs */
PFLAG_NO_LIST_REF = 0x40, /* list doesn't keep profile ref */ PFLAG_NO_LIST_REF = 0x40, /* list doesn't keep profile ref */
PFLAG_OLD_NULL_TRANS = 0x100, /* use // as the null transition */ PFLAG_OLD_NULL_TRANS = 0x100, /* use // as the null transition */
PFLAG_INVALID = 0x200, /* profile replaced/removed */ PFLAG_STALE = 0x200, /* profile replaced/removed */
PFLAG_NS_COUNT = 0x400, /* carries NS ref count */ PFLAG_NS_COUNT = 0x400, /* carries NS ref count */
/* These flags must correspond with PATH_flags */ /* These flags must correspond with PATH_flags */
...@@ -253,7 +253,7 @@ static inline struct aa_profile *aa_get_newest_profile(struct aa_profile *p) ...@@ -253,7 +253,7 @@ static inline struct aa_profile *aa_get_newest_profile(struct aa_profile *p)
if (!p) if (!p)
return NULL; return NULL;
if (PROFILE_INVALID(p)) if (profile_is_stale(p))
return aa_get_profile_rcu(&p->replacedby->profile); return aa_get_profile_rcu(&p->replacedby->profile);
return aa_get_profile(p); return aa_get_profile(p);
......
...@@ -106,7 +106,7 @@ void __aa_update_replacedby(struct aa_profile *orig, struct aa_profile *new) ...@@ -106,7 +106,7 @@ void __aa_update_replacedby(struct aa_profile *orig, struct aa_profile *new)
tmp = rcu_dereference_protected(orig->replacedby->profile, tmp = rcu_dereference_protected(orig->replacedby->profile,
mutex_is_locked(&orig->ns->lock)); mutex_is_locked(&orig->ns->lock));
rcu_assign_pointer(orig->replacedby->profile, aa_get_profile(new)); rcu_assign_pointer(orig->replacedby->profile, aa_get_profile(new));
orig->flags |= PFLAG_INVALID; orig->flags |= PFLAG_STALE;
aa_put_profile(tmp); aa_put_profile(tmp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment