audit: drop audit_cmd_lock in AUDIT_USER family of cases
authorRichard Guy Briggs <rgb@redhat.com>
Mon, 2 Dec 2013 16:33:01 +0000 (11:33 -0500)
committerEric Paris <eparis@redhat.com>
Tue, 14 Jan 2014 03:32:11 +0000 (22:32 -0500)
commit1b7b533f65db9b31f76972b2899ec7ec6433ae77
tree8b06c5c5fd3a8844647c66a75f63d2bf2197cc6a
parent4eb0f4abfb9441849530ea19389ae57cc62c8078
audit: drop audit_cmd_lock in AUDIT_USER family of cases

We do not need to hold the audit_cmd_mutex for this family of cases.  The
possible exception to this is the call to audit_filter_user(), so drop the lock
immediately after.  To help in fixing the race we are trying to avoid, make
sure that nothing called by audit_filter_user() calls audit_log_start().  In
particular, watch out for *_audit_rule_match().

This fix will take care of systemd and anything USING audit.  It still means
that we could race with something configuring audit and auditd shutting down.

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Reported-by: toshi.okajima@jp.fujitsu.com
Tested-by: toshi.okajima@jp.fujitsu.com
Signed-off-by: Eric Paris <eparis@redhat.com>
kernel/audit.c