Re: [RFC] races in access to pci_devices

Jeff Garzik (jgarzik@mandrakesoft.com)
Thu, 15 Nov 2001 02:55:52 -0500


Alexander Viro wrote:
>
> Linus, as far as I can see there's no exclusion between
> the code that walks pci_devices and pci_insert_device(). It's
> not a big deal wrt security (not many laptops with remote access)
> but...
>
> What locking is supposed to be there?

alas, yes, that's been there since time began, and since the window was
so minimal nobody cared enough to do anything about it. Even on the
larger hotplug PCI servers that Greg KH mentioned, the pci list really
isn't traversed much, much less updated.

I haven't looked at it in over a year, but from a quick look, all the
list access look like they can be protected by a simple spinlock.
You'll need to grep the tree, though, because not all users of
pci_devices are in drivers/pci/pci.c. [users outside of drivers/pci
should really be converted to use pci_find_xxx functions in any case]

-- 
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/