diff options
author | John Johansen <john.johansen@canonical.com> | 2013-02-18 16:03:34 -0800 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2013-04-28 00:35:53 -0700 |
commit | 3cfcc19e0b5390c04cb5bfa4e8fde39395410e61 (patch) | |
tree | 6ce52c3cc5166390814b9451d58badcfee9a3770 /security/apparmor/ipc.c | |
parent | e573cc30bb36df23fb49a29d96e6c6333d17f59c (diff) | |
download | blackbird-op-linux-3cfcc19e0b5390c04cb5bfa4e8fde39395410e61.tar.gz blackbird-op-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/ipc.c')
-rw-r--r-- | security/apparmor/ipc.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c index cf1071b14232..c51d2266587e 100644 --- a/security/apparmor/ipc.c +++ b/security/apparmor/ipc.c @@ -95,23 +95,18 @@ int aa_ptrace(struct task_struct *tracer, struct task_struct *tracee, * - tracer profile has CAP_SYS_PTRACE */ - struct aa_profile *tracer_p; - /* cred released below */ - const struct cred *cred = get_task_cred(tracer); + struct aa_profile *tracer_p = aa_get_task_profile(tracer); int error = 0; - tracer_p = aa_cred_profile(cred); if (!unconfined(tracer_p)) { - /* lcred released below */ - const struct cred *lcred = get_task_cred(tracee); - struct aa_profile *tracee_p = aa_cred_profile(lcred); + struct aa_profile *tracee_p = aa_get_task_profile(tracee); error = aa_may_ptrace(tracer, tracer_p, tracee_p, mode); error = aa_audit_ptrace(tracer_p, tracee_p, error); - put_cred(lcred); + aa_put_profile(tracee_p); } - put_cred(cred); + aa_put_profile(tracer_p); return error; } |