audit: don't attempt to lookup PIDs when changing PID filtering audit rules
authorPaul Moore <pmoore@redhat.com>
Fri, 19 Dec 2014 23:35:53 +0000 (18:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:27:48 +0000 (10:27 -0800)
commit9942150051431179cdb83d696b73b8f93cc2b691
tree60c9cc4684743e2298add58a5a3f3ec8156beb40
parenta1a4aaff1a325495679452590e3e2a044bd8cd90
audit: don't attempt to lookup PIDs when changing PID filtering audit rules

commit 3640dcfa4fd00cd91d88bb86250bdb496f7070c0 upstream.

Commit f1dc4867 ("audit: anchor all pid references in the initial pid
namespace") introduced a find_vpid() call when adding/removing audit
rules with PID/PPID filters; unfortunately this is problematic as
find_vpid() only works if there is a task with the associated PID
alive on the system.  The following commands demonstrate a simple
reproducer.

# auditctl -D
# auditctl -l
# autrace /bin/true
# auditctl -l

This patch resolves the problem by simply using the PID provided by
the user without any additional validation, e.g. no calls to check to
see if the task/PID exists.

Cc: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/auditfilter.c