apparmor: add missing rcu_dereference()
authorKees Cook <keescook@chromium.org>
Fri, 9 Dec 2011 00:25:48 +0000 (16:25 -0800)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:23:29 +0000 (13:23 -0700)
Adds a missed rcu_dereference() around real_parent.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: James Morris <jmorris@namei.org>
(cherry picked from commit 2053c4727c5a891bf182397e425b6cb87b2ae613)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

security/apparmor/audit.c

index 96502b2..f3fafed 100644 (file)
@@ -133,7 +133,7 @@ static void audit_pre(struct audit_buffer *ab, void *ca)
                struct aa_profile *profile = sa->aad.profile;
                pid_t pid;
                rcu_read_lock();
-               pid = tsk->real_parent->pid;
+               pid = rcu_dereference(tsk->real_parent)->pid;
                rcu_read_unlock();
                audit_log_format(ab, " parent=%d", pid);
                if (profile->ns != root_ns) {