Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 44a1b8b2 authored by Tomasz Pakuła's avatar Tomasz Pakuła Committed by Greg Kroah-Hartman
Browse files

HID: pidff: Fix null pointer dereference in pidff_find_fields

[ Upstream commit 22a05462c3d0eee15154faf8d13c49e6295270a5 ]

This function triggered a null pointer dereference if used to search for
a report that isn't implemented on the device. This happened both for
optional and required reports alike.

The same logic was applied to pidff_find_special_field and although
pidff_init_fields should return an error earlier if one of the required
reports is missing, future modifications could change this logic and
resurface this possible null pointer dereference again.

LKML bug report:
https://lore.kernel.org/all/CAL-gK7f5=R0nrrQdPtaZZr1fd-cdAMbDMuZ_NLA8vM0SX+nGSw@mail.gmail.com



Reported-by: default avatarNolan Nicholson <nolananicholson@gmail.com>
Signed-off-by: default avatarTomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Reviewed-by: default avatarMichał Kopeć <michal@nozomi.space>
Reviewed-by: default avatarPaul Dino Jones <paul@spacefreak18.xyz>
Tested-by: default avatarPaul Dino Jones <paul@spacefreak18.xyz>
Tested-by: default avatarCristóferson Bueno <cbueno81@gmail.com>
Tested-by: default avatarPablo Cisneros <patchkez@protonmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 634b15ad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment