]> granicus.if.org Git - strace/commitdiff
filter_seccomp: fix build on antique systems
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 9 Oct 2019 09:24:06 +0000 (09:24 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 9 Oct 2019 09:24:06 +0000 (09:24 +0000)
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"
NEWS
filter_seccomp.c
tests/filter_seccomp-flag.c

diff --git a/NEWS b/NEWS
index a2dbfbfd35108a5c3f180045fa0ecc2a5b1f3463..4ff2fd8550f72333acbe1702a0c5cebed7a64c72 100644 (file)
--- 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)
 ==============================================
index 4b4c51fbe0a8a54ffc3fb7d4fc6eaa92a471ac3c..c9c58cd02435778da3fc57dfa3804be1857f0b9c 100644 (file)
@@ -13,7 +13,6 @@
 #include <signal.h>
 #include <sys/prctl.h>
 #include <sys/wait.h>
-#include <linux/audit.h>
 #include <linux/filter.h>
 
 #include "filter_seccomp.h"
@@ -28,6 +27,15 @@ bool seccomp_before_sysentry;
 
 # include <linux/seccomp.h>
 
+/* PERSONALITY*_AUDIT_ARCH definitions depend on AUDIT_ARCH_* constants.  */
+# ifdef PERSONALITY0_AUDIT_ARCH
+#  include <linux/audit.h>
+#  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
index 12c3f916cf0ad30cf512a1868ea43ef6beb64cec..1dff6c7673cbb6dcd8a61fded8d7c23f698a67ba 100644 (file)
 #include "arch_defs.h"
 #include "sysent.h"
 #include "scno.h"
-#include <linux/audit.h>
+
+/* PERSONALITY*_AUDIT_ARCH definitions depend on AUDIT_ARCH_* constants.  */
+#ifdef PERSONALITY0_AUDIT_ARCH
+# include <linux/audit.h>
+# 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