[ofa-general] Re: [PATCH] cma: fix access to freed memory

Eli Cohen eli at dev.mellanox.co.il
Tue Aug 4 12:41:25 PDT 2009


On Tue, Aug 04, 2009 at 09:05:13AM -0700, Roland Dreier wrote:
> 
>  > Maybe it's just a loose connection but yet, it seems to me that
>  > operations on id_priv->mc_list should be protected. Should I send a
>  > different patch?
> 
> "seems ... should be" is very weak justification for locking.  What
> should they be protected from?
> 

What if rdma_join_multicast() is called when rdma_destroy_id() - for
example from cma_ib_handler() due to error returned from the handler?
In this case list_add(&mc->list, &id_priv->mc_list) in
rdma_join_multicast() can may be executed along with the list
manipulation done in cma_leave_mc_groups().

Generally, it looks strange that in some places list handling is
protected with a spinlock and in other places not.



More information about the general mailing list