Browse Source

Add SECCOMP_RET_KILL_PROCESS decoding support

* bpf_seccomp_filter.c [!SECCOMP_RET_ACTION]: Remove.
[!SECCOMP_RET_ACTION_FULL] (SECCOMP_RET_ACTION_FULL): Define.
(print_seccomp_filter_k): Use SECCOMP_RET_ACTION_FULL
instead of SECCOMP_RET_ACTION.
* xlat/seccomp_ret_action.in: Add SECCOMP_RET_KILL_PROCESS introduced
by linux kernel commit v4.14-rc2~15^2~3.
Dmitry V. Levin 2 years ago
parent
commit
745c53410f
2 changed files with 4 additions and 3 deletions
  1. 3
    3
      bpf_seccomp_filter.c
  2. 1
    0
      xlat/seccomp_ret_action.in

+ 3
- 3
bpf_seccomp_filter.c View File

@@ -35,8 +35,8 @@
35 35
 #ifdef HAVE_LINUX_SECCOMP_H
36 36
 # include <linux/seccomp.h>
37 37
 #endif
38
-#ifndef SECCOMP_RET_ACTION
39
-# define SECCOMP_RET_ACTION 0x7fff0000U
38
+#ifndef SECCOMP_RET_ACTION_FULL
39
+# define SECCOMP_RET_ACTION_FULL 0xffff0000U
40 40
 #endif
41 41
 #include "xlat/seccomp_ret_action.h"
42 42
 
@@ -44,7 +44,7 @@ static bool
44 44
 print_seccomp_filter_k(const struct bpf_filter_block *const fp)
45 45
 {
46 46
 	if (BPF_CLASS(fp->code) == BPF_RET) {
47
-		unsigned int action = SECCOMP_RET_ACTION & fp->k;
47
+		unsigned int action = SECCOMP_RET_ACTION_FULL & fp->k;
48 48
 		unsigned int data = fp->k & ~action;
49 49
 
50 50
 		printxval(seccomp_ret_action, action, "SECCOMP_RET_???");

+ 1
- 0
xlat/seccomp_ret_action.in View File

@@ -1,3 +1,4 @@
1
+SECCOMP_RET_KILL_PROCESS 0x80000000U
1 2
 SECCOMP_RET_KILL_THREAD	0
2 3
 SECCOMP_RET_TRAP	0x00030000U
3 4
 SECCOMP_RET_ERRNO	0x00050000U

Loading…
Cancel
Save