From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Olof Johansson <olof@lixom.net>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Puneet Kumar <puneetster@chromium.org>,
Feng Tang <feng.tang@intel.com>
Subject: Re: [PATCH] ACPI: Ensure lock is acquired before accessing ec struct members
Date: Fri, 15 Nov 2013 23:42:43 +0100 [thread overview]
Message-ID: <5300176.cL70lB1Tyt@vostro.rjw.lan> (raw)
In-Reply-To: <1384544489-18098-1-git-send-email-olof@lixom.net>
On Friday, November 15, 2013 11:41:29 AM Olof Johansson wrote:
> From: Puneet Kumar <puneetster@chromium.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@chromium.org>
>
> Fixes: b76b51ba0cef ('ACPI / EC: Add more debug info and trivial code cleanup')
> References: http://crbug.com/319019
> Signed-off-by: Puneet Kumar <puneetster@chromium.org>
> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
> [olof: Commit message reworded a bit]
> Signed-off-by: Olof Johansson <olof@lixom.net>
> Cc: Feng Tang <feng.tang@intel.com>
> Cc: <stable@vger.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.
prev parent reply other threads:[~2013-11-15 22:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 19:41 Olof Johansson
2013-11-15 22:42 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5300176.cL70lB1Tyt@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=feng.tang@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=puneetster@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®