[ofw] [PATCH] make kal_cep_config safe

Tzachi Dar tzachid at mellanox.co.il
Wed Mar 25 23:55:12 PDT 2009


It seems that the lock remains locked with this patch.

Thanks
Tzachi 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
> Sent: Wednesday, March 25, 2009 10:33 PM
> To: Sean Hefty
> Cc: ofw at lists.openfabrics.org
> Subject: [ofw] [PATCH] make kal_cep_config safe
> 
> Currently, kal_config_cep assumes that the CID passed in as 
> input is always valid.  However, users can destroy CEPs at 
> will using the UAL_DESTROY_CEP IOCTL in IBAL.  This means 
> that a CEP could be destroyed while other kernel code is 
> attempting to configure it, even though the CID was never 
> explicitly exposed to user-mode.
> 
> This patch traps an invalid CID in kal_config_cep.
> 
> Signed-off-by: Fab Tillier <ftillier at microsoft.com>
> 
> Index: core/al/kernel/al_cm_cep.c
> ===================================================================
> --- core/al/kernel/al_cm_cep.c  (revision 2057)
> +++ core/al/kernel/al_cm_cep.c  (working copy)
> @@ -3695,7 +3695,8 @@ kal_cep_config(
> 
>         KeAcquireInStackQueuedSpinLock( &gp_cep_mgr->lock, &hdl );
>         p_cep = __lookup_cep( h_al, cid );
> -       CL_ASSERT( p_cep );
> +       if( p_cep == NULL )
> +               return;
> 
>         p_cep->pfn_cb = pfn_cb;
>         p_cep->context = context;
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> 



More information about the ofw mailing list