From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 03 Jun 2004 19:28:17 +0000 Subject: Re: hotplug remove vs. device driver close Message-Id: <20040603192817.GC23564@kroah.com> List-Id: References: <20040602181455.C17544@forte.austin.ibm.com> In-Reply-To: <20040602181455.C17544@forte.austin.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Thu, Jun 03, 2004 at 12:23:04PM -0700, Don Fry wrote: > > > > We make no such guarantee. As I stated, the Cardbus/PCMCIA handle this > > > > quite easily, so it is pretty simple to fix up a PCI driver to also > > > > handle this. > > > > > > > > But the main answer is that the PCI Hotplug spec states that the OS does > > > > NOT have to protect for this happening to regular PCI devices. > > > > > > So if I understand what you are saying: if the OS crashes because of > > > a sysadmin error or a script error during pci hotplug remove, that's > > > considered OK? > > > > As sysadmin I can delete your whole root fs, and reboot the box into > > obvilion. Are you considering changing this ability too? :) > > > > If you are really worried about this, then look into a different > > permisssion model for Linux like SELinux. > > > > Or you can simply fix up your PCI driver to properly handle reading all > > FF when the device has been removed. That seems to be what you need to > > do to solve this for your small subset of drivers on your platform, > > correct? > > > > The pcnet32 driver tries to do the 'right thing' when it reads 0xffff, > but that does not include doing a 'close' prior to being removed. The > driver could keep some state around so that if its remove routine was > called without close first, it would cleanup, but I don't know of any > network driver that does this. > > The remove with a close is where the leak/crash might occur. That's up to the upper layer, above the network driver to do, right? It's the same way for all USB and SCSI/block devices. Remember, the driver isn't unloaded at device removal time, it should always be bound to memory until the userspace "open" goes away. thanks, greg k-h ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel