How to define audit rule for one bit *not* set for a syscall argument?

Richard Du duxiong at gmail.com
Thu Mar 9 02:07:14 UTC 2023


Yes, the case is that we would like to filter out the "thread creation" and
only keep the "process creation", by excluding the CLONE_THREAD flag bit of
a0 of clone() syscall.
Without the audit comparator support for this case, we have to filter out
the "thread creation" in user space which introduces a performance penalty.

Regards,
Richard

On Thu, Mar 9, 2023 at 6:22 AM Steve Grubb <sgrubb at redhat.com> wrote:

> Hello,
>
> On Wednesday, March 8, 2023 8:46:57 AM EST Richard Du wrote:
> > I'm trying to define an audit rule with auditctl for clone() syscall,
> and I
> > would expect that the a0 of clone() syscall (i.e. the clone_flags
> > argument) without the CLONE_THREAD flag bit being set.
> >
> > int clone(int (*fn)(void *), void *stack, int flags, void *arg, ...
> >                  /* pid_t *parent_tid, void *tls, pid_t *child_tid */ );
> >
> > From man page of auditctl, -F option build a rule file: name, operation,
> > value.
> > -F [n=v | n!=v | n<v | n>v | n<=v | n>=v | n&v | n&=v]
> >
> > I can understand that, the n&v (Audit_bitmask) means any bit of a bitmast
> > is set, and the n&=v (Audit_bittest) means all bits of a bitmask are set.
> >
> > While my question is, how to build a rule which means "none of bit of a
> > bitmask is set", i.e. ( ! n&=v ). If the current audit comparator dosen't
> > support this, can we add the support in furture?
>
> The comparator does not support this. This is a corner case in which this
> is
> the first time someone ever needed it.
>
> -Steve
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-audit/attachments/20230309/76e5c8f1/attachment.htm>


More information about the Linux-audit mailing list