History

seccomp: Add SECCOMP_RET_TRAP

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>

Will Drewry committed 14 years ago

Commit bb6ea431 parent a0727e84 files · +37 −6Browse files

Showing the changes to include (2 of 4 files). Show all

Unified · Split

2 files
  1. include/asm-generic/siginfo.h +1 −1
  2. include/linux/seccomp.h +1 −0
include/asm-generic/siginfo.h+1−1
@@ -93,7 +93,7 @@ typedef struct siginfo { · 92 unmodified lines
93 93
94 /* SIGSYS */94 /* SIGSYS */
95 struct {95 struct {
96 void __user *_call_addr; /* calling insn */96 void __user *_call_addr; /* calling user insn */
97 int _syscall; /* triggering system call number */97 int _syscall; /* triggering system call number */
98 unsigned int _arch; /* AUDIT_ARCH_* of syscall */98 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
99 } _sigsys;99 } _sigsys;
include/linux/seccomp.h+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * selects the least permissive choice.19 * selects the least permissive choice.
20 */20 */
21#define SECCOMP_RET_KILL 0x00000000U /* kill the task immediately */21#define SECCOMP_RET_KILL 0x00000000U /* kill the task immediately */
22#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */
22#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */23#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */
23#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */24#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */
24 25

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