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.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -22,18 +22,20 @@ · 21 unmodified lines | ||
| 22 | 22 | /* |
| 23 | 23 | * All BPF programs must return a 32-bit value. |
| 24 | 24 | * 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). | |
| 26 | 27 | * |
| 27 | 28 | * The ordering ensures that a min_t() over composed return values always |
| 28 | 29 | * selects the least permissive choice. |
| 29 | 30 | */ |
| 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 */ | |
| 37 | 39 | |
| 38 | 40 | /* Masks for the return value sections. */ |
| 39 | 41 | #define SECCOMP_RET_ACTION 0x7fff0000U |