← All updates

Engineering / Field note

A forked seccomp test keeps the parent's filters

Five fictional review records explain inherited filters, action-specific outcomes and the evidence needed to interpret a failing child process.

By Zyel · Published · 4 min read

Moving a deliberate seccomp denial test into a child process changes where the failure happens. It does not reset the policy. The Linux seccomp manual says that when fork or clone is allowed, the resulting children retain the parent's filters; allowed execve operations preserve existing filters too. A child can provide a separate process to observe, while remaining subject to the inherited restrictions. [1]

That is useful for test design, but it leaves an important interpretation problem. A child that stops running may have reached the intended denied operation, or it may have failed earlier for another reason. A meaningful result connects the policy, the test step and the observed termination. The absence of a cheerful success message is a rather underqualified witness.

This engineering note reviews established documentation on November 29, 2026. The checked seccomp page belongs to Linux man-pages 6.19 and is dated June 5, 2026; that is a documentation edition and date, not an affected-kernel range. The five original JSON examples below are fictional review records, not seccomp filters, kernel test results or claims about a deployed service. [1]

First, carry the inheritance assumption into the process diagram. If the test design requires the child to make a call that the existing policy forbids, merely arranging a fork does not make that call available. The kernel documentation describes the same inheritance relationship. Our recommendation is to identify which process installs the policy and which later process attempts the operation. [2]

1. Keep the policy in the child-process model · JSON
{
  "fictional_example": true,
  "parent": {
    "declared_policy": "demo-policy-A",
    "fork_allowed": true
  },
  "child": {
    "origin": "fork",
    "inherits_existing_filters": true
  },
  "policy_reset_by_fork": false,
  "native_test_performed": false
}

The example's policy label is only a fictional identifier. A matching label would not authenticate a loaded filter or prove that a process reached a particular instruction. In an actual investigation, distinguish the configuration you intended to install from evidence about the running process. That distinction keeps a diagram useful without asking it to certify the machine.

Next, include executable replacement in the model. Allowed execve preserves the installed filters. A helper program may therefore encounter restrictions before it reaches its own main task. Our interpretation is that a test plan should name the intended operation and the preparation it depends on, instead of assuming that a new executable starts with an empty policy. [1]

2. Include the exec boundary in the plan · JSON
{
  "fictional_example": true,
  "current_process_policy": "demo-policy-A",
  "execve_allowed": true,
  "replacement_program": "fictional-helper",
  "existing_filters_preserved": true,
  "helper_preparation": "must work under inherited policy",
  "replacement_started": "not measured in this example"
}

Third, state the expected action rather than using denied as a complete outcome description. The kernel documentation distinguishes actions that return an errno, deliver a trap signal or kill a thread or process. Those are different observations. A test expecting a returned error should not automatically accept an unrelated crash as proof that its intended path worked. [2]

3. Give each intended action its own expectation · JSON
{
  "fictional_example": true,
  "fictional_expectations": [
    {
      "action": "SECCOMP_RET_ERRNO",
      "observe": "configured errno; syscall not executed"
    },
    {
      "action": "SECCOMP_RET_TRAP",
      "observe": "SIGSYS trap information"
    },
    {
      "action": "SECCOMP_RET_KILL_PROCESS",
      "observe": "process termination by SIGSYS"
    }
  ],
  "all_nonzero_results_accepted_as_equivalent": false
}

The action list is a teaching comparison, not a policy recommendation. Choose a policy for the application's requirements, then evaluate the outcome that policy specifies. The kernel documentation also describes seccomp filtering as a component of sandbox construction. File access, information flow and the application's wider trust model still need their own design. [2]

Fourth, establish that the test reached the step whose outcome matters. A successful control under the relevant environment can reveal a broken fixture or missing prerequisite before a denial test is interpreted. A readiness observation helps locate the failure boundary, but should still be tied to the attempted operation and the process being observed. This is our recommendation for causal clarity.

4. Preserve a failed prerequisite as an inconclusive test · JSON
{
  "fictional_example": true,
  "fixture": "fictional-helper",
  "control_completed": false,
  "preparation_error": "required input unavailable",
  "target_operation_reached": false,
  "enforcement_result": "inconclusive",
  "repeat_after_repair": "requires a fresh valid control"
}

The record does not award a successful security result to a preparation failure. That is especially useful when a harness has many ways to stop: loading a helper, opening input, setting up communication or reaching the intended call. Keep those states distinct in the report, so a later change fixes the right problem rather than merely producing a different failure.

Finally, decode termination in the format the observation API provides. The wait manual distinguishes normal exit from signal termination, with separate tests and fields for each. Python's subprocess returncode uses a negative signal number on POSIX. A raw wait status, a shell-style status and a Python returncode therefore need an explicit normalization step before comparison. [3] [4]

5. Normalize the observation before interpreting it · JSON
{
  "fictional_example": true,
  "observation_api": "waitpid",
  "fictional_decoded_result": {
    "exited_normally": false,
    "terminated_by_signal": true,
    "signal": "SIGSYS",
    "core_dump": false
  },
  "target_operation_evidence": "must be assessed separately",
  "single_signal_proves_complete_sandbox": false
}

A signal can narrow an investigation without proving every part of it. Record the intended action, the preparation/control result and the decoded process outcome together. The payoff is straightforward: a child process can contain an expected failure, and the surrounding evidence can explain it. That produces a test result a reviewer can understand without treating every stopped process as the same event.

Sources + further reading

Source dates describe the original material. Publication above is the date this Zyel article went live.

  1. Linux man-pages 6.19: seccomp filter inheritance and return actionsLinux man-pages project · Checked Nov 29, 2026
  2. Seccomp BPF: usage, return values and scopeLinux kernel project · Checked Nov 29, 2026
  3. Linux man-pages 6.19: decoding child-process wait statusLinux man-pages project · Checked Nov 29, 2026
  4. Python subprocess: POSIX signal termination in returncodePython Software Foundation · Checked Nov 29, 2026

Reader discussion

What would you ask next?

Questions, useful corrections and thoughtful disagreement are welcome. Comments are reviewed before they appear.

No reader comments yet.

10–2,000 characters. Plain text. Leave out passwords, private project data and personal contact details. A blank display name appears as Anonymous.

Complete the CAPTCHA before sending. Verification runs on your device.