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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <34989330.IyIZ6Qqfxh@vostro.rjw.lan>
Date:	Tue, 26 Mar 2013 14:24:41 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Yinghai Lu <yinghai@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-pci@...r.kernel.org, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI, ACPI: hold acpi_scan_lock during root bus hotplug

On Sunday, March 10, 2013 10:05:16 PM Yinghai Lu wrote:
> During merging pci tree with pm/acpi tree, Linus noticed that
> we don't have same lock using patten about acpi pci root as
> acpiphp.
> 
> Here apply same lock patten, and we need to change
> acpi_bus_hot_remove_device executing via acpi_os_hotplug_execute()
> as it also hold the lock in acpi_bus_hot_remove_device.
> 
> That will make acpi_bus_hot_remove_device calling the same as other
> callers.
> 
> Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
> Acked-by: Rafael J. Wysocki <rjw@...k.pl>

Bjorn, this needs to go in before final 3.9.

Are you going to handle it, or should I take care of it?

Rafael


> ---
>  drivers/acpi/pci_root.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6/drivers/acpi/pci_root.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/pci_root.c
> +++ linux-2.6/drivers/acpi/pci_root.c
> @@ -646,6 +646,7 @@ static void handle_root_bridge_insertion
>  
>  static void handle_root_bridge_removal(struct acpi_device *device)
>  {
> +	acpi_status status;
>  	struct acpi_eject_event *ej_event;
>  
>  	ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
> @@ -661,7 +662,9 @@ static void handle_root_bridge_removal(s
>  	ej_event->device = device;
>  	ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
>  
> -	acpi_bus_hot_remove_device(ej_event);
> +	status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event);
> +	if (ACPI_FAILURE(status))
> +		kfree(ej_event);
>  }
>  
>  static void _handle_hotplug_event_root(struct work_struct *work)
> @@ -676,8 +679,9 @@ static void _handle_hotplug_event_root(s
>  	handle = hp_work->handle;
>  	type = hp_work->type;
>  
> -	root = acpi_pci_find_root(handle);
> +	acpi_scan_lock_acquire();
>  
> +	root = acpi_pci_find_root(handle);
>  	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
>  
>  	switch (type) {
> @@ -711,6 +715,7 @@ static void _handle_hotplug_event_root(s
>  		break;
>  	}
>  
> +	acpi_scan_lock_release();
>  	kfree(hp_work); /* allocated in handle_hotplug_event_bridge */
>  	kfree(buffer.pointer);
>  }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
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