History

seccomp: Introduce SECCOMP_RET_KILL_PROCESS

This introduces the BPF return value for SECCOMP_RET_KILL_PROCESS to kill an entire process. This cannot yet be reached by seccomp, but it changes the default-kill behavior (for unknown return values) from kill-thread to kill-process.

Kees Cook committed 9 years ago

Commit 4d3b0b01 parent fd768752 files · +26 −14Browse files

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

Unified · Split

include/uapi/linux/seccomp.h+10−8
@@ -22,18 +22,20 @@ · 21 unmodified lines
2222 /*
2323 * All BPF programs must return a 32-bit value.
2424 * The bottom 16-bits are for optional return data.
25− * The upper 16-bits are ordered from least permissive values to most.
25+ * The upper 16-bits are ordered from least permissive values to most,
26+ * as a signed value (so 0x8000000 is negative).
2627 *
2728 * The ordering ensures that a min_t() over composed return values always
2829 * selects the least permissive choice.
2930 */
30−#define SECCOMP_RET_KILL_THREAD 0x00000000U /* kill the thread */
31−#define SECCOMP_RET_KILL SECCOMP_RET_KILL_THREAD
32−#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */
33−#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */
34−#define SECCOMP_RET_TRACE 0x7ff00000U /* pass to a tracer or disallow */
35−#define SECCOMP_RET_LOG 0x7ffc0000U /* allow after logging */
36−#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */
31+#define SECCOMP_RET_KILL_PROCESS 0x80000000U /* kill the process */
32+#define SECCOMP_RET_KILL_THREAD 0x00000000U /* kill the thread */
33+#define SECCOMP_RET_KILL SECCOMP_RET_KILL_THREAD
34+#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */
35+#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */
36+#define SECCOMP_RET_TRACE 0x7ff00000U /* pass to a tracer or disallow */
37+#define SECCOMP_RET_LOG 0x7ffc0000U /* allow after logging */
38+#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */
3739
3840 /* Masks for the return value sections. */
3941 #define SECCOMP_RET_ACTION 0x7fff0000U

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