Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: experimental/webtry/seccomp_bpf.h

Issue 231663002: too aggressive on seccomp cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove exe Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | experimental/webtry/webtry.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/seccomp_bpf.h
diff --git a/experimental/webtry/seccomp_bpf.h b/experimental/webtry/seccomp_bpf.h
index 8bbe99b7f8835f35903dfe4e50b873f3a458ad10..a78417b28b8757a9dcc16d1106ee553176ff1b4b 100644
--- a/experimental/webtry/seccomp_bpf.h
+++ b/experimental/webtry/seccomp_bpf.h
@@ -24,11 +24,31 @@
#include <unistd.h>
#include <sys/prctl.h>
+#ifndef PR_SET_NO_NEW_PRIVS
+# define PR_SET_NO_NEW_PRIVS 38
+#endif
#include <linux/unistd.h>
#include <linux/audit.h>
#include <linux/filter.h>
-#include <linux/seccomp.h>
+#ifdef HAVE_LINUX_SECCOMP_H
+# include <linux/seccomp.h>
+#endif
+#ifndef SECCOMP_MODE_FILTER
+# define SECCOMP_MODE_FILTER 2 /* uses user-supplied filter. */
+# define SECCOMP_RET_KILL 0x00000000U /* kill the task immediately */
+# define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */
+# define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */
+struct seccomp_data {
+ int nr;
+ __u32 arch;
+ __u64 instruction_pointer;
+ __u64 args[6];
+};
+#endif
+#ifndef SYS_SECCOMP
+# define SYS_SECCOMP 1
+#endif
#define syscall_nr (offsetof(struct seccomp_data, nr))
« no previous file with comments | « no previous file | experimental/webtry/webtry.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698