diff options
author | John Johansen <john.johansen@canonical.com> | 2013-02-19 01:03:34 +0100 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2013-04-28 09:35:53 +0200 |
commit | 3cfcc19e0b5390c04cb5bfa4e8fde39395410e61 (patch) | |
tree | 6ce52c3cc5166390814b9451d58badcfee9a3770 /security/apparmor/ipc.c | |
parent | apparmor: fix error code to failure message mapping for name lookup (diff) | |
download | linux-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/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; } |