[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a37e7a49c3e7fa6ece2be2b76798fef3e51ade4e.camel@kernel.crashing.org>
Date: Sun, 28 Apr 2019 13:10:19 +0300
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Muchun Song <smuchun@...il.com>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org,
linux-kernel <linux-kernel@...r.kernel.org>,
zhaowuyun@...gtech.com
Subject: Re: [PATCH] driver core: Fix use-after-free and double free on glue
directory
On Thu, 2019-04-25 at 23:44 +0800, Muchun Song wrote:
> I agree with you that the looking up of the glue dir and creation of its child
> should be protected by the same lock of gdp_mutex. So, do you agree with
> the fix of the following code snippet?
The basic idea yes, the whole bool *locked is horrid though. Wouldn't it
work to have a get_device_parent_locked that always returns with the mutex held,
or just move the mutex to the caller or something simpler like this ?
Ben.
Powered by blists - more mailing lists