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]
Message-ID: <51B607FE.3020108@gmail.com>
Date:	Tue, 11 Jun 2013 01:08:14 +0800
From:	Jiang Liu <liuj97@...il.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC:	Bjorn Helgaas <bhelgaas@...gle.com>,
	Yinghai Lu <yinghai@...nel.org>,
	Jiang Liu <jiang.liu@...wei.com>,
	"Rafael J . Wysocki" <rjw@...k.pl>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Gu Zheng <guz.fnst@...fujitsu.com>,
	Toshi Kani <toshi.kani@...com>,
	Myron Stowe <myron.stowe@...hat.com>,
	Yijing Wang <wangyijing@...wei.com>, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	xen-devel@...ts.xensource.com,
	virtualization@...ts.linux-foundation.org
Subject: Re: [RFC PATCH v2, part3 07/11] PCI, xen-pcifront: use new PCI interfaces
 to simplify implementation

On Tue 11 Jun 2013 12:58:01 AM CST, Konrad Rzeszutek Wilk wrote:
> On Mon, Jun 10, 2013 at 12:50:46AM +0800, Jiang Liu wrote:
>> On Sat 08 Jun 2013 01:07:06 AM CST, Konrad Rzeszutek Wilk wrote:
>>> On Sat, Jun 08, 2013 at 12:50:31AM +0800, Jiang Liu wrote:
>>>> On 06/07/2013 11:38 PM, Konrad Rzeszutek Wilk wrote:
>>>>> On Fri, Jun 07, 2013 at 10:50:24AM -0400, Konrad Rzeszutek Wilk wrote:
>>>>>> On Thu, May 16, 2013 at 11:50:55PM +0800, Jiang Liu wrote:
>>>>>>> Use new PCI interfaces to simplify xen-pcifront implementation:
>>>>>>> 1) Use pci_create_root_bus() instead of pci_scan_bus_parented()
>>>>>>>    because pci_scan_bus_parented() is marked as __deprecated.This
>>>>>>>    also gets rid of a duplicated call of pci_bus_start_devices().
>>>>>>> 2) Use pci_stop_root_bus() and pci_remove_root_bus() instead of
>>>>>>>    open-coded private implementation.
>>>>>>> 3) Use pci_set_host_bridge_release() to release data structures
>>>>>>>    associated with PCI root buses.
>>>>>>> 4) Use pci_bus_get()/pci_bus_put() to manage PCI root bus reference
>>>>>>>    count.
>>>>>>>
>>>>>>> This is also a preparation for coming PCI bus lock enhancement.
>>>>>
>>>>> With this patch from :
>>>>>
>>>>>  Merge branch 'pci_lock_v3' of https://github.com/jiangliu/linux into testing
>>>>>
>>>>>
>>>>> it blows up when detaching the device.
>>>> Hi Konrad,
>>>>    Thanks for testing! According to the log messages, this issue should
>>>> be related to pci bus reference counter management. Seems we have done
>>>> an extra(unbalanced) release of pci bus device.
>>>>    Will investigate it tomorrow!
>>>
>>> That is quite commendable that you are willing to look over this on
>>> the weekend but I am not going to be able to rerun this test until
>>> some time in the week. You could enjoy the weekend and just look at
>>> this during the week.
>>
>> Hi Konrad,
>>      We should have root-caused this bug, which is caused by
>> for_each_pci_root_bus().
>> Current implementation doesn't support root bus deletion when walking
>> PCI root
>> buses by for_each_pci_root_bus(). The reference counter
>> (pci_bus->dev.knode_class.n_ref)
>> becomes zero after returning from pci_remove_root_bus(), so it triggers
>> kref warnings
>> and double-free of klist_node object when we call
>> pci_get_next_root_bus() to get the
>> next PCI root bus.
>>      So we will first revert to  list_for_each_entry_safe(bus, temp,
>> &pci_root_buses, node)
>> and solve this issue in next version of for_each_pci_root_bus().
>
> That definitly solves the issue. Thanks!
>
> I used pci_lock_v3 of https://github.com/jiangliu/linux and the fix
> below.
>
> Is there a new patchset you are going to be posting or a git branch
> that I can look over?
>
> Thanks.
Hi Konrad,
     Really appreciate your support! I will try to post a new version 
tomorrow,
but I think there won't be big changes except addressing some review
comments from you.
    Thanks!
    Gerry
--
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