Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save al3xtjames/1993a722b2ab9a9fece0477e179c468e to your computer and use it in GitHub Desktop.
Save al3xtjames/1993a722b2ab9a9fece0477e179c468e to your computer and use it in GitHub Desktop.
From ffa09d2845bacb21399b2e94109dab7e1c576ccd Mon Sep 17 00:00:00 2001
From: Alex James <git@alextjam.es>
Date: Sat, 6 Jul 2024 17:24:13 -0500
Subject: [PATCH] sandbox-seccomp-filter: allow getpeername and getsockopt
The BDP performance improvement patch added calls to getsockopt and
getpeername, which fails if the seccomp sandbox is enabled. Fix it by
adding them to the list of allowed syscalls.
---
sandbox-seccomp-filter.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
index 23b40b643..a6b16b4f1 100644
--- a/sandbox-seccomp-filter.c
+++ b/sandbox-seccomp-filter.c
@@ -289,6 +289,9 @@ static const struct sock_filter preauth_insns[] = {
#ifdef __NR_geteuid32
SC_ALLOW(__NR_geteuid32),
#endif
+#ifdef __NR_getpeername
+ SC_ALLOW(__NR_getpeername),
+#endif
#ifdef __NR_getpgid
SC_ALLOW(__NR_getpgid),
#endif
@@ -298,6 +301,9 @@ static const struct sock_filter preauth_insns[] = {
#ifdef __NR_getrandom
SC_ALLOW(__NR_getrandom),
#endif
+#ifdef __NR_getsockopt
+ SC_ALLOW(__NR_getsockopt),
+#endif
#ifdef __NR_gettid
SC_ALLOW(__NR_gettid),
#endif
--
2.45.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment