From: Jiri Kosina <jikos@kernel.org>
To: Marc Zyngier <maz@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] HID: core: Sanitize event code and type when mapping input
Date: Thu, 27 Aug 2020 11:33:10 +0200 (CEST) [thread overview]
Message-ID: <nycvar.YFH.7.76.2008271132050.27422@cbobk.fhfr.pm> (raw)
In-Reply-To: <20200826134658.1046338-1-maz@kernel.org>
On Wed, 26 Aug 2020, Marc Zyngier wrote:
> When calling into hid_map_usage(), the passed event code is
> blindly stored as is, even if it doesn't fit in the associated bitmap.
>
> This event code can come from a variety of sources, including devices
> masquerading as input devices, only a bit more "programmable".
>
> Instead of taking the event code at face value, check that it actually
> fits the corresponding bitmap, and if it doesn't:
> - spit out a warning so that we know which device is acting up
> - NULLify the bitmap pointer so that we catch unexpected uses
>
> Code paths that can make use of untrusted inputs can now check
> that the mapping was indeed correct and bail out if not.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
> * From v1:
> - Dropped the input.c changes, and turned hid_map_usage() into
> the validation primitive.
> - Handle mapping failures in hidinput_configure_usage() and
> mt_touch_input_mapping() (on top of hid_map_usage_clear() which
> was already handled)
Benjamin, could you please run this through your regression testing
machinery?
It's a non-trivial core change, at the same time I'd like not to postpone
it for 5.10 due to its nature.
Thanks,
--
Jiri Kosina
SUSE Labs
next prev parent reply other threads:[~2020-08-27 9:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 13:46 [PATCH v2] HID: core: Sanitize event code and type when mapping input Marc Zyngier
2020-08-27 9:33 ` Jiri Kosina [this message]
2020-08-27 21:01 ` Marc Zyngier
2020-09-01 10:30 ` Benjamin Tissoires
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=nycvar.YFH.7.76.2008271132050.27422@cbobk.fhfr.pm \
--to=jikos@kernel.org \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).