History

MIPS: Add new AUDIT_ARCH token for the N32 ABI on MIPS64

A MIPS64 kernel may support ELF files for all 3 MIPS ABIs (O32, N32, N64). Furthermore, the AUDIT_ARCH_MIPS{,EL}64 token does not provide enough information about the ABI for the 64-bit process. As a result of which, userland needs to use complex seccomp filters to decide whether a syscall belongs to the o32 or n32 or n64 ABI. Therefore, a new arch token for MIPS64/n32 is added so it can be used by seccomp to explicitely set syscall filters for this ABI.

Markos Chandras committed 12 years ago

Commit f2d08011 parent 367f0b52 files · +14 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/audit.h+12−0
@@ -331,9 +331,17 @@ enum { · 330 unmodified lines
331331 #define AUDIT_FAIL_PRINTK 1
332332 #define AUDIT_FAIL_PANIC 2
333333
334+/*
335+ * These bits disambiguate different calling conventions that share an
336+ * ELF machine type, bitness, and endianness
337+ */
338+#define __AUDIT_ARCH_CONVENTION_MASK 0x30000000
339+#define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000
340+
334341 /* distinguish syscall tables */
335342 #define __AUDIT_ARCH_64BIT 0x80000000
336343 #define __AUDIT_ARCH_LE 0x40000000
344+
337345 #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
338346 #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
339347 #define AUDIT_ARCH_ARMEB (EM_ARM)
@@ -346,7 +354,11 @@ enum { · 6 unmodified lines
346354 #define AUDIT_ARCH_MIPS (EM_MIPS)
347355 #define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
348356 #define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
357+#define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\
358+ __AUDIT_ARCH_CONVENTION_MIPS64_N32)
349359 #define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
360+#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE\
361+ __AUDIT_ARCH_CONVENTION_MIPS64_N32)
350362 #define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
351363 #define AUDIT_ARCH_PARISC (EM_PARISC)
352364 #define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t