Skip to content

Commit 67be554

Browse files
Jiri Kosinamehmetb0
authored andcommitted
HID: core: zero-initialize the report buffer
BugLink: https://bugs.launchpad.net/bugs/2089533 [ 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. Fixes: 27ce405 ("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> CVE-2024-50302 Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent d5a6696 commit 67be554

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
@@ -1664,7 +1664,7 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags)
16641664

16651665
u32 len = hid_report_len(report) + 7;
16661666

1667-
return kmalloc(len, flags);
1667+
return kzalloc(len, flags);
16681668
}
16691669
EXPORT_SYMBOL_GPL(hid_alloc_report_buf);
16701670

0 commit comments

Comments
 (0)