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

Leonid Keller leonid at mellanox.co.il
Sun Apr 12 01:04:25 PDT 2009


Applied in 2093, thank you.

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
> Sent: Wednesday, April 08, 2009 2:02 AM
> To: Leonid Keller
> Cc: ofw at lists.openfabrics.org
> Subject: [ofw] [PATCH] HCA: Fix IRP_MN_QUERY_INTERFACE verifier bug
> 
> 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
>         {
> 



More information about the ofw mailing list