I upgraded to Windows 11 24H2, and now my custom driver consistently causes a BSOD with the error code "MEMORY_MANAGEMENT (1a)".
Before the 24H2 update, my driver was functioning perfectly under the same conditions in previous versions of Windows 11, so I believe this issue is related to the 24H2 update.
I did some research and found that many third-party drivers are experiencing similar issues (for example, Voicemeeter). Some claim to have resolved the problem. Does this mean it can be fixed without intervention from Microsoft?
I would like to know if other developers have encountered this issue and how I might modify my driver to ensure compatibility with the 24H2 update.
My driver implementation is similar to a virtual file system, and I will modify the data read by IO according to my needs. For write operations, I will only record which files are dirty.
It looks like you're doing some illegal tricks with the image section in your VFS.
> !pfn ffff9a800b616a80
PFN 003CB238 at address FFFF9A800B616A80
flink 00000000 blink / share count 00000000 pteaddress FFFFA702DB4835F0
reference count 0000 used entry count 00A0 Cached color 0 Priority 5
restore pte E007561D34A00420 containing page 2EF6EE Modified MP
Modified Shared
> !pte ffff9a800b616a80+0x10 1 // Pfn->OriginalPte
VA ffff9a800b616a90
PXE at FFFF9A800B616A90 PPE at FFFF9A800B616A90 PDE at FFFF9A800B616A90 PTE at FFFF9A800B616A90
contains E007561D34A00420
contains E007561D34A00420
not valid
Subsection: FFFFE007561D34A0
Protect: 1 - Readonly
Physical page of image section has been modified, but none of the subsections can be legally modified "in-place" - only ReadOnly (1), ExecuteRead (3) and ReadWriteCopy( 5) protections are used:
> dt _SUBSECTION FFFFE007561D34A0
nt!_SUBSECTION
+0x000 ControlArea : 0xffffe007`561d3420 _CONTROL_AREA
+0x008 SubsectionBase : 0xffffa702`db4835f0 _MMPTE
+0x010 NextSubsection : 0xffffe007`561d34d8 _SUBSECTION
+0x018 GlobalPerSessionHead : _RTL_AVL_TREE
+0x018 CreationWaitList : (null)
+0x020 SubsectionFlags : _MMSUBSECTION_FLAGS
+0x024 StartingSector : 0
+0x028 NumberOfFullSectors : 2
+0x02c PtesInSubsection : 1
+0x030 u1 : <unnamed-tag>
+0x034 UnusedPtes : 0y000000000000000000000000000000 (0)
+0x034 ExtentQueryNeeded : 0y0
+0x034 Spare : 0y0
!ca 0xffffe007`561d3420
ControlArea @ ffffe007561d3420
Segment ffffa7031439b160 Flink ffffe00775263518 Blink ffffe007752717c8
Section Ref 0 Pfn Ref 9d Mapped Views 0
User Ref 0 WaitForDel 0 Flush Count 0
File Object ffffe00779759840 PartitionId 0
Flags (100000a0) Image File OnUnusedList
\Engine\Binaries\Win64\UnrealTraceServer.exe
Segment @ ffffa7031439b160
ControlArea ffffe007561d3420 BasedAddress 00007ff64f260000
Total Ptes 9f
Segment Size 9f000 Committed 0
Image Commit 5 Image Info ffffa7031439b1a8
ProtoPtes ffffa702db4835f0
Flags (14270000) ProtectionMask
Subsection 1 @ ffffe007561d34a0
ControlArea ffffe007561d3420 Starting Sector 0 Number Of Sectors 2
Base Pte ffffa702db4835f0 Ptes In Subsect 1 Unused Ptes 0
Flags 2 Sector Offset 0 Protection 1
Subsection 2 @ ffffe007561d34d8
ControlArea ffffe007561d3420 Starting Sector 2 Number Of Sectors 353
Base Pte ffffa702db4835f8 Ptes In Subsect 6b Unused Ptes 0
Flags 6 Sector Offset 0 Protection 3
Subsection 3 @ ffffe007561d3510
ControlArea ffffe007561d3420 Starting Sector 355 Number Of Sectors fc
Base Pte ffffa702db483950 Ptes In Subsect 20 Unused Ptes 0
Flags 2 Sector Offset 0 Protection 1
Subsection 4 @ ffffe007561d3548
ControlArea ffffe007561d3420 Starting Sector 451 Number Of Sectors 15
Base Pte ffffa702db483a50 Ptes In Subsect 5 Unused Ptes 0
Flags a Sector Offset 0 Protection 5
Subsection 5 @ ffffe007561d3580
ControlArea ffffe007561d3420 Starting Sector 466 Number Of Sectors 2b
Base Pte ffffa702db483a78 Ptes In Subsect 6 Unused Ptes 0
Flags 2 Sector Offset 0 Protection 1
Subsection 6 @ ffffe007561d35b8
ControlArea ffffe007561d3420 Starting Sector 491 Number Of Sectors 1
Base Pte ffffa702db483aa8 Ptes In Subsect 1 Unused Ptes 0
Flags 2 Sector Offset 0 Protection 1
Subsection 7 @ ffffe007561d35f0
ControlArea ffffe007561d3420 Starting Sector 492 Number Of Sectors 29
Base Pte ffffa702db483ab0 Ptes In Subsect 6 Unused Ptes 0
Flags 2 Sector Offset 0 Protection 1
Subsection 8 @ ffffe007561d3628
ControlArea ffffe007561d3420 Starting Sector 4bb Number Of Sectors 7
Base Pte ffffa702db483ae0 Ptes In Subsect 1 Unused Ptes 0
Flags 2 Sector Offset 0 Protection 1
P.S. I see that there is a data section for the same file:
Thank you very much for your professional analysis.
I have a general idea of where the issue lies with my driver. In the PreRead callback, I wanted to redirect read operations to another file, but my handling of paging I/O might be inappropriate.
RtlZeroMemory() doesn't write to read-only memory because MdlMappingNoWrite isn't specified.
Reading with FltReadFile() without the FLTFL_IO_OPERATION_PAGINGlooks strange, but is unlikely to have caused current problem.
What does your driver do besides redirecting paging reads?
What is meant by "record which files are dirty"?
Maybe you create sections?
Do you manage access sharing in CREATE callbacks?
Do you interact directly with the Cc or Mm API?
Do I understand correctly that we are talking about PrismFsCore.sys?
Have you tried running it with the driver verifier and filter verifier?
It would be great if you could reproduce the issue and attach a full kernel dump (not only automatic/kernel bitmap file).
Thank you very much for all your support and suggestions, which have been greatly helpful for my development.
Based on your suggestions, I have rechecked my implementation and did find some issues. I will attempt to conduct a round of fixes and tests to try to resolve the problem. If I succeed in fixing it, I will get back to you.