distcc 3.4 client crashes with buffer overflow on boltzmann #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
distcc 3.4 (built 2026-04-17) from marfrit-packages crashes with glibc FORTIFY_SOURCE
*** buffer overflow detected ***: terminatedon every client invocation on boltzmann (aarch64, RK3588, Arch Linux ARM).Reproducer:
All masquerade variants (
/usr/lib/distcc/aarch64-linux-gnu-gcc, a manually created/usr/lib/distcc/gcc -> /usr/bin/distccsymlink) exhibit identical behaviour. Kernel builds settingCC="distcc gcc"or using the masquerade PATH fail at the Kconfigscripts/Kconfig.includecompiler-detection stage with:Distccd on the same system (tesla, CT108) accepts jobs fine — only the client-side invocation on boltzmann is affected.
Likely cause: distcc 3.4 was built against an older glibc ABI, or built with
_FORTIFY_SOURCEenabled over a code path that has an off-by-one. Needs rebuild against current glibc with fortify-level downgrade, or cherry-picked patch from upstream distcc 3.5 pre-release.Blocks: kernel builds cannot use distcc on boltzmann. Local -j16 falls back to ~20-25 min instead of ~8 min with CT108+tesla workers.
Session reference: Bin campaign kernel rebuild 2026-04-20 (noether).
Fixed in 3.4-17 (commit
ef7911d) withfix-gcc-rewrite-fqn-overflow.patch.Root cause
Upstream
src/compile.c:dcc_gcc_rewrite_fqn()sized the rewritten-compiler-name buffer withstrlen(argv[0] + 1)— pointer arithmetic applied before strlen. Forargv[0] = "gcc"that evaluates tostrlen("cc") = 2, under-allocating the buffer by 2 bytes. Intent wasstrlen(argv[0]) + 1(length plus terminator).The subsequent
strcat(newcmd, argv[0])then overflows by 2 bytes. Pre-FORTIFY builds (our old pkgrel=15 shipped before Arch's makepkg.conf bumped to_FORTIFY_SOURCE=2) silently clobbered 2 bytes of heap adjacent metadata — which happened to be harmless on the short-allocation paths glibc's tcache was using, so the bug went unnoticed for years. pkgrel=16 was built under FORTIFY=2, which promoted the silent overwrite into anabort().Verification
*** buffer overflow detected ***on everydistcc gcc …invocation.distcc gcc --versionreturns the expected cross-compiler banner.Upstream
Worth filing at https://github.com/distcc/distcc/issues — the upstream
v3.4tag (2021) still carries this. Not yet done; will note if/when reported.