lkml.org 
[lkml]   [2013]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/3] audit: remove audit_log_start() contention in AUDIT_USER type calls
Date
There is a race condition between systemd and auditd:

systemd |auditd
-------------------------------------------+-----------------------------------
... |
-> audit_receive |...
-> mutex_lock(&audit_cmd_mutex) |-> audit_receive
... -> audit_log_start | -> mutex_lock(&audit_cmd_mutex)
-> wait_for_auditd | // wait for systemd
-> schedule_timeout(60*HZ) |

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.

The idea of dropping the lock at the top of audit_receive_msg() isn't as clean
as I had hoped, with AUDIT_ADD_RULE, AUDIT_TRIM, AUDIT_MAKE_EQUIV all
potentially allocating additional audit buffers indirectly through
trim_marked(). It may make sense to have trim_marked() send its queue through
a new thread.

Richard Guy Briggs (3):
selinux: call WARN_ONCE() instead of calling audit_log_start()
smack: call WARN_ONCE() instead of calling audit_log_start()
audit: drop audit_cmd_lock in AUDIT_USER family of cases

kernel/audit.c | 2 ++
security/selinux/ss/services.c | 12 ++++--------
security/smack/smack_lsm.c | 5 ++---
3 files changed, 8 insertions(+), 11 deletions(-)



\
 
 \ /
  Last update: 2013-12-05 04:21    [W:0.099 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site