[PATCH v4 4/4] tests: test cases for seccomp-assisted syscall filtering

Dmitry V. Levin ldv at altlinux.org
Sat Aug 31 22:44:34 UTC 2019


On Sat, Aug 31, 2019 at 07:26:39PM +0300, Dmitry V. Levin wrote:
> On Thu, Aug 29, 2019 at 04:01:13PM +0200, Paul Chaignon wrote:
[...]
> > diff --git a/tests/filter_seccomp-flag.c b/tests/filter_seccomp-flag.c
> > new file mode 100644
> > index 00000000..1b8a51f9
> > --- /dev/null
> > +++ b/tests/filter_seccomp-flag.c
> > @@ -0,0 +1,80 @@
> > +/*
> > + * Check syscall numbers do not conflict with seccomp-filter flags.

 * Check that syscall numbers do not conflict with seccomp filter flags.

> > + *
> > + * Copyright (c) 2019 Paul Chaignon <paul.chaignon at gmail.com>
> > + * All rights reserved.
> > + *
> > + * SPDX-License-Identifier: GPL-2.0-or-later
> > + */
> > +
> > +#include <linux/audit.h>
> > +#include <asm/unistd.h>
> > +#include "defs.h"

We use tests.h instead of defs.h in tests.  This should work:

+#include "tests.h"
+#include "arch_defs.h"
+#include "sysent.h"
+#include "scno.h"
 #include <linux/audit.h>
-#include <asm/unistd.h>
-#include "defs.h"

> > +
> > +
> > +/* Define these shorthand notations to simplify the syscallent files. */
> > +#include "sysent_shorthand_defs.h"
> > +
> > +#define SEN(syscall_name) 0, 0

No need to redefine SEN when tests.h is used.

> > +
> > +const struct_sysent sysent0[] = {
> > +#include "syscallent.h"
> > +};
> > +
> > +#if SUPPORTED_PERSONALITIES > 1
> > +# include PERSONALITY1_INCLUDE_FUNCS

This include is not needed here.

> > +static const struct_sysent sysent1[] = {
> > +# include "syscallent1.h"
> > +};
> > +#endif
> > +
> > +#if SUPPORTED_PERSONALITIES > 2
> > +# include PERSONALITY2_INCLUDE_FUNCS

Likewise, this include is not needed here.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190901/c844390a/attachment.bin>


More information about the Strace-devel mailing list