Run TSan with a narrowly scoped test-container seccomp profile

This commit is contained in:
dingo
2026-09-19 09:23:06 -04:00
parent 9e412736d9
commit 660a5674ee
6 changed files with 93 additions and 2 deletions
+24
View File
@@ -72,3 +72,27 @@ Sources: [Gitea variables](https://docs.gitea.com/usage/actions/actions-variable
[Gitea runner](https://docs.gitea.com/runner/),
[Argo hooks](https://argo-cd.readthedocs.io/en/stable/user-guide/resource_hooks/),
[Kubernetes Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/).
### TSan test-container exception (2026-09-19)
Run 1400 demonstrated Clang19 failing before main because Docker's build sandbox
blocked personality(ADDR_NO_RANDOMIZE). Compile TSan in the image build, then run
CTest in a non-root, networkless, capability-free container with a read-only root
and bounded tmpfs test-output directories. No host ASLR/sysctl change and no
seccomp=unconfined or privileged container is used.
The CI profile generator downloads Moby's maintained Apache-2.0 default seccomp
profile at commit 245180c51918481c0525424b3ee025d2b435d46c and verifies SHA256
785b2429264afba4d594320337cb17f144f3c7d51585f9805eef72e28f4f9334. It adds exactly one
argument-constrained allow rule: personality(0x40000), PER_LINUX with
ADDR_NO_RANDOMIZE. This deliberately disables ASLR only for sanitizer processes
requiring a fixed shadow layout. All other default rules remain. The profile is
not part of the game image or Kubernetes runtime configuration. Review/removal
owner: foundation/toolchain maintainers when TSan no longer requires this call.
The tradeoff is a pinned upstream network fetch and profile maintenance, rather
than vendoring a large allowlist or permitting every syscall. Failed tests still
block publication.
Evidence: [Docker seccomp](https://docs.docker.com/engine/security/seccomp/),
[LLVM19 runtime](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.1/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp),
[pinned Moby profile](https://github.com/moby/profiles/blob/245180c51918481c0525424b3ee025d2b435d46c/seccomp/default.json).
+16
View File
@@ -62,3 +62,19 @@ is not a compiler version.
Update this report with run URL, tested commit, image digest and Job result when
those checks execute. Never overwrite a golden merely to make CI pass.
## Expanded Linux run 1400
[Run 1400](https://git.aeternalisgames.com/dingo/AEvolution/actions/runs/1400),
commit 9e412736d91ad103b7a951f99b811c629c5ac61e: GCC14 Debug and Release, Clang19
analysis and ASan/UBSan each passed 5/5 tests. Formatting passed. The seeded fuzz
smoke completed 10000 cases with no reported failure. CMake 3.28.3, GCC 14.2.0,
Clang/format/tidy 19.1.1, Linux 6.8.0-110-generic x86-64. Million-tick hash matched
Windows (fab22c2e8ae1c379); benchmark hash matched too (3bad6db1612cbd1), with
0.0674131 seconds observed for 10000 entities * 1000 ticks on the CI host.
TSan compiled but all executions failed before main: its runtime could not call
personality(ADDR_NO_RANDOMIZE) inside the Docker build sandbox. The image job was
skipped, as required. This is not recorded as a TSan pass. The follow-up isolates
execution in a container with the narrowly constrained profile from ADR-0020;
its result must be recorded after execution.