Repository navigation
Set seccomp to trap in the shipped server configuration - #122577
Conversation
The setting keeps its `log` default, but the `config.xml` shipped with the packages and the Docker image now enforces the policy. It works in Docker with the default seccomp profile: the server's filter stacks on top of the runtime's. Related: #119545 (comment) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [a9a1160] Summary: ✅
AI ReviewSummaryThis PR switches the shipped server configuration used by packages and the Docker image to Final Verdict
LLVM Coverage ReportMeasured on commit a9a1160.
Changed lines: Changed C/C++ lines covered: 53/55 (96.36%) · Uncovered code |
Build profile diff (arm_release)Commit See the job log for details. |
|
📊 Cloud Performance Report ✅ AI verdict: This PR sets seccomp to trap in the shipped config.xml and splits the record of the requested mode from the mode actually in force (including a non-Linux fallback). None of that runs during query execution. The log and trap modes install the same syscall filter and differ only in what happens on a syscall outside the policy, so the PR cannot speed up queries. I downgraded the four flagged improvements (ClickBench Q33 -13.3%, Q34 -14.5%; TPC-H Q1 -20.0%, Q7 -24.7%) to not_sure. On TPC-H Q1 and Q7 the PR medians fall inside master's current range and the base medians fall above it, so the baseline looks older than master's current state. A fresh baseline from the exact base commit should confirm there is no change. clickbenchFlagged queries (3 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_officialFlagged queries (2 of 22)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. Debug info
|
… `config.xml` Integration tests copy `programs/server/config.xml` from the current sources to every instance, including those running an older server version from a Docker image (`with_installed_binary=True`). Since the shipped config sets `seccomp`, a 26.8 server, which already rejects unknown top-level elements but does not know `seccomp`, refused to start with `UNKNOWN_ELEMENT_IN_CONFIG`, failing all of `test_text_index_upgrade`. Set `skip_check_for_incorrect_settings` for such instances. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=122577&sha=836e40dc2785917ab940e6b8761aca52b9588af6&name_0=PR&name_1=Integration%20tests%20%28amd_llvm_coverage%2C%201%2F8%29 #122577 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 The |
… exists only on x86_64 and aarch64 On other architectures `installSeccompFilter` only sets `PR_SET_NO_NEW_PRIVS` and the server logs a warning and runs without a policy, so say that next to `<seccomp>trap</seccomp>` instead of implying that every Linux build enforces it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
…force, strip `seccomp` from the config of old-version test instances `system.server_settings` now shows the mode of the filter actually installed: `disabled` on architectures without a policy and in the `log` mode when the kernel cannot install its filter. The reload warning compares against the requested mode, tracked separately by `getRequestedSeccompMode`. Integration-test instances with `with_installed_binary` no longer disable `skip_check_for_incorrect_settings` for their whole lifetime; only the `seccomp` element unknown to older versions is removed from their copy of `config.xml`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to the latest version `with_installed_binary` instances strip `seccomp` from the main config so that the old version starts, but `restart_with_latest_version` reused that config, so the fresh binary ran with the built-in default instead of the shipped `trap`. Put the stripped element into `config.d` before starting the latest version, and remove it again in `restart_with_original_version`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ping `seccomp` for old versions Support YAML main configs, write the restored setting under `config_root_name`, and fail fast for unsupported main config formats in `with_installed_binary` instances. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n non-Linux builds The shipped `config.xml` is also embedded into the generic installer used on macOS and FreeBSD, where `<seccomp>trap</seccomp>` was silently inert: no startup warning, and `system.server_settings` showed `trap`. Now `installSeccompFilter` exists on every OS; outside Linux it installs nothing, records `disabled` as the mode in force, and the server logs a warning. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=122577&sha=a1d992f20183e70cb1e9902d4155d200ff653897&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29 ( |
|
Acknowledged. I'm investigating this; I'll follow up here with a separate PR (or my findings) shortly. What this job's logs show so far: #123841 (open) cancels leftover queries before the kill, but does not bring the detached tables back, so it does not cover this. I'll send a separate PR so that the kill step also reaches the tables the stress phase left detached, and link it here. |
|
The fix is in #124532: it restarts the previous release right before the kill step, so the kill also sees the mutations of tables that an unfinished |
|
🕵 Thanks @groeneai: the Merged |
|
@alexey-milovidov — title/description suggestions: Description (currently
Ignore if intentional. |
Follow-up to #119545, as asked in #119545 (comment): the
config.xmlshipped with the server packages (and so with the Docker image, which uses the same file) now setsseccomptotrap. The setting's own default stayslog, so a configuration that omits it keeps running without an enforced policy.Docker: it works with the default Docker seccomp profile (Docker 29.1, aarch64), so the Docker image needs no exception. The runtime's profile allows the
seccompsystem call, and the server's filter stacks on top of it: the server process showsSeccomp_filters: 2andNoNewPrivs: 1(the watchdog shows 1 and 0). A smoke workload (MergeTree insert/optimize,numbers_mtaggregation,system.stack_trace,url,system flush logs) raised noSIGSYS. A container runtime with a stricter profile that refusesseccompstops the server from starting in this mode; the comment in the config tells users to switch tologordisabledin that case.Because CI copies
programs/server/config.xmlfor functional, stress, fuzzer and integration tests, this PR's CI also runs the whole test suite under the enforcing policy.test_seccompnow expectstrapon the node that uses the shipped config; it passes locally (11/11).Integration tests copy the current
config.xmlto instances that run an older server version from a Docker image (with_installed_binary). A version that already rejects unknown top-level elements but predatesseccomp(26.8) would refuse to start, so the test helper now setsskip_check_for_incorrect_settingsfor such instances.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The server configuration file shipped with the packages and the Docker image now sets
seccomptotrap, so a system call outside the server's policy terminates the server with a stack trace in the log. Set it tologordisabledif the server runs in a sandbox that refuses theseccompsystem call.Related: #119545
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122577]
Version info
26.10.1.1869-master(included in26.10and later)