|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 1/3] xenbus/dma: fail on unknown DMA operations version
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |