diff options
author | Paul Moore <pmoore@redhat.com> | 2015-05-07 15:35:23 -0400 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2015-05-07 15:35:23 -0400 |
commit | f8de89b8764afa1e714e7b6d1c2247a655ed5470 (patch) | |
tree | 249215a79c073d473d7708e883f722f57d5d398f /include | |
parent | 4367b1b4f94ca1e0c0606ff85622f2ecb1a9c278 (diff) | |
download | libseccomp-f8de89b8764afa1e714e7b6d1c2247a655ed5470.tar.gz |
all: ensure the ARM and MIPS system defines are present
On some really old systems the ELF and or Audit ABI/arch defines are
missing, this patch provides our own #defines in these cases.
Reported-by: Vincent.Riera@imgtec.com
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/seccomp.h.in | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/include/seccomp.h.in b/include/seccomp.h.in index d3b3a60..0751191 100644 --- a/include/seccomp.h.in +++ b/include/seccomp.h.in @@ -121,10 +121,13 @@ struct scmp_arg_cmp { * The ARM architecture tokens */ #define SCMP_ARCH_ARM AUDIT_ARCH_ARM -#ifndef AUDIT_ARCH_AARCH64 /* AArch64 support for audit was merged in 3.17-rc1 */ +#ifndef AUDIT_ARCH_AARCH64 +#ifndef EM_AARCH64 +#define EM_AARCH64 183 +#endif /* EM_AARCH64 */ #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) -#endif +#endif /* AUDIT_ARCH_AARCH64 */ #define SCMP_ARCH_AARCH64 AUDIT_ARCH_AARCH64 /** @@ -133,21 +136,30 @@ struct scmp_arg_cmp { #ifndef __AUDIT_ARCH_CONVENTION_MIPS64_N32 #define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000 #endif -#define SCMP_ARCH_MIPS AUDIT_ARCH_MIPS -#define SCMP_ARCH_MIPS64 AUDIT_ARCH_MIPS64 -#ifndef AUDIT_ARCH_MIPS64N32 +#ifndef EM_MIPS +#define EM_MIPS 8 +#endif +#ifndef AUDIT_ARCH_MIPS +#define AUDIT_ARCH_MIPS (EM_MIPS) +#endif +#ifndef AUDIT_ARCH_MIPS64 +#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT) +#endif /* MIPS64N32 support was merged in 3.15 */ +#ifndef AUDIT_ARCH_MIPS64N32 #define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\ __AUDIT_ARCH_CONVENTION_MIPS64_N32) #endif -#define SCMP_ARCH_MIPS64N32 AUDIT_ARCH_MIPS64N32 -#define SCMP_ARCH_MIPSEL AUDIT_ARCH_MIPSEL -#define SCMP_ARCH_MIPSEL64 AUDIT_ARCH_MIPSEL64 -#ifndef AUDIT_ARCH_MIPSEL64N32 /* MIPSEL64N32 support was merged in 3.15 */ +#ifndef AUDIT_ARCH_MIPSEL64N32 #define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\ __AUDIT_ARCH_CONVENTION_MIPS64_N32) #endif +#define SCMP_ARCH_MIPS AUDIT_ARCH_MIPS +#define SCMP_ARCH_MIPS64 AUDIT_ARCH_MIPS64 +#define SCMP_ARCH_MIPS64N32 AUDIT_ARCH_MIPS64N32 +#define SCMP_ARCH_MIPSEL AUDIT_ARCH_MIPSEL +#define SCMP_ARCH_MIPSEL64 AUDIT_ARCH_MIPSEL64 #define SCMP_ARCH_MIPSEL64N32 AUDIT_ARCH_MIPSEL64N32 /** |