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:	Fri, 14 Jun 2013 16:05:48 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Jiang Liu <liuj97@...il.com>
Cc:	Jiang Liu <jiang.liu@...wei.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Yinghai Lu <yinghai@...nel.org>,
	"Alexander E . Patrakov" <patrakov@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Yijing Wang <wangyijing@...wei.com>, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	stable@...r.kernel.org
Subject: Re: [BUGFIX 2/9] ACPIPHP: fix device destroying order issue when handling dock notification

On Friday, June 14, 2013 09:53:57 PM Jiang Liu wrote:
> On 06/14/2013 03:59 AM, Rafael J. Wysocki wrote:
> > On Friday, June 14, 2013 12:32:25 AM Jiang Liu wrote:
> >> Current ACPI glue logic expects that physical devices are destroyed
> >> before destroying companion ACPI devices, otherwise it will break the
> >> ACPI unbind logic and cause following warning messages:
> >> [  185.026073] usb usb5: Oops, 'acpi_handle' corrupt
> >> [  185.035150] pci 0000:1b:00.0: Oops, 'acpi_handle' corrupt
> >> [  185.035515] pci 0000:18:02.0: Oops, 'acpi_handle' corrupt
> >> [  180.013656]  port1: Oops, 'acpi_handle' corrupt
> >> Please refer to https://bugzilla.kernel.org/attachment.cgi?id=104321
> >> for full log message.
> > 
> > So my question is, did we have this problem before commit 3b63aaa70e1?
> > 
> > If we did, then when did it start?  Or was it present forever?
> I think this issue should exist before commit "PCI: acpiphp: Do not use
> ACPI PCI subdriver mechanism". It may trace back to the changes to kill
> acpi_pci_bind()/acpi_pci_unbind().

I thought so.

> >> Above warning messages are caused by following scenario:
> >> 1) acpi_dock_notifier_call() queues a task (T1) onto kacpi_hotplug_wq
> >> 2) kacpi_hotplug_wq handles T1, which invokes acpi_dock_deferred_cb()
> >>    ->dock_notify()-> handle_eject_request()->hotplug_dock_devices()
> >> 3) hotplug_dock_devices() first invokes registered hotplug callbacks to
> >>    destroy physical devices, then destroys all affected ACPI devices.
> >>    Everything seems perfect until now. But the acpiphp dock notification
> >>    handler will queue another task (T2) onto kacpi_hotplug_wq to really
> >>    destroy affected physical devices.
> > 
> > Would not the solution be to modify it so that it didn't spawn the other
> > task (T2), but removed the affected physical devices synchronously?
> Yes, that's the way I'm going to fix this issue.
> 
> > 
> >> 4) kacpi_hotplug_wq finishes T1, and all affected ACPI devices have
> >>    been destroyed.
> >> 5) kacpi_hotplug_wq handles T2, which destroys all affected physical
> >>    devices.
> >>
> >> So it breaks ACPI glue logic's expection because ACPI devices are destroyed
> >> in step 3 and physical devices are destroyed in step 5.
> >>
> >> Signed-off-by: Jiang Liu <jiang.liu@...wei.com>
> >> Reported-by: Alexander E. Patrakov <patrakov@...il.com>
> >> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> >> Cc: Yinghai Lu <yinghai@...nel.org>
> >> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
> >> Cc: linux-pci@...r.kernel.org
> >> Cc: linux-kernel@...r.kernel.org
> >> Cc: stable@...r.kernel.org
> >> ---
> >> Hi Bjorn and Rafael,
> >>      The recursive lock changes haven't been tested yet, need help
> >> from Alexander for testing.
> > 
> > Well, let's just say I'm not a fan of recursive locks.  Is that unavoidable
> > here?
> Yeah, you are right, we encounter other deadlock issue here, as reported
> by Alexander. So need to find new solution here.

Can you please have a look at the patch I posted earlier in this thread?

Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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