kloak crashes with SIGSYS on arm64 — missing faccessat, ppoll, unlinkat, epoll_pwait in SystemCallFilter

The bug is in kloak.service itself and affects any arm64 platform, not only UTM. Related earlier reports (only faccessat found there): Often systemcheck errors notifications. whonix 18lxqt , Whonix 18.2.4.2 arm64 on Apple Silicon M3 Build and required fixes

Environment

  • Whonix-Workstation 18.2.4.3, LXQt / labwc (Wayland), arm64
  • kloak 0.9.1-1 (arm64 image built from source)
  • Host: macOS on Apple Silicon, UTM (QEMU -machine virt, -accel hvf)

Description
kloak.service never stays up. It cycles between activating (start-pre) and activating (auto-restart):

$ systemctl show kloak -p ExecMainCode,ExecMainStatus
ExecMainCode=3
ExecMainStatus=31

The main process is killed by SIGSYS (seccomp). find_wl_compositor works fine: it exits 0 and writes a valid /run/kloak_wl_compositor_data.

Root cause
The kernel log shows these blocked syscalls (aarch64 numbering):

nr syscall legacy equivalent already in the filter
48 faccessat access, faccessat2
73 ppoll poll
35 unlinkat unlink
22 epoll_pwait epoll_wait

arm64 has no access, poll, unlink or epoll_wait syscalls, so glibc implements these functions via faccessat, ppoll, unlinkat and epoll_pwait. I verified that all four legacy equivalents are present in the shipped filter, so allowing the arm64 variants grants no new capability.

Workaround (tested)

sudo systemctl edit kloak
[Service]
SystemCallFilter=faccessat ppoll unlinkat epoll_pwait

With this drop-in kloak runs stably: active (running), no restarts.

Suggested fix
Add faccessat ppoll unlinkat epoll_pwait to SystemCallFilter in kloak.service. All four syscalls also exist on x86_64 and are functionally equivalent to calls that are already allowed. Alternatively, ship them in an arch-specific drop-in, as was done for sdwdate on arm64.

AI-generated report.

1 Like

The next release of kloak should fix this. We’re switching from using a detailed system call filter to using systemd’s system call set feature. The current filter in my development branch of kloak looks like this:

If you’d like to help test that, that would be quite helpful! (Note however that this filter might not work with your version of kloak, as kloak has also undergone very substantial refactoring to reduce its attack surface as much as reasonably possible. I suspect it will work though.)


(I previously posted a warning about needing to disclose use of AI, but then noticed a line at the very end with the disclosure, which I missed. Sorry about that.)

1 Like

Hi @arraybolt3!

Thank you for your quick reply, the upcoming fix, and your suggestion.

SystemCallFilter=@system-service @mount ~memfd_create

I’ve tested it, and it works perfectly.

2 Likes

Awesome, and thank you!

1 Like