lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANq1E4SzPzbsWEBUqucyOZoeoMqQy3TfdJVn9idF9GQXV=dHuQ@mail.gmail.com>
Date:	Mon, 9 Dec 2013 10:08:57 +0100
From:	David Herrmann <dh.herrmann@...il.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] driver core: fix device_create() error path

Hi Greg

On Sun, Dec 8, 2013 at 4:27 PM, Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
> On Sun, Dec 08, 2013 at 03:42:33PM +0100, David Herrmann wrote:
>> Hi Greg
>>
>> Ping?
>
> It's in my "todo" queue, don't worry, it's not lost.
>
>> On Thu, Nov 21, 2013 at 8:15 PM, David Herrmann <dh.herrmann@...il.com> wrote:
>> > We call put_device() in the error path, which is fine for dev==NULL.
>> > However, in case kobject_set_name_vargs() fails, we have dev!=NULL but
>> > device_initialized() wasn't called, yet.
>
> If kobject_set_name_vargs() fails, we have bigger problems than this :)
>
> And I think it's safe for a put_device() on a device that wasn't
> initialized(), we just get a warning message if that happens.

I think it results in a call to kref_sub(), which will call
atomic_sub_and_test() which will fail as the new value is -1. So the
memory isn't freed.

I was just going through my pending patches to make sure they're not
forgotten. Nothing important, but I saw you already applied it.

Thanks
David

> Not to say that your patch is wrong, I'll look at it soon, but things
> should still recover ok from what I can tell.
>
> Oh, and there's the much-complained about memory leak in
> kobject_set_name_vargs() if something goes wrong there as well, I have a
> patch sitting in my queue to hopefully fix that up.
>
> thanks,
>
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ