lkml.org 
[lkml]   [2021]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] RDMA/cma: Fix listener leak in rdma_cma_listen_on_all() failure
On Wed, Sep 15, 2021 at 02:17:56AM +0300, Leon Romanovsky wrote:

> > +static void cma_cancel_listens(struct rdma_id_private *id_priv)
> > +{
> > + /*
> > + * During _destroy_id() it is not possible for this value to transition
> > + * from empty to !empty, test it outside to lock to avoid taking a
> > + * global lock on every destroy. Only listen all cases will have
> > + * something to do
> > + */
> > + if (list_empty(&id_priv->list))
> > + return;
>
> IMHO, it is better do not do such check outside of the lock without real
> gain. It is too subtle to rely on _destroy_id() behaviour.

This arrangement would have solved the syzkaller bugs that are
triggering due to the other logic in _destroy_id() being too subtle
already :\

But it can't be done because priv->list is a total mess

Jason

\
 
 \ /
  Last update: 2021-09-16 15:58    [W:0.089 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site