History

seccomp: add "seccomp" syscall

This adds the new "seccomp" syscall with both an "operation" and "flags" parameter for future expansion. The third argument is a pointer value, used with the SECCOMP_SET_MODE_FILTER operation. Currently, flags must be 0. This is functionally equivalent to prctl(PR_SET_SECCOMP, ...). In addition to the TSYNC flag later in this patch series, there is a non-zero chance that this syscall could be used for configuring a fixed argument area for seccomp-tracer-aware processes to pass syscall arguments in the future. Hence, the use of "seccomp" not simply "seccomp_add_filter" for this syscall. Additionally, this syscall uses operation, flags, and user pointer for arguments because strictly passing arguments via a user pointer would mean seccomp itself would be unable to trivially filter the seccomp syscall itself.

Kees Cook committed 12 years ago

Commit 48dc92b1 parent 3b23dd18 files · +65 −6Browse files

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

Unified · Split

include/uapi/linux/seccomp.h+4−0
@@ -10,6 +10,10 @@ · 9 unmodified lines
1010 #define SECCOMP_MODE_STRICT 1 /* uses hard-coded filter. */
1111 #define SECCOMP_MODE_FILTER 2 /* uses user-supplied filter. */
1212
13+/* Valid operations for seccomp syscall. */
14+#define SECCOMP_SET_MODE_STRICT 0
15+#define SECCOMP_SET_MODE_FILTER 1
16+
1317 /*
1418 * All BPF programs must return a 32-bit value.
1519 * The bottom 16-bits are for optional return data.

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