mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Greg KH <gregkh@linuxfoundation.org>, Muchun Song <smuchun@gmail.com>
Cc: rafael@kernel.org, prsood@codeaurora.org, mojha@codeaurora.org,
	gkohli@codeaurora.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 OPT2] driver core: Fix use-after-free and double free on glue directory
Date: Thu, 04 Jul 2019 08:57:13 +1000	[thread overview]
Message-ID: <319ae04497cf1982076bf801cfdf565046096fd4.camel@kernel.crashing.org> (raw)
In-Reply-To: <20190703193606.GA8452@kroah.com>

On Wed, 2019-07-03 at 21:36 +0200, Greg KH wrote:
> 
> > -static struct kobject *get_device_parent(struct device *dev,
> > -					 struct device *parent)
> > +/**
> > + * __get_device_parent() - Get the parent device kobject.
> > + * @dev: Pointer to the device structure.
> > + * @parent: Pointer to the parent device structure.
> > + * @lock: When we live in a glue directory, should we hold the
> > + *        gdp_mutex lock when this function returns? If @lock
> > + *        is true, this function returns with the gdp_mutex
> > + *        holed. Otherwise it will not.
> 
> Ugh, if you are trying to get me to hate one version of these patches,
> this is how you do it :)
> 
> A function should not "sometimes takes a lock, sometimes does not,
> depending on a parameter passed into it"  That way lies madness...

Yes, I prefer this approach to the fix but I dont like the patch either
for the same reason...

 ...

> Anyway, this is a mess.
> 
> Ugh I hate glue dirs...

Amen...

Ben.



  reply	other threads:[~2019-07-03 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 14:40 Muchun Song
2019-07-03 19:36 ` Greg KH
2019-07-03 22:57   ` Benjamin Herrenschmidt [this message]
2019-07-04  5:40     ` Greg KH
2019-07-04  6:29       ` Benjamin Herrenschmidt

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=319ae04497cf1982076bf801cfdf565046096fd4.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=gkohli@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mojha@codeaurora.org \
    --cc=prsood@codeaurora.org \
    --cc=rafael@kernel.org \
    --cc=smuchun@gmail.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

all inboxes | Powered by JetHome®