[PR #65] [MERGED] Recheck PROM state after allocation and preserve the first error #132

Closed
opened 2026-10-31 07:02:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/pull/65
Author: @impacifist
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @impacifist

Base: main ← Head: fix/prom-read-boundary


📝 Commits (1)

  • 0b4d844 Recheck PROM read state after allocation and preserve the first error

📊 Changes

4 files changed (+160 additions, -2 deletions)

View changed files

📝 CHANGES.md (+12 -0)
📝 internal-boot/boot/full-release.c (+8 -2)
➕ internal-boot/boot/test-prom-boundary.ps1 (+24 -0)
➕ internal-boot/boot/test_prom_boundary.c (+116 -0)

📄 Description

Problem and result

PROM buffer allocation is a firmware service call, but the release path previously started dependent reads without rechecking the PCI state afterward. A later FreePool failure also replaced the original read/hash error. Revalidate the exact interface, device location/identity, complete 64-DWORD baseline and MEM1/BME0 before reading; retain the first error during cleanup.

Adapt the shared safety idea proposed by embersas in #53 into a small independent change on main. Preserve both IO-enabled and IO-disabled configurations. No dependency on #48 or #49, new MSI profile, proposed attribute-cache policy, support-envelope expansion or installer change.

Validation and limits

New capture-free tests use synthetic RAM and the real SHA-256 implementation. The synthetic PROM pin is restricted to the hosted test translation unit; production hashes and admission checks are unchanged. internal-boot/boot/test-prom-boundary.ps1 runs five reference profiles in manual and headless configurations.

  • Ten configurations passed, each with 4,244 host checks: IO=0/1, allocation-return identity/interface/BDF/MEM/BME changes, all 64 config words, failures in all 16 read chunks, hash mismatch and combined primary/cleanup failures.
  • Local negative controls fail when using the old implementation or restoring first-error replacement, demonstrating that the regressions detect both defects.
  • Existing cold prechecks passed 197 cases on each of five profiles; existing full-flow tests passed 39 checks.
  • Independent read-only source/risk review found no blocker. Diff/scope and a four-file secret scan passed.

Tests require a local host compiler only; no downloads, private firmware/captures, privileges or device operations. Sanitizers, private-capture full-release replay, real GPU/EFI execution and Windows recovery were not tested. This protects the first-read service-return boundary, not atomicity across every firmware operation. No new hardware support is claimed. Draft for owner review; does not merge or close #53.

한국어 검토 요약

#53에서 공통으로 필요한 PROM 안전 수정만 분리했습니다. 메모리 할당 뒤 PCI 상태를 재확인하고, 정리 실패가 최초 오류를 덮지 않게 합니다. 장비별 상수와 속성 허용 완화는 포함하지 않습니다. 기존 5개 프로필의 수동·헤드리스 모의 검사와 독립 리뷰를 통과했으며 실장비 실행은 하지 않았습니다.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/pull/65 **Author:** [@impacifist](https://github.com/impacifist) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@impacifist](https://github.com/impacifist) **Base:** `main` ← **Head:** `fix/prom-read-boundary` --- ### 📝 Commits (1) - [`0b4d844`](https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/commit/0b4d8446b11d3782994435bae10c8a5a516e18d5) Recheck PROM read state after allocation and preserve the first error ### 📊 Changes **4 files changed** (+160 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `CHANGES.md` (+12 -0) 📝 `internal-boot/boot/full-release.c` (+8 -2) ➕ `internal-boot/boot/test-prom-boundary.ps1` (+24 -0) ➕ `internal-boot/boot/test_prom_boundary.c` (+116 -0) </details> ### 📄 Description ## Problem and result PROM buffer allocation is a firmware service call, but the release path previously started dependent reads without rechecking the PCI state afterward. A later FreePool failure also replaced the original read/hash error. Revalidate the exact interface, device location/identity, complete 64-DWORD baseline and MEM1/BME0 before reading; retain the first error during cleanup. Adapt the shared safety idea proposed by embersas in #53 into a small independent change on main. Preserve both IO-enabled and IO-disabled configurations. No dependency on #48 or #49, new MSI profile, proposed attribute-cache policy, support-envelope expansion or installer change. ## Validation and limits New capture-free tests use synthetic RAM and the real SHA-256 implementation. The synthetic PROM pin is restricted to the hosted test translation unit; production hashes and admission checks are unchanged. `internal-boot/boot/test-prom-boundary.ps1` runs five reference profiles in manual and headless configurations. - Ten configurations passed, each with 4,244 host checks: IO=0/1, allocation-return identity/interface/BDF/MEM/BME changes, all 64 config words, failures in all 16 read chunks, hash mismatch and combined primary/cleanup failures. - Local negative controls fail when using the old implementation or restoring first-error replacement, demonstrating that the regressions detect both defects. - Existing cold prechecks passed 197 cases on each of five profiles; existing full-flow tests passed 39 checks. - Independent read-only source/risk review found no blocker. Diff/scope and a four-file secret scan passed. Tests require a local host compiler only; no downloads, private firmware/captures, privileges or device operations. Sanitizers, private-capture full-release replay, real GPU/EFI execution and Windows recovery were not tested. This protects the first-read service-return boundary, not atomicity across every firmware operation. No new hardware support is claimed. Draft for owner review; does not merge or close #53. ## 한국어 검토 요약 #53에서 공통으로 필요한 PROM 안전 수정만 분리했습니다. 메모리 할당 뒤 PCI 상태를 재확인하고, 정리 실패가 최초 오류를 덮지 않게 합니다. 장비별 상수와 속성 허용 완화는 포함하지 않습니다. 기존 5개 프로필의 수동·헤드리스 모의 검사와 독립 리뷰를 통과했으며 실장비 실행은 하지 않았습니다. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 07:02:03 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
windows-GPU-UNLOCK/Windows-GPU-UNLOCK#132
No description provided.