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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Dec 2013 19:24:09 +0100
From:	Levente Kurusa <levex@...ux.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:	Bjorn Helgaas <bhelgaas@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 0/4] treewide: add missing put_device calls

On 12/16/2013 07:18 PM, Greg Kroah-Hartman wrote:
> On Mon, Dec 16, 2013 at 07:11:21PM +0100, Levente Kurusa wrote:
>> On 12/16/2013 06:58 PM, Greg Kroah-Hartman wrote:
>>> On Mon, Dec 16, 2013 at 06:18:53PM +0100, Levente Kurusa wrote:
>>>>>> IIRC, there are also a few where the device is also unregistered from
>>>>>> the specific subsystem's core.
>>>>>
>>>>> Do you have a specific example of this?  This should happen in the
>>>>> release function of the device already, not in some other code.
>>>>>
>>>> Character drivers who register with device_register() call cdev_del()
>>>> when device_register() fails.
>>>
>>> A cdev shouldn't be created until _after_ the device is successfully
>>> registered, as it could be opened and accessed before the device is
>>> registered.  That sounds like the drivers that do that should be fixed
>>> (have an example of this somewhere?)
>>
>> I did some research and it seems it has mostly been my false memory that made
>> me think that. The only example I could find that did something like this
>> was: drivers/scsi/osd/osd_uld.c at line 403.
>>
>> When the device_register() fails it immediately jumps to a cdev_del();
> 
> That should be easy to reorginize to not do this (i.e. do the cdev_add()
> call after the device_register() call, if needed.
> 

So it seems that this should be fixed if I understand you correctly.
If you want I can add this to my TODO list, so I will make a patch in a few
days?

-- 
Regards,
Levente Kurusa
--
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