| Index: sandbox/linux/seccomp-bpf/linux_seccomp.h
|
| diff --git a/sandbox/linux/seccomp-bpf/linux_seccomp.h b/sandbox/linux/seccomp-bpf/linux_seccomp.h
|
| index 0de0259da39ecdb745e5923b9a6ff3961c13be00..b56c6f8d81d2de095f6119eb1c09648a499340fe 100644
|
| --- a/sandbox/linux/seccomp-bpf/linux_seccomp.h
|
| +++ b/sandbox/linux/seccomp-bpf/linux_seccomp.h
|
| @@ -124,6 +124,35 @@
|
| #define SECCOMP_ARG_LSB_IDX(nr) (offsetof(struct arch_seccomp_data, args) + \
|
| 8*(nr) + 0)
|
|
|
| +struct pt_regs {
|
| + long int ebx;
|
| + long int ecx;
|
| + long int edx;
|
| + long int esi;
|
| + long int edi;
|
| + long int ebp;
|
| + long int eax;
|
| + long int ds;
|
| + long int es;
|
| + long int fs;
|
| + long int gs;
|
| + long int orig_eax;
|
| + long int eip;
|
| + long int cs;
|
| + long int eflags;
|
| + long int esp;
|
| + long int ss;
|
| +};
|
| +#define SECCOMP_PT_RESULT(_pt_regs) (_pt_regs).eax
|
| +#define SECCOMP_PT_SYSCALL(_pt_regs) (_pt_regs).orig_eax
|
| +#define SECCOMP_PT_IP(_pt_regs) (_pt_regs).eip
|
| +#define SECCOMP_PT_PARM1(_pt_regs) (_pt_regs).ebx
|
| +#define SECCOMP_PT_PARM2(_pt_regs) (_pt_regs).ecx
|
| +#define SECCOMP_PT_PARM3(_pt_regs) (_pt_regs).edx
|
| +#define SECCOMP_PT_PARM4(_pt_regs) (_pt_regs).esi
|
| +#define SECCOMP_PT_PARM5(_pt_regs) (_pt_regs).edi
|
| +#define SECCOMP_PT_PARM6(_pt_regs) (_pt_regs).ebp
|
| +
|
| #elif defined(__x86_64__)
|
| #define MIN_SYSCALL 0u
|
| #define MAX_PUBLIC_SYSCALL 1024u
|
| @@ -151,6 +180,45 @@
|
| #define SECCOMP_ARG_LSB_IDX(nr) (offsetof(struct arch_seccomp_data, args) + \
|
| 8*(nr) + 0)
|
|
|
| +struct pt_regs {
|
| + unsigned long int r15;
|
| + unsigned long int r14;
|
| + unsigned long int r13;
|
| + unsigned long int r12;
|
| + unsigned long int rbp;
|
| + unsigned long int rbx;
|
| + unsigned long int r11;
|
| + unsigned long int r10;
|
| + unsigned long int r9;
|
| + unsigned long int r8;
|
| + unsigned long int rax;
|
| + unsigned long int rcx;
|
| + unsigned long int rdx;
|
| + unsigned long int rsi;
|
| + unsigned long int rdi;
|
| + unsigned long int orig_rax;
|
| + unsigned long int rip;
|
| + unsigned long int cs;
|
| + unsigned long int eflags;
|
| + unsigned long int rsp;
|
| + unsigned long int ss;
|
| + unsigned long int fs_base;
|
| + unsigned long int gs_base;
|
| + unsigned long int ds;
|
| + unsigned long int es;
|
| + unsigned long int fs;
|
| + unsigned long int gs;
|
| +};
|
| +#define SECCOMP_PT_RESULT(_pt_regs) (_pt_regs).rax
|
| +#define SECCOMP_PT_SYSCALL(_pt_regs) (_pt_regs).orig_rax
|
| +#define SECCOMP_PT_IP(_pt_regs) (_pt_regs).rip
|
| +#define SECCOMP_PT_PARM1(_pt_regs) (_pt_regs).rdi
|
| +#define SECCOMP_PT_PARM2(_pt_regs) (_pt_regs).rsi
|
| +#define SECCOMP_PT_PARM3(_pt_regs) (_pt_regs).rdx
|
| +#define SECCOMP_PT_PARM4(_pt_regs) (_pt_regs).r10
|
| +#define SECCOMP_PT_PARM5(_pt_regs) (_pt_regs).r8
|
| +#define SECCOMP_PT_PARM6(_pt_regs) (_pt_regs).r9
|
| +
|
| #elif defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__))
|
| // ARM EABI includes "ARM private" system calls starting at |__ARM_NR_BASE|,
|
| // and a "ghost syscall private to the kernel", cmpxchg,
|
| @@ -189,6 +257,37 @@
|
| #define SECCOMP_ARG_LSB_IDX(nr) (offsetof(struct arch_seccomp_data, args) + \
|
| 8*(nr) + 0)
|
|
|
| +struct pt_regs {
|
| + unsigned long r0;
|
| + unsigned long r1;
|
| + unsigned long r2;
|
| + unsigned long r3;
|
| + unsigned long r4;
|
| + unsigned long r5;
|
| + unsigned long r6;
|
| + unsigned long r7;
|
| + unsigned long r8;
|
| + unsigned long r9;
|
| + unsigned long r10;
|
| + unsigned long fp;
|
| + unsigned long ip;
|
| + unsigned long sp;
|
| + unsigned long lr;
|
| + unsigned long pc;
|
| + unsigned long cpsr;
|
| + unsigned long orig_r0;
|
| +}
|
| +#define SECCOMP_PT_RESULT(_pt_regs) (_pt_regs).r0
|
| +#define SECCOMP_PT_SYSCALL(_pt_regs) (_pt_regs).r7
|
| +#define SECCOMP_PT_IP(_pt_regs) (_pt_regs).pc
|
| +#define SECCOMP_PT_PARM1(_pt_regs) (_pt_regs).r0
|
| +#define SECCOMP_PT_PARM2(_pt_regs) (_pt_regs).r1
|
| +#define SECCOMP_PT_PARM3(_pt_regs) (_pt_regs).r2
|
| +#define SECCOMP_PT_PARM4(_pt_regs) (_pt_regs).r3
|
| +#define SECCOMP_PT_PARM5(_pt_regs) (_pt_regs).r4
|
| +#define SECCOMP_PT_PARM6(_pt_regs) (_pt_regs).r5
|
| +
|
| +
|
| #else
|
| #error Unsupported target platform
|
|
|
|
|