Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 2284ba2

Browse files
Jiri Kosinalag-google
authored andcommitted
UPSTREAM: HID: core: zero-initialize the report buffer
[ Upstream commit 177f25d ] 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: 27ce405 ("HID: fix data access in implement()") Reported-by: Benoît Sevens <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 9d9f5c7) Signed-off-by: Lee Jones <[email protected]> Change-Id: I31f64f2745347137bbc415eb35b7fab5761867f3
1 parent d66e916 commit 2284ba2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags)
18751875

18761876
u32 len = hid_report_len(report) + 7;
18771877

1878-
return kmalloc(len, flags);
1878+
return kzalloc(len, flags);
18791879
}
18801880
EXPORT_SYMBOL_GPL(hid_alloc_report_buf);
18811881

0 commit comments

Comments
 (0)