Repository navigation
fix(windows): reject native addons with unusable delay-import tables - #14258
ShuaixinHuang wants to merge 3 commits into
Conversation
[Medium impact] The PR appears safe to merge, with no blocking issues found. SummaryThe PR rejects Windows native addons with a missing delay-import directory or an IAT outside writable, file-backed section data.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Link[Link Windows addon] --> Check[Check delay imports]
Check -->|Pass| Manifest[Write manifest]
Restore[Restore or download addon] --> Identity[Check manifest and byte identity]
Identity --> Verify[Check delay imports]
Verify -->|Pass| Accept[Accept artifact]
Check -->|Fail| Reject[Stop with diagnostic]
Verify -->|Fail| Reject
Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…15216) * fix: deepen verified coverage for PR #14258 * fix(windows): recognize GNU delay-import terminator placement * fix(windows): validate complete delay-import address tables * fix(windows): validate delay-load descriptor targets * fix(windows): validate delay-import function names * fix(windows): bound delay imports to the dedicated IAT section * test(windows): cover delay-import verifier refusals * test(windows): cover nonzero delay-import padding * fix(windows): require readable delay-import descriptors * test(windows): accept read-only delay import names * fix(windows): validate initial delay loader state --------- Co-authored-by: ShuaixinHuang <[email protected]> Co-authored-by: ShuaixinHuang <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
Summary
Fail the Windows native build and artifact verification when the cross-linker emits no delay-import directory or puts a delay-import address table in read-only PE data. These layouts previously passed identity verification even though the reported Debian build crashed at its first Node-API call.
Problem and expected behavior
The report records a write access violation at the delay IAT RVA on Windows Server 2025. The failing Debian 13 output had an empty delay-import data-directory entry and a read-only IAT section. The published Ubuntu build had a declared directory and writable IAT section. Report and fault evidence
Change and scope
Reuse the COFF, optional-header, and section readers to find the delay directory and check each descriptor's IAT RVA against a file-backed writable section. Run the check immediately after linking and in the artifact verification command, which also checks restored artifacts. Include the PE header readers in the Windows build cache key.
Contract and boundary impact
Evidence and regression coverage
[email protected]addon passed locally. Clearing write permission on the containing PE section and recalculating the digest passed the identity checks but failed the new check. Clearing the directory entry also failed the new check.Validation performed
node scripts/run-typescript.mjs -p tsconfig.build.jsonpassed.vitest run src/domain/windowsNativeArtifact.test.ts tests/boundary/process/windowsNativeArtifactVerifier.test.tspassed all 31 tests.git diff --checkpassed.Compatibility, safety, and release
No migration or ABI change. Local builders whose toolchain emits either unusable layout now fail with a diagnostic. The verifier reads build output without loading or executing it.
Supersedes #12756.
Resubmission of #14057.
Author readiness
Human owner: @ShuaixinHuang