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: <20110810183511.GA2443@flamenco.cs.columbia.edu>
Date:	Wed, 10 Aug 2011 14:35:11 -0400
From:	"Emilio G. Cota" <cota@...ap.org>
To:	Martyn Welch <martyn.welch@...com>
Cc:	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	Greg KH <gregkh@...e.de>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/8] staging: vme: add functions for bridge module
 refcounting

On Wed, Aug 10, 2011 at 10:50:59 +0100, Martyn Welch wrote:
> Again, in pci-driver.c:
> 
> static int pci_device_probe(struct device * dev)
> {
>         int error = 0;
>         struct pci_driver *drv;
>         struct pci_dev *pci_dev;
> 
>         drv = to_pci_driver(dev->driver);
>         pci_dev = to_pci_dev(dev);
>         pci_dev_get(pci_dev);
>         error = __pci_device_probe(drv, pci_dev);
>         if (error)
>                 pci_dev_put(pci_dev);
> 
>         return error;
> }
> 
> Again, doing as Manohar suggested.

Well in fact I just realised our discussion has been completely
misdirected.

I read the original patch again, and it does something different
to what these _get_dev functions are doing. The patch increments
the refcount of the _bridge_; the get_dev() calls increment the
functions of the _device_ itself, not the bridge, which wouldn't
protect the device against the bridge being removed.

The closest thing I saw in the kernel was usb_get_intf(),
which is what I had in mind when I wrote the original patchset
back in the day:

http://lxr.free-electrons.com/ident?i=usb_get_intf

Sorry for overlooking this (and the subsequent noise), it's
been a while since then.

		Emilio
--
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