History

ptrace: introduce PTRACE_O_EXITKILL

Ptrace jailers want to be sure that the tracee can never escape from the control. However if the tracer dies unexpectedly the tracee continues to run in potentially unsafe mode. Add the new ptrace option PTRACE_O_EXITKILL. If the tracer exits it sends SIGKILL to every tracee which has this bit set. Note that the new option is not equal to the last-option << 1. Because currently all options have an event, and the new one starts the eventless group. It uses the random 20 bit, so we have the room for 12 more events, but we can also add the new eventless options below this one. Suggested by Amnon Shiloh.

Oleg Nesterov committed 13 years ago

Commit 992fb6e1 parent 462e4713 files · +9 −1Browse files

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

Unified · Split

include/uapi/linux/ptrace.h+4−1
@@ -73,7 +73,10 @@ · 72 unmodified lines
7373 #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
7474 #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
7575
76−#define PTRACE_O_MASK 0x000000ff
76+/* eventless options */
77+#define PTRACE_O_EXITKILL (1 << 20)
78+
79+#define PTRACE_O_MASK (0x000000ff | PTRACE_O_EXITKILL)
7780
7881 #include <asm/ptrace.h>
7982