diff options
author | Adin Scannell <ascannell@google.com> | 2018-10-10 22:39:32 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-10 22:40:28 -0700 |
commit | 463e73d46d76042c39050d02cf3b0f875e55eb01 (patch) | |
tree | dbaac54c225820d0850925a8cde4d80861fce686 /pkg/seccomp/seccomp_rules.go | |
parent | e21ba16d9cf7ba4f2d5f65651e06ab592032ef86 (diff) |
Add seccomp filter configuration to ptrace stubs.
This is a defense-in-depth measure. If the sentry is compromised, this prevents
system call injection to the stubs. There is some complexity with respect to
ptrace and seccomp interactions, so this protection is not really available
for kernel versions < 4.8; this is detected dynamically.
Note that this also solves the vsyscall emulation issue by adding in
appropriate trapping for those system calls. It does mean that a compromised
sentry could theoretically inject these into the stub (ignoring the trap and
resume, thereby allowing execution), but they are harmless.
PiperOrigin-RevId: 216647581
Change-Id: Id06c232cbac1f9489b1803ec97f83097fcba8eb8
Diffstat (limited to 'pkg/seccomp/seccomp_rules.go')
-rw-r--r-- | pkg/seccomp/seccomp_rules.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/seccomp/seccomp_rules.go b/pkg/seccomp/seccomp_rules.go index 9215e5c90..6b707f195 100644 --- a/pkg/seccomp/seccomp_rules.go +++ b/pkg/seccomp/seccomp_rules.go @@ -24,9 +24,11 @@ import "fmt" // __u64 args[6]; // }; const ( - seccompDataOffsetNR = 0 - seccompDataOffsetArch = 4 - seccompDataOffsetArgs = 16 + seccompDataOffsetNR = 0 + seccompDataOffsetArch = 4 + seccompDataOffsetIPLow = 8 + seccompDataOffsetIPHigh = 12 + seccompDataOffsetArgs = 16 ) func seccompDataOffsetArgLow(i int) uint32 { |