From: Wolfram Sang <wsa@kernel.org>
To: Andrea Righi <andrea.righi@canonical.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Phoenix Huang <phoenix@emc.com.tw>,
jingle.wu@emc.com.tw,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] Input: elantech - Fix stack out of bound access in elantech_change_report_id()
Date: Tue, 16 Nov 2021 09:32:34 +0100 [thread overview]
Message-ID: <YZNsoj7Onbxr68OQ@ninjato> (raw)
In-Reply-To: <20211116072223.8746-1-andrea.righi@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 561 bytes --]
On Tue, Nov 16, 2021 at 08:22:23AM +0100, Andrea Righi wrote:
> The array param[] in elantech_change_report_id() must be at least 3
> bytes, because elantech_read_reg_params() is calling ps2_command() with
> PSMOUSE_CMD_GETINFO, that is going to access 3 bytes from param[], but
> it's defined in the stack as an array of 2 bytes, therefore we have a
> potential stack out-of-bounds access here, also confirmed by KASAN:
I think a comment in the code why the array size is 3 when only 2 values
are defined would be helpful. Like a short summary of the above.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-11-16 8:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 7:22 [RESEND PATCH] Input: elantech - Fix stack out of bound access in elantech_change_report_id() Andrea Righi
2021-11-16 8:32 ` Wolfram Sang [this message]
2021-11-16 9:53 ` Andrea Righi
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=YZNsoj7Onbxr68OQ@ninjato \
--to=wsa@kernel.org \
--cc=andrea.righi@canonical.com \
--cc=dmitry.torokhov@gmail.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=jingle.wu@emc.com.tw \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=phoenix@emc.com.tw \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.