• Paul Moore's avatar
    audit: improve audit queue handling when "audit=1" on cmdline · f26d0433
    Paul Moore authored
    When an admin enables audit at early boot via the "audit=1" kernel
    command line the audit queue behavior is slightly different; the
    audit subsystem goes to greater lengths to avoid dropping records,
    which unfortunately can result in problems when the audit daemon is
    forcibly stopped for an extended period of time.
    
    This patch makes a number of changes designed to improve the audit
    queuing behavior so that leaving the audit daemon in a stopped state
    for an extended period does not cause a significant impact to the
    system.
    
    - kauditd_send_queue() is now limited to looping through the
      passed queue only once per call.  This not only prevents the
      function from looping indefinitely when records are returned
      to the current queue, it also allows any recovery handling in
      kauditd_thread() to take place when kauditd_send_queue()
      returns.
    
    - Transient netlink send errors seen as -EAGAIN now cause the
      record to be returned to the retry queue ins...
    f26d0433
audit.c 64.8 KB