Skip to content

phase1b: add Win32k disable mitigation constant#290

Merged
MGudgin merged 1 commit into
mainfrom
user/gudge/downlevel_phase1b
May 12, 2026
Merged

phase1b: add Win32k disable mitigation constant#290
MGudgin merged 1 commit into
mainfrom
user/gudge/downlevel_phase1b

Conversation

@MGudgin

@MGudgin MGudgin commented May 12, 2026

Copy link
Copy Markdown
Member

📖 Description

Introduces a Windows-only constants/helper module exposing the PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON mitigation flag (1 << 28 from winnt.h), which is documented in the Windows SDK but is not generated into the windows crate metadata. If a future windows crate release adds it, this module becomes redundant and can be deleted.

The companion attribute identifier PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY is already available from windows::Win32::System::Threading (the Win32_System_Threading feature is enabled at the workspace level), so it is used directly at call sites — cast to usize because UpdateProcThreadAttribute's dwAttribute parameter is DWORD_PTR.

Provides a win32k_disable_value() helper and a unit test verifying the documented bit position.

No callers yet — this prepares for AppContainer Phase 1 integration where UpdateProcThreadAttribute will apply the mitigation before the child's first user-mode instruction.

🔗 References

Next in the downlevel-fallback stack: phase1c (#291).

🔍 Validation

  • cargo test -p wxc_common --lib process_mitigation passes
  • cargo build -p wxc_common clean
  • End-to-end coverage (UI mitigation matrix verifying Win32k restrictions take effect at the kernel level) lives in Win25H2Safe-Tests.ps1 in phase5 (held)

Base automatically changed from user/gudge/downlevel_phase1a to main May 12, 2026 20:44
@MGudgin MGudgin force-pushed the user/gudge/downlevel_phase1b branch 2 times, most recently from bb44689 to 2e7f5cc Compare May 12, 2026 20:51
@MGudgin MGudgin changed the title phase1b: add process_mitigation module for Win32k disable phase1b: add Win32k disable mitigation constant May 12, 2026
Introduces a Windows-only constants/helper module exposing the
PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON
mitigation flag (1 << 28 from winnt.h), which is documented in the
Windows SDK but is not generated into the `windows` crate metadata.
If a future `windows` crate release adds it, this module becomes
redundant and can be deleted.

The companion attribute identifier PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY
is already available from windows::Win32::System::Threading and is used
directly at call sites (cast to usize because UpdateProcThreadAttribute's
dwAttribute parameter is DWORD_PTR).

Provides a win32k_disable_value() helper and a unit test verifying the
documented bit position. No callers yet; this prepares for AppContainer
Phase 1 integration where UpdateProcThreadAttribute will apply the
mitigation before the child's first user-mode instruction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MGudgin MGudgin force-pushed the user/gudge/downlevel_phase1b branch from 2e7f5cc to 793b93a Compare May 12, 2026 21:00
@MGudgin MGudgin merged commit 88b7487 into main May 12, 2026
8 checks passed
@MGudgin MGudgin deleted the user/gudge/downlevel_phase1b branch May 12, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants