mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gaurav Kohli <gkohli@codeaurora.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Muchun Song <smuchun@gmail.com>
Cc: rafael@kernel.org, linux-kernel <linux-kernel@vger.kernel.org>,
	zhaowuyun@wingtech.com, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] driver core: Fix use-after-free and double free on glue directory
Date: Fri, 10 May 2019 09:01:14 +0530	[thread overview]
Message-ID: <6d755534-714b-5d04-3280-b27fd8a1df1b@codeaurora.org> (raw)
In-Reply-To: <73b783e634551420dfa249816514fb31ed3487b6.camel@kernel.crashing.org>

Thanks for the comment, will check the patch and update.

Regards
Gaurav

On 5/10/2019 4:52 AM, Benjamin Herrenschmidt wrote:
> On Thu, 2019-05-09 at 20:08 +0530, Gaurav Kohli wrote:
>> Hi ,
>>
>> Last patch will serialize the addition of child to parent directory,
>> won't it affect performance.
> 
> I doubt this is a significant issue, and there's already a global lock
> taken once or twice in that path, the fix is purely to make sure that
> the some locked section is used both for the lookup and the addition as
> the bug comes from the window in between those two operations allowing
> the object to be removed after it was "found".
> 
> Cheers,
> Ben.
>   
>>
>> Regards
>> Gaurav
>>
>> On 5/4/2019 9:04 PM, Greg KH wrote:
>>> On Sat, May 04, 2019 at 10:47:07PM +0800, Muchun Song wrote:
>>>> Benjamin Herrenschmidt <benh@kernel.crashing.org> 于2019年5月2日周四
>>>> 下午2:25写道:
>>>>
>>>>>>> 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
>>>>>>> ?
>>>>>>>
>>>>>>
>>>>>> Greg and Rafael, do you have any suggestions for this? Or you
>>>>>> also
>>>>>> agree with Ben?
>>>>>
>>>>> Ping guys ? This is worth fixing...
>>>>
>>>> I also agree with you. But Greg and Rafael seem to be high
>>>> latency right now.
>>>
>>> It's in my list of patches to get to, sorry, hopefully will dig out
>>> of
>>> that next week with the buffer that the merge window provides me.
>>>
>>> thanks,
>>>
>>> greg k-h
>>>
>>
>>
> 

-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

  reply	other threads:[~2019-05-10  3:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 14:32 Muchun Song
2019-04-25  9:24 ` Benjamin Herrenschmidt
2019-04-25 15:44   ` Muchun Song
2019-04-28 10:10     ` Benjamin Herrenschmidt
2019-04-28 14:49       ` Muchun Song
2019-05-02  6:25         ` Benjamin Herrenschmidt
2019-05-04 14:47           ` Muchun Song
2019-05-04 15:34             ` Greg KH
2019-05-09 14:38               ` Gaurav Kohli
2019-05-09 23:22                 ` Benjamin Herrenschmidt
2019-05-10  3:31                   ` Gaurav Kohli [this message]
2019-05-14 10:56             ` Mukesh Ojha
2019-05-14 10:59               ` Prateek Sood
2019-05-14 11:51                 ` Muchun Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d755534-714b-5d04-3280-b27fd8a1df1b@codeaurora.org \
    --to=gkohli@codeaurora.org \
    --cc=benh@kernel.crashing.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=smuchun@gmail.com \
    --cc=zhaowuyun@wingtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome