mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
HID: uhid: fix leak for 64/32 UHID_CREATE
commit80897aa787upstream. UHID allows short writes so user-space can omit unused fields. We automatically set them to 0 in the kernel. However, the 64/32 bit compat-handler didn't do that in the UHID_CREATE fallback. This will reveal random kernel heap data (of random size, even) to user-space. Fixes:befde0226a('HID: uhid: make creating devices work on 64/32 systems') Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8e43aac1ec
commit
5b80fd00af
|
|
@ -312,7 +312,7 @@ static int uhid_event_from_user(const char __user *buffer, size_t len,
|
|||
*/
|
||||
struct uhid_create_req_compat *compat;
|
||||
|
||||
compat = kmalloc(sizeof(*compat), GFP_KERNEL);
|
||||
compat = kzalloc(sizeof(*compat), GFP_KERNEL);
|
||||
if (!compat)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user