From: Paul Moore <paul@paul-moore.com>
To: yang.yang29@zte.com.cn
Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC, v1, 1/1] audit: speed up syscall rule match while exiting syscall
Date: Wed, 13 Jan 2021 08:47:56 -0500 [thread overview]
Message-ID: <CAHC9VhSB0UvbQZbCa4hTHgnx23+9FR-P+ytXw547c7YjSH0rMw@mail.gmail.com> (raw)
In-Reply-To: <202101132038409309743@zte.com.cn>
On Wed, Jan 13, 2021 at 7:39 AM <yang.yang29@zte.com.cn> wrote:
> From 82ebcf43481be21ee3e32ec1749b42f651737880 Mon Sep 17 00:00:00 2001
> From: Yang Yang <yang.yang29@zte.com.cn>
> Date: Wed, 13 Jan 2021 20:18:04 +0800
> Subject: [PATCH] [RFC,v1,1/1] speed up syscall rule match while exiting syscall
> If user add any syscall rule, in all syscalls, audit_filter_syscall()
> traverses struct list_head audit_filter_list to find out whether current
> syscall match one rule. This takes o(n), which is not necessary, specially
> for user who add a very few syscall rules. On the other hand, user may not
> much care about rule add/delete speed. So do o(n) calculate at rule changing,
> and ease the burden of audit_filter_syscall().
>
> Define audit_syscall[NR_syscalls], every element stands for one syscall.
> audit_filter_syscall() checks audit_syscall[NR_syscalls].
> audit_syscall[n] == 0 indicates no rule audit syscall n, do a quick exit.
> audit_syscall[n] > 0 indicates at least one rule audit syscall n.
> audit_syscall[n] update when syscall rule changes.
>
> Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
> ---
> include/linux/audit.h | 2 ++
> kernel/audit.c | 2 ++
> kernel/auditfilter.c | 16 ++++++++++++++++
> kernel/auditsc.c | 9 ++++++++-
> 4 files changed, 28 insertions(+), 1 deletion(-)
Before we go too far into a review of this patch, please provide some
performance measurements using a variety of rule counts, both common
and extreme, so that we can better judge the benefits of this patch.
The measurements should include both the rule add/delete time deltas
as well as the impact on the syscall invocations. If non-obvious,
please also include how you performed the measurements and captured
the data.
These are good things to include in the commit description when
submitting patches focused on improving performance.
--
paul moore
www.paul-moore.com
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
prev parent reply other threads:[~2021-01-13 13:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 12:38 [RFC,v1,1/1] audit: speed up syscall rule match while exiting syscall yang.yang29
2021-01-13 13:47 ` Paul Moore [this message]
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=CAHC9VhSB0UvbQZbCa4hTHgnx23+9FR-P+ytXw547c7YjSH0rMw@mail.gmail.com \
--to=paul@paul-moore.com \
--cc=linux-audit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yang.yang29@zte.com.cn \
/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;
as well as URLs for NNTP newsgroup(s).