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).