Skip to content

driver: look up registry redirects at PASSIVE_LEVEL - #155

Draft
eiz-claude wants to merge 2 commits into
mack/fix-installer-hardware-id-walkfrom
mack/fix-registry-filter-irql
Draft

eiz-claude wants to merge 2 commits into
mack/fix-installer-hardware-id-walkfrom
mack/fix-registry-filter-irql

Conversation

@eiz-claude

@eiz-claude eiz-claude commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

With per-app routing on, SAR's registry filter bugchecks the machine under Driver Verifier. Without Verifier it can crash whenever the code involved happens to be paged out.

Once a host starts with enableApplicationRouting, the driver's registry callback runs for every registry value query on the machine. SarFilterMatchesPath looked the key up in the redirect tables under an EX_SPIN_LOCK, which raises IRQL to DISPATCH_LEVEL. The table's compare routine calls RtlCompareUnicodeString, which is pageable. The key was copied to nonpaged memory first, but only to work around the spin lock; a TODO there already suggested an ERESOURCE. With Verifier on, the first registry query after the host starts crashed the test VM:

IRQL_NOT_LESS_OR_EQUAL (a)   process: taskhostw.exe (svchost.exe on the rerun)
nt!RtlCompareUnicodeString
SynchronousAudioRouter!SarCompareStringTableEntry+0x16
nt!RtlLookupElementGenericTableAvl+0xec
SynchronousAudioRouter!SarGetStringTableEntry+0x21
SynchronousAudioRouter!SarFilterMatchesPath+0x7a
SynchronousAudioRouter!SarRegistryCallback+0x6d
nt!CmpCallCallBacksEx+0x283
nt!NtQueryValueKey+0x4ba

The fix guards the tables with an ERESOURCE: shared for lookups, exclusive at unload. The configuration manager's path is now used directly.

I haven't matched this against any open issue. Bugcheck 0xA in SarCompareStringTableEntry would be the signature in a reporter's dump.

Test

New app-routing scenario in the issues group:

  1. Register SarAsio's COM classes.
  2. Run a loopback whose configuration turns application routing on. That starts the filter, and the harness's own WASAPI client then goes through SarAsio's device enumerator wrapper.
  3. Unregister the classes.
test VM (Driver Verifier on) result
test without the fix bugcheck 0xA above, at the first registry query after the host started
with the fix passes; the full suite runs to the end with the filter registered

The suite never turned application routing on before this, which is why it never hit this.

🤖 Generated with Claude Code

eiz and others added 2 commits October 3, 2026 11:22
Adds an app-routing scenario to the issues group: SarAsio's COM classes
registered and a loopback run whose configuration turns application
routing on. That starts the driver's registry filter, which then sees
every registry value query on the machine, and sends the harness's own
WASAPI client through SarAsio's device enumerator wrapper. SarTest
gains --app-routing for the configuration it writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With application routing on, the driver's registry callback runs for
every registry value query on the machine. It looked the key up in the
redirect tables under a spin lock, at DISPATCH_LEVEL, but the table's
comparison routine calls RtlCompareUnicodeString, which is pageable
(and the key was copied to nonpaged memory first only because of the
lock). When that code was paged out, the lookup bugchecked with
IRQL_NOT_LESS_OR_EQUAL. Under Driver Verifier it happens on the first
registry query after a host turns application routing on:

  IRQL_NOT_LESS_OR_EQUAL (a), process taskhostw.exe
  nt!RtlCompareUnicodeString
  SynchronousAudioRouter!SarCompareStringTableEntry+0x16
  nt!RtlLookupElementGenericTableAvl+0xec
  SynchronousAudioRouter!SarGetStringTableEntry+0x21
  SynchronousAudioRouter!SarFilterMatchesPath+0x7a
  SynchronousAudioRouter!SarRegistryCallback+0x6d
  nt!CmpCallCallBacksEx+0x283

Guard the tables with an ERESOURCE instead, as the old TODO suggested,
and look up the configuration manager's path directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eiz-claude
eiz-claude added this pull request to stack #154 October 3, 2026 16:28
@eiz-claude eiz-claude changed the title mack/fix registry filter irql driver: look up registry redirects at PASSIVE_LEVEL Oct 3, 2026
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