[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210916135712.GA327412@nvidia.com>
Date: Thu, 16 Sep 2021 10:57:12 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: Tao Liu <thomas.liu@...oud.cn>, dledford@...hat.com,
haakon.bugge@...cle.com, shayd@...dia.com, avihaih@...dia.com,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
thomas.liu@...oud.com
Subject: Re: [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
Powered by blists - more mailing lists