Skip to content

Commit a57a126

Browse files
committed
HID: core: zero-initialize the report buffer
jira VULN-40845 cve CVE-2024-50302 commit-author Jiri Kosina <[email protected]> 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 <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]> (cherry picked from commit 177f25d) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent f96e41c commit a57a126

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

13541354
u32 len = hid_report_len(report) + 7;
13551355

1356-
return kmalloc(len, flags);
1356+
return kzalloc(len, flags);
13571357
}
13581358
EXPORT_SYMBOL_GPL(hid_alloc_report_buf);
13591359

0 commit comments

Comments
 (0)