Skip to content

Audit backlog queue fixes related to soft lockup

Richard Guy Briggs linux-audit lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8audit: avoid soft lockup due to audit_log_start() incorrect loop terminationkernel/audit.c+3 -20 replies
2/8audit: reset audit backlog wait time after error recoverykernel/audit.c+4 -10 replies
3/8audit: make use of remaining sleep time from wait_for_auditdkernel/audit.c+8 -40 replies
4/8audit: efficiency fix 1: only wake up if queue shorter than backlog limitkernel/audit.c+3 -10 replies
5/8audit: efficiency fix 2: request exclusive wait since all need same resourcekernel/audit.c+1 -10 replies
6/8audit: add boot option to override default backlog limitkernel/audit.c+13 -10 replies
7/8audit: clean up AUDIT_GET/SET local variables and future-proof APIkernel/audit.c+27 -243 replies
8/8audit: add audit_backlog_wait_time configuration optioninclude/uapi/linux/audit.h kernel/audit.c+23 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] Audit backlog queue fixes related to soft lockup

This patchset covers a number of issues surrounding the audit backlog queue. The original trigger was a bug in a patch to fix code that produced negative sleep times (commit 82919919). This bug caused soft lockups. There were a number of other issues raised surrounding this bug which have been attempted to be addressed in this patchset.

The first patch fixes this obvious bug.

The 2nd fixes the lack of reset to the original wait time that was set to zero under error conditions should the system recover from the conditions that tickled the first bug.

The 3rd makes use of the remaining timeout to avoid re-checking the loop conditions on error.

The 4th and 5th are efficiency fixes for waking up waiting processes only when necessary.

The 6th adds a boot parameter to temporarily override the backlog queue length in case more buffers are needed before auditd is available.

The 7th and 8th are to add a config option to make the backlog wait time configurable from the hard-coded default.

Richard Guy Briggs (8):
audit: avoid soft lockup due to audit_log_start() incorrect loop
termination
audit: reset audit backlog wait time after error recovery
audit: make use of remaining sleep time from wait_for_auditd
audit: efficiency fix 1: only wake up if queue shorter than backlog
limit
audit: efficiency fix 2: request exclusive wait since all need same
resource
audit: add boot option to override default backlog limit
audit: clean up AUDIT_GET/SET local variables and future-proof API
audit: add audit_backlog_wait_time configuration option

 include/uapi/linux/audit.h |    2 +
 kernel/audit.c             |  111 +++++++++++++++++++++++++++++++-------------
 2 files changed, 80 insertions(+), 33 deletions(-)