Skip to content

[no-ci] CI: verify the Authenticode signature of vc_redist.x64.exe - #3443

Merged
juenglin merged 2 commits into
NVIDIA:mainfrom
juenglin:emudhra-vc-redist-authenticode
Nov 10, 2026
Merged

juenglin merged 2 commits into
NVIDIA:mainfrom
juenglin:emudhra-vc-redist-authenticode

Conversation

@juenglin

Copy link
Copy Markdown
Contributor

Description

Refs #3195.

The nightly PyTorch rows in test-wheel-windows.yml download vc_redist.x64.exe from aka.ms and run it silently with admin rights, without checking its signature. Start-Process -Wait without -PassThru also ignored the installer's exit code, so a failed install went unnoticed until PyTorch failed to import.

This PR:

  • Requires a Valid Authenticode signature from O=Microsoft Corporation before running the installer. Get-AuthenticodeSignature only reports Valid after Windows builds the chain to a trusted root, so a tampered or redirected download fails the step.
  • Fails the step on installer errors. Exit codes 1638 (a newer version is already installed) and 3010 (success, reboot required) are accepted.
  • Downloads into RUNNER_TEMP instead of the workspace.

Validation

pre-commit (including actionlint) passes. This step only runs in ci-nightly.yml (test-mode: nightly-pytorch), so PR CI does not exercise it; the next nightly run will.

A 13.4.x backport follows.

Checklist

  • I have read the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

The nightly PyTorch rows in test-wheel-windows.yml downloaded and silently
ran vc_redist.x64.exe without checking its signature or the installer's exit
code. Require a valid Microsoft Authenticode signature before running it,
fail on installer errors (allowing 1638 and 3010), and download into
RUNNER_TEMP. This matches the existing vc_redist.arm64.exe check.

Refs NVIDIA#3195
@juenglin juenglin added the CI/CD CI/CD infrastructure label Nov 10, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@juenglin juenglin self-assigned this Nov 10, 2026
@juenglin juenglin changed the title CI: verify the Authenticode signature of vc_redist.x64.exe [no-ci] CI: verify the Authenticode signature of vc_redist.x64.exe Nov 10, 2026
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test 7978973

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Improved reliability checks for the Windows nightly build’s runtime installation. The setup verifies the installer’s Microsoft signature, waits for installation to finish, and checks the result. It accepts successful, already-installed, and restart-required outcomes; other results fail the setup. The installer is removed after an accepted installation.

The Windows nightly-pytorch workflow downloads the VC++ Redistributable to a temporary directory, verifies its signature and signer, checks the installer exit code, and removes the installer after an accepted result.

Changes: Windows wheel test workflow

Layer / File(s) Summary
Redistributable installation checks
.github/workflows/test-wheel-windows.yml
The step verifies that the downloaded installer has a valid Authenticode signature from Microsoft Corporation. It waits for installation to finish and accepts exit codes 0, 1638, or 3010. Other exit codes fail the step. The step removes the installer after an accepted result.

Suggested labels: github_actions, to-be-backported

Suggested reviewers: leofang

Change: Bug fix

Merge Risk: Minimal · up to 9e1c0

No demonstrated issue blocks merging. The nightly Windows PyTorch run will still need to confirm that the new installer step works on its runners.

Architecture risk: Low · up to 9e1c0

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .github/workflows/test-wheel-windows.yml: The nightly-pytorch step now downloads the redistributable to RUNNER_TEMP, rejects invalid signatures or signer organizations other than exactly Microsoft Corporation, and checks the installer exit code, accepting only 0, 1638, or 3010. The previous flow started the installer without checking its result or verifying the downloaded file. The installer file is removed after an accepted result.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7978973 and 9e1c0e1.

Files selected for processing: 1

  • .github/workflows/test-wheel-windows.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8b66bdc and 7978973.

Files selected for processing: 1

  • .github/workflows/test-wheel-windows.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

@juenglin juenglin added the bug Something isn't working label Nov 10, 2026
The substring check on SignerCertificate.Subject also accepted an
organization such as "Microsoft Corporation Services Ltd" or a CN that
embeds "O=Microsoft Corporation". Compare the parsed organization
attribute (OID 2.5.4.10) instead, and check the signature status first so
an unsigned file gets a clear error.

Refs NVIDIA#3195
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test 9e1c0e1

@juenglin
juenglin merged commit c6ea09e into NVIDIA:main Nov 10, 2026
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants