summaryrefslogtreecommitdiffstats
path: root/security/apparmor/context.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2013-02-19 01:03:34 +0100
committerJohn Johansen <john.johansen@canonical.com>2013-04-28 09:35:53 +0200
commit3cfcc19e0b5390c04cb5bfa4e8fde39395410e61 (patch)
tree6ce52c3cc5166390814b9451d58badcfee9a3770 /security/apparmor/context.c
parentapparmor: fix error code to failure message mapping for name lookup (diff)
downloadlinux-3cfcc19e0b5390c04cb5bfa4e8fde39395410e61.tar.xz
linux-3cfcc19e0b5390c04cb5bfa4e8fde39395410e61.zip
apparmor: add utility function to get an arbitrary tasks profile.
Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Steve Beattie <sbeattie@ubuntu.com>
Diffstat (limited to 'security/apparmor/context.c')
-rw-r--r--security/apparmor/context.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/security/apparmor/context.c b/security/apparmor/context.c
index 8a9b5027c813..611e6ce70b03 100644
--- a/security/apparmor/context.c
+++ b/security/apparmor/context.c
@@ -69,6 +69,23 @@ void aa_dup_task_context(struct aa_task_cxt *new, const struct aa_task_cxt *old)
}
/**
+ * aa_get_task_profile - Get another task's profile
+ * @task: task to query (NOT NULL)
+ *
+ * Returns: counted reference to @task's profile
+ */
+struct aa_profile *aa_get_task_profile(struct task_struct *task)
+{
+ struct aa_profile *p;
+
+ rcu_read_lock();
+ p = aa_get_profile(__aa_task_profile(task));
+ rcu_read_unlock();
+
+ return p;
+}
+
+/**
* aa_replace_current_profile - replace the current tasks profiles
* @profile: new profile (NOT NULL)
*