All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Muchun Song <smuchun@gmail.com>,
	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, 4 Jul 2019 07:40:58 +0200	[thread overview]
Message-ID: <20190704054058.GC347@kroah.com> (raw)
In-Reply-To: <319ae04497cf1982076bf801cfdf565046096fd4.camel@kernel.crashing.org>

On Thu, Jul 04, 2019 at 08:57:13AM +1000, Benjamin Herrenschmidt wrote:
> 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...

Well, can we just remove them?  Who relies on them anymore?

thanks,

greg k-h

  reply	other threads:[~2019-07-04  5:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 14:40 [PATCH v4 OPT2] driver core: Fix use-after-free and double free on glue directory Muchun Song
2019-07-03 19:36 ` Greg KH
2019-07-03 22:57   ` Benjamin Herrenschmidt
2019-07-04  5:40     ` Greg KH [this message]
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=20190704054058.GC347@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=gkohli@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.