# CVE-2026-119823 — storport.sys patch diff

`storport.sys` 10.0.26100.9818 -> 10.0.26100.9974 (ghidriff).

## `StorQueryMFNDNamespacePageMap`  (modified)

```diff
--- StorQueryMFNDNamespacePageMap
+++ StorQueryMFNDNamespacePageMap
@@ -1,26 +1,181 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* WARNING: Removing unreachable block (ram,0x000140197599) */

+/* WARNING: Removing unreachable block (ram,0x00014019758f) */

+/* WARNING: Removing unreachable block (ram,0x000140197594) */

+/* WARNING: Removing unreachable block (ram,0x0001401975a2) */

+/* WARNING: Removing unreachable block (ram,0x0001401975a9) */

 

-int StorQueryMFNDNamespacePageMap(char param_1)

+int StorQueryMFNDNamespacePageMap(longlong param_1,longlong param_2,ulonglong *param_3)

 

 {

-  undefined1 *in_RAX;

-  longlong unaff_RBP;

-  int unaff_ESI;

-  undefined2 unaff_R15W;

-  bool in_ZF;

+  byte bVar1;

+  longlong lVar2;

+  undefined2 *_Dst;

+  ulonglong uVar3;

+  bool bVar4;

+  char cVar5;

+  int iVar6;

+  uint uVar7;

+  int iVar8;

+  uint *puVar9;

+  undefined2 *puVar10;

+  uint uVar11;

+  ulonglong _Size;

+  size_t _Size_00;

+  bool bVar12;

+  int local_res20 [2];

+  uint local_78;

+  uint local_74;

+  undefined4 local_50;

+  undefined4 local_4c;

+  int local_48;

+  uint local_44;

+  uint local_3c;

   

-  if (in_ZF) {

-    if (unaff_ESI < 0) {

-      StorMapMFNDErrorToNtStatus(unaff_R15W,unaff_RBP + 0x6f);

-      unaff_ESI = *(int *)(unaff_RBP + 0x6f);

+  lVar2 = *(longlong *)(param_2 + 0xb8);

+  _Dst = *(undefined2 **)(param_2 + 0x18);

+  _Size = (ulonglong)*(uint *)(lVar2 + 8);

+  memset(&local_78,0,0x40);

+  bVar4 = false;

+  *param_3 = 0;

+  cVar5 = StorIsMFNDSupported(param_1);

+  if (cVar5 == '\0') {

+    local_res20[0] = -0x3fffff45;

+  }

+  else if (*(int *)(*(longlong *)(param_1 + 0x1810) + 0x24) == 1) {

+    if (*(uint *)(lVar2 + 0x10) < 0x28) {

+      local_res20[0] = -0x3fffff11;

     }

-    StorLogMFNDQueryMigrationQoS();

-    return unaff_ESI;

+    else if ((((_Dst[4] == 1) && (0x1f < *(uint *)(_Dst + 6))) && (*(int *)(_Dst + 8) != 0)) &&

+            (((*(int *)(_Dst + 8) < 3 && (_Dst[10] != 0)) && (*(int *)(_Dst + 0x10) != 0)))) {

+      if (_Dst == (undefined2 *)0x0) {

+        local_res20[0] = -0x3ffffff3;

+      }

+      else {

+        iVar6 = StorRetrieveMFNDChildPFGlobalProperty(param_1);

+        local_res20[0] = iVar6;

+        if (iVar6 < 0) goto LAB_0;

+        lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x1810) + 0x28);

+        if ((lVar2 != 0) && (bVar1 = *(byte *)(lVar2 + 2), bVar1 != 0)) {

+          uVar11 = 1 << (bVar1 & 0x1f);

+          if (*(int *)(_Dst + 8) == 1) {

+            puVar10 = (undefined2 *)(ulonglong)*(byte *)(*(longlong *)(param_1 + 0x1808) + 0x49);

+          }

+          else {

+            puVar10 = (undefined2 *)0x0;

+            if (*(int *)(_Dst + 8) == 2) {

+              puVar10 = (undefined2 *)(ulonglong)*(byte *)(*(longlong *)(param_1 + 0x1808) + 0x4a);

+            }

+          }

+          uVar7 = 0x1000 << ((byte)puVar10 & 0x1f);

+          if (((uVar11 != 0) && (uVar7 != 0)) && (uVar11 <= uVar7)) {

+            uVar3 = (ulonglong)uVar7 / (ulonglong)uVar11;

+            if (*(ulonglong *)(_Dst + 0xc) % (ulonglong)(uint)((int)uVar3 << 5) == 0) {

+              uVar11 = *(uint *)(_Dst + 0x10);

+              if ((int)((ulonglong)uVar11 % uVar3) == 0) {

+                iVar6 = Feature_755916090__private_IsEnabledDeviceUsageNoInline();

+                if (iVar6 == 0) {

+                  _Size_00 = uVar11 / uVar3 + 7 >> 3;

+                }

+                else {

+                  _Size_00 = (ulonglong)((uVar11 / uVar3 & 7) != 0) + (uVar11 / uVar3 >> 3);

+                }

+                if ((int)_Size_00 + 0x14 <= _Size) {

+                  bVar4 = true;

+                  iVar6 = StorMFNDAttemptSwitchToAdminPrivilege(param_1,(ulonglong)uVar11 % uVar3);

+                  local_res20[0] = iVar6;

+                  if (-1 < iVar6) {

+                    uVar7 = (int)_Size_00 + 4;

+                    puVar9 = (uint *)RaidAllocatePool(0x40,uVar7,0x464d6152,

+                                                      *(undefined8 *)(param_1 + 8));

+                    if (puVar9 == (uint *)0x0) {

+                      local_res20[0] = -0x3fffff66;

+                      goto LAB_1;

+                    }

+                    local_78 = local_78 & 0xffffffd2 | 0xd2;

+                    local_74 = (uint)(ushort)_Dst[10];

+                    local_48 = *(int *)(_Dst + 0x10) + -1;

+                    local_50 = (undefined4)*(undefined8 *)(_Dst + 0xc);

+                    local_44 = uVar7 >> 2;

+                    local_4c = (undefined4)((ulonglong)*(undefined8 *)(_Dst + 0xc) >> 0x20);

+                    local_3c = CONCAT31(local_3c._1_3_,9);

+                    if (*(int *)(_Dst + 8) == 1) {

+                      local_3c = local_3c & 0xfffff0ff;

+                    }

+                    else if (*(int *)(_Dst + 8) == 2) {

+                      local_3c = local_3c & 0xfffff1ff | 0x100;

+                    }

+                    iVar6 = StorSendMFNDCommand(param_1,puVar9,0,uVar7,&local_78);

+                    local_res20[0] = iVar6;

+                    if (-1 < iVar6) {

+                      memset(_Dst,0,_Size);

+                      iVar8 = Feature_755916090__private_IsEnabledDeviceUsageNoInline();

+                      if (iVar8 == 0) {

+                        bVar12 = (ulonglong)(*puVar9 * 8 * (int)uVar3) ==

+                                 ((((ulonglong)uVar11 - 1) + uVar3 * 8) / (uVar3 * 8)) * uVar3 * 8;

+                      }

+                      else {

+                        bVar12 = *puVar9 == _Size_00;

+                      }

+                      if (bVar12) {

+                        *_Dst = 1;

+                        *(undefined4 *)(_Dst + 4) = 1;

+                        iVar8 = Feature_755916090__private_IsEnabledDeviceUsageNoInline();

+                        if (iVar8 == 0) {

+                          _Size_00 = (size_t)*puVar9;

+                        }

+                        *(int *)(_Dst + 8) = (int)_Size_00;

+                        *(undefined4 *)(_Dst + 2) = 0x14;

+                        memcpy(_Dst + 10,puVar9 + 1,_Size_00);

+                        *(int *)(_Dst + 2) = *(int *)(_Dst + 2) + *(int *)(_Dst + 8);

+                      }

+                      else {

+                        iVar6 = -0x3fffff64;

+                        local_res20[0] = -0x3fffff64;

+                      }

+                      *param_3 = (ulonglong)*(uint *)(_Dst + 2);

+                    }

+                    ExFreePoolWithTag(puVar9,0x464d6152);

+                  }

+                  goto LAB_0;

+                }

+                local_res20[0] = -0x3fffffdd;

+              }

+              else {

+                local_res20[0] = -0x3fffff0f;

+              }

+            }

+            else {

+              local_res20[0] = -0x3fffff10;

+            }

+            goto LAB_1;

+          }

+        }

+        local_res20[0] = -0x3fffff64;

+      }

+    }

+    else {

+      iVar6 = -0x3ffffff3;

+      local_res20[0] = -0x3ffffff3;

+LAB_0:

+      if (-1 < iVar6) goto LAB_2;

+    }

   }

-  *in_RAX = *in_RAX;

-  in_RAX[-0x75] = in_RAX[-0x75] + param_1;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  else {

+    local_res20[0] = -0x3ffffe7c;

+  }

+LAB_1:

+  StorMapMFNDErrorToNtStatus(0,local_res20);

+  iVar6 = local_res20[0];

+LAB_2:

+  if (bVar4) {

+    StorMFNDAttemptSwitchToUserPrivilege(param_1);

+  }

+  puVar10 = (undefined2 *)0x0;

+  if (-1 < iVar6) {

+    puVar10 = _Dst;

+  }

+  StorLogMFNDQueryNSPageMap(param_1,puVar10,0,iVar6);

+  return iVar6;

 }
```
