aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-10-31 17:44:03 +0100
committerbptato <nincsnevem662@gmail.com>2024-10-31 18:38:16 +0100
commitd9ca197ed8056c021d4e37ec52aacc6039e24ab7 (patch)
tree782781c4bb85e65f112092f96c7ee91e447c7c97 /src
parentd9a74dbdeef846a98a464bfc102ce282b45e9606 (diff)
downloadchawan-d9ca197ed8056c021d4e37ec52aacc6039e24ab7.tar.gz
chaseccomp: fix compilation with newest dash, misc changes
* fix matching on unstripped whitespace: caught after upgrading to upstream dash & chaseccomp wouldn't compile * add defines to ensure that we computed the filter length correctly * inline cut_label * EPERM on sigaction, sigprocmask, gettid, and kill on tgkill (so a crash doesn't trigger sandbox violations) * move SIGSYS handler to C and add one for the network The last change removes the stack trace from SIGSYS, but gives us the syscall number which is probably more useful. (Indeed, we don't even have a stack trace in release builds.)
Diffstat (limited to 'src')
-rw-r--r--src/utils/sandbox.nim3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/utils/sandbox.nim b/src/utils/sandbox.nim
index d5c969de..b2e2c8b0 100644
--- a/src/utils/sandbox.nim
+++ b/src/utils/sandbox.nim
@@ -92,9 +92,6 @@ elif SandboxMode == stSeccomp:
proc cha_enter_network_sandbox(): cint {.importc, cdecl.}
proc enterBufferSandbox*(sockPath: string) =
- onSignal SIGSYS:
- discard sig
- raise newException(Defect, "Sandbox violation in buffer")
doAssert cha_enter_buffer_sandbox() == 1
proc enterNetworkSandbox*() =