Skip to content

Commit 3e02189

Browse files
committed
Remove unnecessarily verbose unreachable code
This was mostly needed for debugging the initial implementation, it is not needed anymore, as this case should hopefully never happen, unless there is something terribly wrong with our BPF code.
1 parent 1e87877 commit 3e02189

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/bin/seccomp/seccomp_exec.c

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -182,26 +182,6 @@ int handle_req(struct seccomp_notif *req,
182182
resp->val = 0;
183183
resp->flags = 0;
184184

185-
#ifndef NDEBUG
186-
bool found = false;
187-
for (int i = 0; i < ARRAY_SIZE(scalls); ++i) {
188-
if (req->data.nr == scalls[i]) {
189-
found = true;
190-
}
191-
}
192-
if (!found) {
193-
fprintf(stderr, "huh? trapped system call %d that does not appear on our list?\n", req->data.nr);
194-
// continue the syscall normally
195-
resp->flags |= SECCOMP_USER_NOTIF_FLAG_CONTINUE;
196-
resp->error = 0;
197-
resp->val = 0;
198-
if (ioctl(listener, SECCOMP_IOCTL_NOTIF_SEND, resp) < 0 && errno != ENOENT) {
199-
perror("ioctl send");
200-
}
201-
return -1;
202-
}
203-
#endif
204-
205185
/*
206186
* Ok, let's read the task's memory to see what they wanted to open
207187
*/
@@ -243,7 +223,7 @@ int handle_req(struct seccomp_notif *req,
243223
}
244224
// Get the redirected file path
245225
if (!find_match(&proxy_pathname, pathname)) {
246-
// continue the syscall normally
226+
// continue the syscall normally if there is no match
247227
resp->flags |= SECCOMP_USER_NOTIF_FLAG_CONTINUE;
248228
resp->error = 0;
249229
resp->val = 0;

0 commit comments

Comments
 (0)