[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] xenbus/dma: fail on unknown DMA operations version


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: david ambu <david.preetham@xxxxxxxxxx>
  • Date: Thu, 10 Sep 2026 17:10:09 +0100
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
  • Cc: david ambu <david.preetham@xxxxxxxxxx>
  • Delivery-date: Thu, 10 Sep 2026 16:12:51 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Return STATUS_NOT_SUPPORTED instead of ASSERT(FALSE) when an unknown
DMA operations size is encountered, preventing copy with unvalidated size.

Assisted-by: ClaudeCode:claude-sonnet-4-6
Signed-off-by: david ambu <david.preetham@xxxxxxxxxx>
---
 src/xenbus/dma.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/xenbus/dma.c b/src/xenbus/dma.c
index 206143e..07d4540 100644
--- a/src/xenbus/dma.c
+++ b/src/xenbus/dma.c
@@ -1657,7 +1657,10 @@ DmaGetAdapter(
         break;
 
     default:
-        ASSERT(FALSE);
+        Error("Unknown DMA operations size %lu\n",
+              Context->LowerOperations->Size);
+        status = STATUS_NOT_SUPPORTED;
+        goto fail3;
     }
 
     // Copy in the requisite number of operations
@@ -1688,6 +1691,11 @@ DmaGetAdapter(
 done:
     return Adapter;
 
+fail3:
+    Error("fail3\n");
+
+    DmaDestroyContext(Context);
+
 fail2:
     Error("fail2\n");
 
-- 
2.51.0.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.