Adds a new return value to seccomp filters that triggers a SIGSYS to be delivered with the new SYS_SECCOMP si_code. This allows in-process system call emulation, including just specifying an errno or cleanly dumping core, rather than just dying. Suggested-by: Markus Gutschke <markus@chromium.org> Suggested-by: Julien Tinnes <jln@chromium.org> Signed-off-by: Will Drewry <wad@chromium.org> Acked-by: Eric Paris <eparis@redhat.com>
Showing the changes to include (2 of 4 files). Show all
Unified · Split
| @@ -93,7 +93,7 @@ typedef struct siginfo { · 92 unmodified lines | ||
| 93 | 93 | |
| 94 | 94 | /* SIGSYS */ |
| 95 | 95 | struct { |
| 96 | − void __user *_call_addr; /* calling insn */ | |
| 96 | + void __user *_call_addr; /* calling user insn */ | |
| 97 | 97 | int _syscall; /* triggering system call number */ |
| 98 | 98 | unsigned int _arch; /* AUDIT_ARCH_* of syscall */ |
| 99 | 99 | } _sigsys; |
| @@ -19,6 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | * selects the least permissive choice. |
| 20 | 20 | */ |
| 21 | 21 | #define SECCOMP_RET_KILL 0x00000000U /* kill the task immediately */ |
| 22 | +#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */ | |
| 22 | 23 | #define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */ |
| 23 | 24 | #define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */ |
| 24 | 25 | |