UPSTREAM: HID: core: zero-initialize the report buffer lineage-22.0 lineage-22.1 lineage-22.2
authorJiri Kosina <jkosina@suse.com>
Tue, 29 Oct 2024 14:44:35 +0000 (15:44 +0100)
committerNolen Johnson <johnsonnolen@gmail.com>
Fri, 7 Mar 2025 05:33:17 +0000 (00:33 -0500)
commit809b8162409a893f026c0b48ef90e3ddd51ec4ee
treea2e81f238df0cc8b4ae19adbc1d370f18c2803eb
parenta1953c0552e7b23ee2f942101b63ef1cfb6a6983
UPSTREAM: HID: core: zero-initialize the report buffer

[ Upstream commit 177f25d1292c7e16e1199b39c85480f7f8815552 ]

Since the report buffer is used by all kinds of drivers in various ways, let's
zero-initialize it during allocation to make sure that it can't be ever used
to leak kernel memory via specially-crafted report.

Bug: 380395346
Fixes: 27ce405039bf ("HID: fix data access in implement()")
Reported-by: Benoît Sevens <bsevens@google.com>
Acked-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 9d9f5c75c0c7f31766ec27d90f7a6ac673193191)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I31f64f2745347137bbc415eb35b7fab5761867f3
drivers/hid/hid-core.c