From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [PATCH] infiniband: fix a subtle race condition Date: Thu, 14 Jun 2018 10:03:09 -0700 Message-ID: References: <20180613234947.15767-1-xiyou.wangcong@gmail.com> <20180614053446.GB18426@mtr-leonro.mtl.com> <20180614070108.GD18426@mtr-leonro.mtl.com> <20180614142448.GC24762@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20180614142448.GC24762@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org To: Jason Gunthorpe Cc: Leon Romanovsky , LKML , linux-rdma@vger.kernel.org, Doug Ledford List-Id: linux-rdma@vger.kernel.org On Thu, Jun 14, 2018 at 7:24 AM, Jason Gunthorpe wrote: > > This was my brief reaction too, this code path almost certainly has a > use-after-free, and we should fix the concurrency between the two > places in some correct way.. First of all, why use-after-free could trigger an imbalance unlock? IOW, why do we have to solve use-after-free to fix this imbalance unlock? Second of all, my patch is _not_ intended to solve any use-after-free, it only solves the imbalance unlock. I never claim it solves more anywhere. Third of all, the use-after-free I can see (race with ->close) exists before my patch, this patch doesn't make it better or worse, nor I have any intend to fix it.