2021-06-29 13:17:01 +02:00
|
|
|
Index: vsftpd-3.0.4/seccompsandbox.c
|
2021-01-16 16:15:09 +01:00
|
|
|
===================================================================
|
2021-06-29 13:17:01 +02:00
|
|
|
--- vsftpd-3.0.4.orig/seccompsandbox.c 2021-06-15 08:06:29.165512830 +0000
|
|
|
|
+++ vsftpd-3.0.4/seccompsandbox.c 2021-06-15 08:06:42.778484808 +0000
|
2021-01-16 16:15:09 +01:00
|
|
|
@@ -18,6 +18,7 @@
|
|
|
|
#include "utility.h"
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
+#include <stdio.h>
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/tcp.h>
|
2021-06-29 13:17:01 +02:00
|
|
|
@@ -63,6 +64,7 @@
|
2021-01-16 16:15:09 +01:00
|
|
|
|
|
|
|
#define kMaxSyscalls 100
|
|
|
|
|
|
|
|
+//#define DEBUG_SIGSYS
|
|
|
|
#ifdef DEBUG_SIGSYS
|
|
|
|
|
|
|
|
#include <signal.h>
|
2021-06-29 13:17:01 +02:00
|
|
|
@@ -71,7 +73,10 @@
|
2021-01-16 16:15:09 +01:00
|
|
|
void
|
|
|
|
handle_sigsys(int sig)
|
|
|
|
{
|
|
|
|
- (void) sig;
|
|
|
|
+ char str[21];
|
|
|
|
+ snprintf(str, 21, "Rejected syscall %d", sig);
|
|
|
|
+
|
|
|
|
+ die(str);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2021-06-29 13:17:01 +02:00
|
|
|
@@ -586,8 +591,8 @@ seccomp_sandbox_lockdown()
|
2021-01-16 16:15:09 +01:00
|
|
|
p_filter->code = BPF_LD+BPF_W+BPF_ABS;
|
|
|
|
p_filter->jt = 0;
|
|
|
|
p_filter->jf = 0;
|
|
|
|
- /* Offset 4 for syscall architecture. */
|
|
|
|
- p_filter->k = 4;
|
|
|
|
+ /* Offset 5 for syscall architecture. */
|
|
|
|
+ p_filter->k = 5;
|
|
|
|
p_filter++;
|
|
|
|
p_filter->code = BPF_JMP+BPF_JEQ+BPF_K;
|
|
|
|
p_filter->jt = 1;
|