Commit adaa9a3f authored by Gaosheng Cui's avatar Gaosheng Cui Committed by John Johansen

apparmor: Simplify obtain the newest label on a cred

In aa_get_task_label(), aa_get_newest_cred_label(__task_cred(task))
can do the same things as aa_get_newest_label(__aa_task_raw_label(task)),
so we can replace it and remove __aa_task_raw_label() to simplify the code.
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 1f939c6b
...@@ -63,19 +63,6 @@ static inline struct aa_label *aa_get_newest_cred_label(const struct cred *cred) ...@@ -63,19 +63,6 @@ static inline struct aa_label *aa_get_newest_cred_label(const struct cred *cred)
return aa_get_newest_label(aa_cred_raw_label(cred)); return aa_get_newest_label(aa_cred_raw_label(cred));
} }
/**
* __aa_task_raw_label - retrieve another task's label
* @task: task to query (NOT NULL)
*
* Returns: @task's label without incrementing its ref count
*
* If @task != current needs to be called in RCU safe critical section
*/
static inline struct aa_label *__aa_task_raw_label(struct task_struct *task)
{
return aa_cred_raw_label(__task_cred(task));
}
/** /**
* aa_current_raw_label - find the current tasks confining label * aa_current_raw_label - find the current tasks confining label
* *
......
...@@ -31,7 +31,7 @@ struct aa_label *aa_get_task_label(struct task_struct *task) ...@@ -31,7 +31,7 @@ struct aa_label *aa_get_task_label(struct task_struct *task)
struct aa_label *p; struct aa_label *p;
rcu_read_lock(); rcu_read_lock();
p = aa_get_newest_label(__aa_task_raw_label(task)); p = aa_get_newest_cred_label(__task_cred(task));
rcu_read_unlock(); rcu_read_unlock();
return p; return p;
......
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