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]
Date:	Fri, 15 Nov 2013 23:42:43 +0100
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Olof Johansson <olof@...om.net>
Cc:	Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Puneet Kumar <puneetster@...omium.org>,
	Feng Tang <feng.tang@...el.com>
Subject: Re: [PATCH] ACPI: Ensure lock is acquired before accessing ec struct members

On Friday, November 15, 2013 11:41:29 AM Olof Johansson wrote:
> From: Puneet Kumar <puneetster@...omium.org>
> 
> A bug was introduced by commit b76b51ba0cef ('ACPI / EC: Add more debug
> info and trivial code cleanup') that erroneously caused the struct member
> to be accessed before acquiring the required lock.  This change fixes
> it by ensuring the lock acquisition is done first.
> 
> Found by Aaron Durbin <adurbin@...omium.org>
> 
> Fixes: b76b51ba0cef ('ACPI / EC: Add more debug info and trivial code cleanup')
> References: http://crbug.com/319019
> Signed-off-by: Puneet Kumar <puneetster@...omium.org>
> Reviewed-by: Aaron Durbin <adurbin@...omium.org>
> [olof: Commit message reworded a bit]
> Signed-off-by: Olof Johansson <olof@...om.net>
> Cc: Feng Tang <feng.tang@...el.com>
> Cc: <stable@...r.kernel.org> # 3.8+

Queued up for the next ACPI pull request, thanks guys!

> ---
>  drivers/acpi/ec.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index d5309fd..ba5b56d 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -173,9 +173,10 @@ static void start_transaction(struct acpi_ec *ec)
>  static void advance_transaction(struct acpi_ec *ec, u8 status)
>  {
>  	unsigned long flags;
> -	struct transaction *t = ec->curr;
> +	struct transaction *t;
>  
>  	spin_lock_irqsave(&ec->lock, flags);
> +	t = ec->curr;
>  	if (!t)
>  		goto unlock;
>  	if (t->wlen > t->wi) {
> 
-- 
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