From: Dmitry V. Levin Date: Wed, 9 Oct 2019 09:24:06 +0000 (+0000) Subject: filter_seccomp: fix build on antique systems X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ce3ceb442a9a94ca4381436d8786dbd14dff8da;p=strace filter_seccomp: fix build on antique systems Fixed build on systems that do not provide necessary definitions of AUDIT_ARCH_* constants. * filter_seccomp.c [PERSONALITY0_AUDIT_ARCH]: Include "xlat/elf_em.h" and "xlat/audit_arch.h" under XLAT_MACROS_ONLY. * tests/filter_seccomp-flag.c: Likewise. * NEWS: Mention this fix. Fixes: v5.3~7 "Introduce seccomp-assisted syscall filtering" --- diff --git a/NEWS b/NEWS index a2dbfbfd..4ff2fd85 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ Noteworthy changes in release ?.? (????-??-??) * Bug fixes * Fixed -b execve when --seccomp-bpf option is specified. * Fixed build on no-MMU architectures. + * Fixed build on antique systems that do not provide necessary definitions + of AUDIT_ARCH_* constants. Noteworthy changes in release 5.3 (2019-09-25) ============================================== diff --git a/filter_seccomp.c b/filter_seccomp.c index 4b4c51fb..c9c58cd0 100644 --- a/filter_seccomp.c +++ b/filter_seccomp.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include "filter_seccomp.h" @@ -28,6 +27,15 @@ bool seccomp_before_sysentry; # include +/* PERSONALITY*_AUDIT_ARCH definitions depend on AUDIT_ARCH_* constants. */ +# ifdef PERSONALITY0_AUDIT_ARCH +# include +# define XLAT_MACROS_ONLY +# include "xlat/elf_em.h" +# include "xlat/audit_arch.h" +# undef XLAT_MACROS_ONLY +# endif + # ifndef BPF_MAXINSNS # define BPF_MAXINSNS 4096 # endif diff --git a/tests/filter_seccomp-flag.c b/tests/filter_seccomp-flag.c index 12c3f916..1dff6c76 100644 --- a/tests/filter_seccomp-flag.c +++ b/tests/filter_seccomp-flag.c @@ -12,7 +12,15 @@ #include "arch_defs.h" #include "sysent.h" #include "scno.h" -#include + +/* PERSONALITY*_AUDIT_ARCH definitions depend on AUDIT_ARCH_* constants. */ +#ifdef PERSONALITY0_AUDIT_ARCH +# include +# define XLAT_MACROS_ONLY +# include "xlat/elf_em.h" +# include "xlat/audit_arch.h" +# undef XLAT_MACROS_ONLY +#endif #ifdef __x86_64__ # ifndef __X32_SYSCALL_BIT