Skip to content

Commit

Permalink
samples: Unrename SECCOMP_RET_KILL
Browse files Browse the repository at this point in the history
Since samples can still be built before header installs, avoid the
cosmetic renaming of SECCOMP_RET_KILL to avoid build failures in -next.

Cc: Stephen Rothwell <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
kees committed Aug 17, 2017
1 parent f3e1821 commit 6849243
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions samples/seccomp/bpf-direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int install_filter(void)
/* Check that read is only using stdin. */
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, syscall_arg(0)),
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, STDIN_FILENO, 4, 0),
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL_THREAD),
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL),

/* Check that write is only using stdout */
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, syscall_arg(0)),
Expand All @@ -139,7 +139,7 @@ static int install_filter(void)

BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW),
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_TRAP),
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL_THREAD),
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL),
};
struct sock_fprog prog = {
.len = (unsigned short)(sizeof(filter)/sizeof(filter[0])),
Expand Down
2 changes: 1 addition & 1 deletion samples/seccomp/bpf-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void seccomp_bpf_print(struct sock_filter *filter, size_t count);
#define ALLOW \
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW)
#define DENY \
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL_THREAD)
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL)
#define JUMP(labels, label) \
BPF_JUMP(BPF_JMP+BPF_JA, FIND_LABEL((labels), (label)), \
JUMP_JT, JUMP_JF)
Expand Down

0 comments on commit 6849243

Please sign in to comment.