audit: Use struct net not pid_t to remember the network namespce to reply in
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 28 Feb 2014 18:49:05 +0000 (10:49 -0800)
committerEric Paris <eparis@redhat.com>
Thu, 20 Mar 2014 14:10:53 +0000 (10:10 -0400)
commit638a0fd2a062568c568661be0a780be8e8836d03
treee250ef6ef5ddf0ff6c189362b5e125c3a7bc402e
parent3f1c82502c299da08b7b7f08b435212e51166ed9
audit: Use struct net not pid_t to remember the network namespce to reply in

While reading through 3.14-rc1 I found a pretty siginficant mishandling
of network namespaces in the recent audit changes.

In struct audit_netlink_list and audit_reply add a reference to the
network namespace of the caller and remove the userspace pid of the
caller.  This cleanly remembers the callers network namespace, and
removes a huge class of races and nasty failure modes that can occur
when attempting to relook up the callers network namespace from a pid_t
(including the caller's network namespace changing, pid wraparound, and
the pid simply not being present).

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
kernel/audit.c
kernel/audit.h
kernel/auditfilter.c