aboutsummaryrefslogtreecommitdiffstats
path: root/src/fseccomp/seccomp_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fseccomp/seccomp_file.c')
-rw-r--r--src/fseccomp/seccomp_file.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fseccomp/seccomp_file.c b/src/fseccomp/seccomp_file.c
index 872b41261..9e8ceb898 100644
--- a/src/fseccomp/seccomp_file.c
+++ b/src/fseccomp/seccomp_file.c
@@ -112,6 +112,19 @@ void filter_add_blacklist(int fd, int syscall, int arg, void *ptrarg, bool nativ
112 } 112 }
113} 113}
114 114
115void filter_add_blacklist_override(int fd, int syscall, int arg, void *ptrarg, bool native) {
116 (void) arg;
117 (void) ptrarg;
118 (void) native;
119
120 if (syscall >= 0) {
121 int saved_error_action = arg_seccomp_error_action;
122 arg_seccomp_error_action = SECCOMP_RET_KILL;
123 write_blacklist(fd, syscall);
124 arg_seccomp_error_action = saved_error_action;
125 }
126}
127
115// handle seccomp list exceptions (seccomp x,y,!z) 128// handle seccomp list exceptions (seccomp x,y,!z)
116void filter_add_blacklist_for_excluded(int fd, int syscall, int arg, void *ptrarg, bool native) { 129void filter_add_blacklist_for_excluded(int fd, int syscall, int arg, void *ptrarg, bool native) {
117 (void) arg; 130 (void) arg;
@@ -142,7 +155,7 @@ void filter_end_blacklist(int fd) {
142 155
143void filter_end_whitelist(int fd) { 156void filter_end_whitelist(int fd) {
144 struct sock_filter filter[] = { 157 struct sock_filter filter[] = {
145 KILL_PROCESS 158 KILL_OR_RETURN_ERRNO
146 }; 159 };
147 write_to_file(fd, filter, sizeof(filter)); 160 write_to_file(fd, filter, sizeof(filter));
148} 161}