public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>,
	Darren Hart <dvhart@infradead.org>,
	ibm-acpi-devel@lists.sourceforge.net,
	platform-driver-x86@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch 2/2] thinkpad_acpi: off by one in adaptive_keyboard_hotkey_notify_hotkey()
Date: Wed, 11 Mar 2015 10:26:09 +0000	[thread overview]
Message-ID: <1426069569.17946.10.camel@hadess.net> (raw)
In-Reply-To: <20150311093607.GB3564@mwanda>

On Wed, 2015-03-11 at 12:36 +0300, Dan Carpenter wrote:
> This should be >= instead of > because otherwise we read one element 
> past the end of the hotkey_keycode_map[] array.
> 
> The hotkey_keycode_map[] array has TPACPI_HOTKEY_MAP_LEN elements.
> 
> Fixes: 6a68d8557084 ('thinkpad_acpi: Add support for more adaptive 
> kbd buttons')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-By: Bastien Nocera <hadess@hadess.net>

> diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> b/drivers/platform/x86/thinkpad_acpi.c
> index 024861d..7769575 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -3656,8 +3656,9 @@ static bool 
> adaptive_keyboard_hotkey_notify_hotkey(unsigned int scancode)
>                 return true;
>  
>         default:
> -               if (scancode < FIRST_ADAPTIVE_KEY || scancode > 
> FIRST_ADAPTIVE_KEY +
> -                               TPACPI_HOTKEY_MAP_LEN - 
> ADAPTIVE_KEY_OFFSET) {
> +               if (scancode < FIRST_ADAPTIVE_KEY ||
> +                                               scancode >= 
> FIRST_ADAPTIVE_KEY + TPACPI_HOTKEY_MAP_LEN -
> +                               ADAPTIVE_KEY_OFFSET) {
>                         pr_info("Unhandled adaptive keyboard key: 
> 0x%x\n",
>                                         scancode);
>                         return false;

  reply	other threads:[~2015-03-11 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11  9:36 [patch 2/2] thinkpad_acpi: off by one in adaptive_keyboard_hotkey_notify_hotkey() Dan Carpenter
2015-03-11 10:26 ` Bastien Nocera [this message]
2015-03-11 10:27 ` Henrique de Moraes Holschuh
2015-03-14 19:03 ` Darren Hart
2015-03-22 19:01 ` [ibm-acpi-devel] [patch 2/2] thinkpad_acpi: off by one in adaptive_keyboard_hotkey_notify_hotkey Henrique de Moraes Holschuh

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=1426069569.17946.10.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=dan.carpenter@oracle.com \
    --cc=dvhart@infradead.org \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ibm-acpi@hmh.eng.br \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.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