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

[PATCH] Prevent NULL MDL's from being queued for transmission.


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Martin Harvey <Martin.Harvey@xxxxxxxxxx>
  • Date: Wed, 28 Jul 2021 15:02:04 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Martin Harvey <Martin.Harvey@xxxxxxxxxx>, Martin Harvey <martin.harvey@xxxxxxxxxx>
  • Delivery-date: Wed, 28 Jul 2021 14:03:03 +0000
  • Ironport-hdrordr: A9a23:J0Bhl69EXVB0VDsO4mxuk+DWI+orL9Y04lQ7vn2YSXRuE/Bw8P re+8jztCWE8Qr5N0tQ+uxoVJPufZq+z+8Q3WByB8bBYOCOggLBR+sOgbcKqweQfREWndQ86U 4PScZD4aXLfD1Hsfo=
  • Ironport-sdr: j7Ah2phuGK4DUc/yli4h2AQVg0/70VPPub36MpznOKp7H9RGUgvdM8Md/nTcWV1fV7AIczQLIi mmv3yZmchMnPpcI3a3w/rSKskoes9gN6gK8RM4u+shUi6CkJq/wQZIv/n/GHAHG/20j17JIVmV MM5VY+LT0fymbVkc9J6NQNxZ+iOR9lbg8dWiFDOCnX+Dag6UT51uaVvqBTx/zkjCL7/ijLTE0v F/pdHyYKv+v4ZQntfzce80/zCwuFkAxMtymcyWQ4K9NunJBZ6eKgBOfBQTHBD4atu+mAV9+dAm rxTEHOcBXKHNIJY7PEsUTyp0
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Under conditions of high load and low resources, it was
possible for NDIS (in combination with overlying drivers) to send
NET_BUFFER_LIST structures containing NULL MDL's for transmission.
This resulted in an immediate bugcheck.

This patch prevents NULL MDL's from being sent to XenVif.

Signed-off-by: Martin Harvey <martin.harvey@xxxxxxxxxx>
---
 src/xennet/transmitter.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/xennet/transmitter.c b/src/xennet/transmitter.c
index 0e184fd..334bbb9 100644
--- a/src/xennet/transmitter.c
+++ b/src/xennet/transmitter.c
@@ -323,17 +323,21 @@ __TransmitterSendNetBufferList(
 
         __TransmitterGetNetBufferList(Transmitter, NetBufferList);
 
-        status = XENVIF_VIF(TransmitterQueuePacket,
-                            AdapterGetVifInterface(Transmitter->Adapter),
-                            NET_BUFFER_CURRENT_MDL(NetBuffer),
-                            NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer),
-                            NET_BUFFER_DATA_LENGTH(NetBuffer),
-                            OffloadOptions,
-                            MaximumSegmentSize,
-                            TagControlInformation,
-                            &Hash,
-                            (NetBufferListNext != NULL) ? TRUE : FALSE,
-                            Cookie);
+        if (NET_BUFFER_CURRENT_MDL(NetBuffer) != NULL) {
+            status = XENVIF_VIF(TransmitterQueuePacket,
+                                AdapterGetVifInterface(Transmitter->Adapter),
+                                NET_BUFFER_CURRENT_MDL(NetBuffer),
+                                NET_BUFFER_CURRENT_MDL_OFFSET(NetBuffer),
+                                NET_BUFFER_DATA_LENGTH(NetBuffer),
+                                OffloadOptions,
+                                MaximumSegmentSize,
+                                TagControlInformation,
+                                &Hash,
+                                (NetBufferListNext != NULL) ? TRUE : FALSE,
+                                Cookie);
+        }
+        else
+            status = STATUS_INVALID_PARAMETER;
         if (!NT_SUCCESS(status)) {
             __TransmitterReturnPacket(Transmitter, Cookie,
                                       NDIS_STATUS_NOT_ACCEPTED);
-- 
2.25.0.windows.1




 


Rackspace

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