[ofw] [PATCH] HCA: Fix IRP_MN_QUERY_INTERFACE verifier bug

Fab Tillier ftillier at windows.microsoft.com
Tue Apr 7 16:02:23 PDT 2009


Hi Leo,

I was chasing down a PTE corruption on a box (which turned out to be bad hardware), and my first step in my investigation was to turn on DriverVerifier.  It immediately blew up during boot when WinVerbs queried the HCA interface because the driver did not pass the IRP down the stack as it was supposed to.

This patch changes the HCA driver to pass any IRP_MN_QUERY_INTERFACE IRP down the stack if the interface is supported, after setting the IRP status to STATUS_SUCCESS.  The bottom-most driver will complete the IRP without changing the status.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

Index: hw/mlx4/kernel/hca/drv.c
===================================================================
--- hw/mlx4/kernel/hca/drv.c    (revision 2086)
+++ hw/mlx4/kernel/hca/drv.c    (working copy)
@@ -1328,7 +1328,14 @@
                &GUID_RDMA_INTERFACE_VERBS ) )
        {
                status = __query_ci_ifc( p_dev_obj, p_io_stack );
-               *p_action = IrpComplete;
+               if( !NT_SUCCESS( status ) )
+               {
+                       *p_action = IrpComplete;
+               }
+               else
+               {
+                       *p_action = IrpSkip;
+               }
        }
        else
        {
Index: hw/mthca/kernel/hca_pnp.c
===================================================================
--- hw/mthca/kernel/hca_pnp.c   (revision 2086)
+++ hw/mthca/kernel/hca_pnp.c   (working copy)
@@ -912,7 +912,14 @@
                &GUID_RDMA_INTERFACE_VERBS ) )
        {
                status = __query_ci_ifc( p_dev_obj, p_io_stack );
-               *p_action = IrpComplete;
+               if( !NT_SUCCESS( status ) )
+               {
+                       *p_action = IrpComplete;
+               }
+               else
+               {
+                       *p_action = IrpSkip;
+               }
        }
        else
        {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hca_pnp.patch
Type: application/octet-stream
Size: 959 bytes
Desc: hca_pnp.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090407/61177489/attachment.obj>


More information about the ofw mailing list