lkml.org 
[lkml]   [2019]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 OPT2] driver core: Fix use-after-free and double free on glue directory
From
Date
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.


\
 
 \ /
  Last update: 2019-07-04 00:58    [W:1.344 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site