summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2020-09-01 10:52:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-12 11:45:26 +0200
commitde801a7d3228aed8ea2bbfe36ccf3af7f9ef6f39 (patch)
treea1c02f63e82652b9539691cdc3b695178b0a6436 /tools
parent12b27c445f2fd4a2e2c49136f26be26635cc1c73 (diff)
HID: core: Sanitize event code and type when mapping input
commit 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 upstream. 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> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions