Audit system development
 help / color / mirror / Atom feed
From: Stanislav Kinsburskii <skinsburskii@gmail.com>
To: Shuah Khan <shuah@kernel.org>, Paul Moore <paul@paul-moore.com>,
	Eric Paris <eparis@redhat.com>, Al Viro <viro@zeniv.linux.org.uk>,
	Amy Griffis <amy.griffis@hp.com>
Cc: Frank Hofmann <hofmann@deshaw.com>,
	Noah Orlando <orlandon@deshaw.com>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	audit@vger.kernel.org
Subject: Re: [PATCH 0/3] audit: Measure and reduce syscall filtering overhead
Date: Sun, 23 Aug 2026 11:10:35 -0700	[thread overview]
Message-ID: <aos3m2wG3To3wCeo@skinsburskii> (raw)
In-Reply-To: <20260806-audit-v1-0-ddd0d94ff0b6@gmail.com>

On Thu, Aug 06, 2026 at 06:01:18PM -0700, Stanislav Kinsburskii wrote:
> This series adds a repeatable microbenchmark for audit's fixed syscall
> overhead and uses it to address two cases where audit continues doing work
> which cannot produce a record.
> 

A gentle ping on this series.

Thanks,
Stanislav

> Patch 1 adds audit_bench, a manually run getpid(2) microbenchmark under
> tools/testing/selftests/audit.  It leaves policy management to the caller
> so the same workload can measure different rule configurations without
> silently changing the system policy.
> 
> Patch 2 fixes audit_n_rules and audit_signals accounting when rules are
> removed automatically with a watch or tree, or after an LSM rule update
> fails.  These paths could leave the counters nonzero after the last
> applicable rule had disappeared, causing every subsequent syscall to
> allocate a non-dummy audit context.  It also centralizes rule accounting
> so all rule removal paths share the same bookkeeping.
> 
> The median getpid latency in the same unpinned VM was:
> 
>                                   no rules   stale state   fixed
>   automatically removed watch       38 ns       55 ns      38 ns
>   automatically removed tree        38 ns       59 ns      38 ns
> 
> Patch 3 builds on those lifecycle helpers.  It maintains an aggregate mask
> of the syscall numbers present in exit rules and checks that mask before
> walking the exit filter list.  The mask is architecture-independent and
> therefore conservative: overlapping syscall numbers may cause an
> unnecessary scan, but cannot suppress a match.
> 
> For an unrelated getpid workload, the median latency scaled as follows:
> 
>   exit rules                         1       32      128      256
>   before                            55 ns    71 ns   428 ns   791 ns
>   after                             55 ns    55 ns    55 ns    55 ns
> 
> The aggregate mask is updated through the centralized accounting helpers.
> Insertion sets the relevant bits before publishing the rule with
> list_add_rcu(); removal unlinks the rule before clearing them.  This keeps
> the lockless rejection test conservative during concurrent rule changes.
> 
> The series does not change the audit userspace ABI or rule matching
> semantics.  The benchmark and complete reproduction procedures are
> documented in the individual patches.
> 
> ---
> Stanislav Kinsburskii (3):
>       selftests/audit: Add syscall overhead benchmark
>       audit: Fix filter rule accounting after automatic removal
>       audit: Skip exit filtering for syscalls without rules
> 
>  MAINTAINERS                                 |   1 +
>  kernel/audit.h                              |   7 +
>  kernel/audit_tree.c                         |   1 +
>  kernel/audit_watch.c                        |   2 +
>  kernel/auditfilter.c                        | 140 +++++++++++------
>  kernel/auditsc.c                            |  13 ++
>  tools/testing/selftests/Makefile            |   1 +
>  tools/testing/selftests/audit/.gitignore    |   2 +
>  tools/testing/selftests/audit/Makefile      |   9 ++
>  tools/testing/selftests/audit/README        |  30 ++++
>  tools/testing/selftests/audit/audit_bench.c | 227 ++++++++++++++++++++++++++++
>  11 files changed, 389 insertions(+), 44 deletions(-)
> ---
> base-commit: ea2bff00da89d7767d677bb68470130ba96f4928
> change-id: 20260806-audit-96a1e71d38b1
> 
> Best regards,
> -- 
> Stanislav Kinsburskii <skinsburskii@gmail.com>
> 

  parent reply	other threads:[~2026-08-23 18:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  1:01 [PATCH 0/3] audit: Measure and reduce syscall filtering overhead Stanislav Kinsburskii
2026-08-07  1:01 ` [PATCH 1/3] selftests/audit: Add syscall overhead benchmark Stanislav Kinsburskii
2026-08-07  1:01 ` [PATCH 2/3] audit: Fix filter rule accounting after automatic removal Stanislav Kinsburskii
2026-08-07  1:01 ` [PATCH 3/3] audit: Skip exit filtering for syscalls without rules Stanislav Kinsburskii
2026-08-23 18:10 ` Stanislav Kinsburskii [this message]
2026-08-25  1:56   ` [PATCH 0/3] audit: Measure and reduce syscall filtering overhead Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aos3m2wG3To3wCeo@skinsburskii \
    --to=skinsburskii@gmail.com \
    --cc=amy.griffis@hp.com \
    --cc=audit@vger.kernel.org \
    --cc=eparis@redhat.com \
    --cc=hofmann@deshaw.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=orlandon@deshaw.com \
    --cc=paul@paul-moore.com \
    --cc=shuah@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox