Re: [PATCH] apparmor: add missing rcu_dereference()
From: John Johansen
Date: Thu Dec 08 2011 - 19:50:08 EST
On 12/08/2011 04:25 PM, Kees Cook wrote:
> Adds a missed rcu_dereference() around real_parent.
>
> Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
> ---
> security/apparmor/audit.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/security/apparmor/audit.c b/security/apparmor/audit.c
> index 96502b2..f3fafed 100644
> --- a/security/apparmor/audit.c
> +++ b/security/apparmor/audit.c
> @@ -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) {
yep.
Acked-by: John Johansen <john.johansen@xxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/