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: <200901191056.36992.jbarnes@virtuousgeek.org>
Date:	Mon, 19 Jan 2009 10:56:36 -0800
From:	Jesse Barnes <jbarnes@...tuousgeek.org>
To:	Jiri Slaby <jirislaby@...il.com>
Cc:	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	Kristen Carlson Accardi <kristen.c.accardi@...el.com>,
	Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>
Subject: Re: [PATCH] PCI: pciehp_core, fix lock imbalance

On Saturday, January 17, 2009 7:23 am Jiri Slaby wrote:
> set_lock_status omits mutex_unlock in fail path. Add the omitted
> unlock.
>
> As a result a lockup caused by this can be triggered from userspace
> by writing 1 to /sys/bus/pci/slots/.../lock often enough.
>
> Signed-off-by: Jiri Slaby <jirislaby@...il.com>
> Cc: Kristen Carlson Accardi <kristen.c.accardi@...el.com>
> Cc: Jesse Barnes <jbarnes@...tuousgeek.org>
> ---
>  drivers/pci/hotplug/pciehp_core.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/hotplug/pciehp_core.c
> b/drivers/pci/hotplug/pciehp_core.c index 5482d4e..c248554 100644
> --- a/drivers/pci/hotplug/pciehp_core.c
> +++ b/drivers/pci/hotplug/pciehp_core.c
> @@ -126,8 +126,10 @@ static int set_lock_status(struct hotplug_slot
> *hotplug_slot, u8 status) mutex_lock(&slot->ctrl->crit_sect);
>
>  	/* has it been >1 sec since our last toggle? */
> -	if ((get_seconds() - slot->last_emi_toggle) < 1)
> +	if ((get_seconds() - slot->last_emi_toggle) < 1) {
> +		mutex_unlock(&slot->ctrl->crit_sect);
>  		return -EINVAL;
> +	}
>
>  	/* see what our current state is */
>  	retval = get_lock_status(hotplug_slot, &value);

Applied to my for-linus branch (with Kenji-san's reviewed-by), thanks.

-- 
Jesse Barnes, 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