Skip to content

ci: drop external DTD from minimal fontconfig to avoid expat NULL-deref crash - #322909

Merged
Alexandru Dima (alexdima) merged 1 commit into
mainfrom
fix/fontconfig-expat-doctype-crash
Jun 25, 2026
Merged

Alexandru Dima (alexdima) merged 1 commit into
mainfrom
fix/fontconfig-expat-doctype-crash

Conversation

@alexdima

Copy link
Copy Markdown
Member

What

Removes the external DTD declaration from the minimal fontconfig config that the Linux smoke-test job installs as a workaround for the expat 2.6.1 NULL-deref CVEs.

  <?xml version="1.0"?>
- <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
  <fontconfig>

Why

The job already sets FONTCONFIG_FILE=/tmp/fonts-minimal.conf with <include> removed to avoid the expat external-entity crash path. But a flaky smoke-test failure (run 28140700565, Linux / Electron-Smoke) still crashed with that workaround active.

I pulled the crash-dump artifact and walked the minidump. The faulting thread was a SIGSEGV (NULL deref, fault address 0x0) with this native stack:

libc.so.6
libfontconfig.so.1   (config parsing)
libexpat.so.1        (XML / external-entity parsing)
...Chromium browser-process font-init frames...

i.e. the crash is in libexpat called from libfontconfig during Chromium's browser-process font initialization at startup — not in VS Code/Chromium logic. The dump confirms FONTCONFIG_FILE=/tmp/fonts-minimal.conf was in effect and the minimal config was loaded.

The remaining trigger is the <!DOCTYPE … SYSTEM "urn:fontconfig:fonts.dtd"> line: fontconfig feeds that DTD to expat as an external parameter entity, which still hits the not-yet-backported CVE-2026-32776 / CVE-2026-32778 NULL-deref paths on expat 2.6.1 even after <include> was removed. fontconfig does not require the DOCTYPE, so dropping it removes the last external-entity codepath.

Validation

  • Workflow YAML parses (PyYAML safe_load).
  • The generated config (DOCTYPE removed) parses as valid XML; the diagnostics step's ElementTree.parse does not fetch external DTDs, so it is unaffected.

Notes for reviewers

Co-authored-by: Copilot [email protected]

…ef crash

The Linux smoke-test job works around the expat 2.6.1 fontconfig NULL-deref
CVEs by pointing FONTCONFIG_FILE at a minimal config with <include> removed.
However that config still declared an external DTD:

    <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">

fontconfig feeds that DTD to expat as an external *parameter* entity, which
still hits the not-yet-backported CVE-2026-32776 / CVE-2026-32778 crash paths
on expat 2.6.1 even with <include> gone. This was observed in CI as a SIGSEGV
inside libexpat (called from libfontconfig) during Chromium browser-process
font initialization, which crashed Electron at startup. Because the smoke-test
launch used no timeout, that crash surfaced only as an opaque 120s Mocha
"before all" hook timeout.

fontconfig does not require the DOCTYPE, so drop it to remove the last
external-entity codepath. The full workaround can be removed once the runner
ships libexpat >= 2.7.5 (the step already auto-disables itself in that case).

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Linux test workflow’s “minimal fontconfig” workaround to eliminate all expat external-entity parsing paths by removing the external <!DOCTYPE … SYSTEM "urn:fontconfig:fonts.dtd"> declaration from the generated /tmp/fonts-minimal.conf. This aligns with the stated goal of avoiding expat 2.6.1 NULL-deref crash paths during Chromium/Electron font initialization on Ubuntu runners.

Changes:

  • Expand the workaround rationale to explicitly cover the external DTD/parameter-entity path and document the observed Electron startup crash signature.
  • Remove the external DOCTYPE line from the heredoc-generated minimal fontconfig XML.
  • Keep the existing version gate that disables the workaround when libexpat1 >= 2.7.5 is present.
Show a summary per file
File Description
.github/workflows/pr-linux-test.yml Removes the external DTD reference from the minimal fontconfig config generated in the workflow to avoid expat external-entity parsing crash paths.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants