Skip to content

self-confine: seccomp blocks creat(85) — tar crashes with SIGSYS (exit 159) #33

Description

@xulis

Description

In self-confine mode, the seccomp profile blocks the creat syscall (85), causing programs that use it (e.g. GNU tar when writing archives) to die with SIGSYS (exit code 159). openat with O_CREAT works fine, so this is specific to the legacy creat syscall.

Environment

  • finSAFE 0.9.34 (personal CLI, install.sh)
  • Linux 6.8.0-124-generic, x86_64, Ubuntu 24.04

Steps to reproduce

  1. Policy (self-confine, network: host, workspace writable):
schema_version: 1
kind: local-wrapper
program_mode: interactive
...
filesystem:
  read_only_paths: [/usr]
  read_write_paths: [/root/workspace, /dev/null]
  1. Run tar:
finsafe --policy policy.yaml self-confine -- tar cf /root/workspace/t.tar /usr/bin/true
  1. Result: Bad system call (core dumped), exit code 159.

Root cause

Minimal C reproducer:

int fd = creat("/root/workspace/creat-test.txt", 0644);  // → SIGSYS (159)

vs the working equivalent:

int fd = open("/root/workspace/openat-test.txt", O_CREAT|O_WRONLY|O_TRUNC, 0644);  // works

auditd confirms the blocked syscall (with --audit, tar completes successfully):

type=SECCOMP ... comm="tar" syscall=85  (creat)

Expected

creat should behave like openat(O_CREAT) (allow when the target path is writable). Blocking the legacy creat syscall with SIGSYS breaks common tools — tar fails silently when creating archives.

Impact

  • tar cf fails inside self-confine sandboxes (silently — no error message, just exit 159)
  • Any other tool using creat() directly is affected

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions