Message ID | 20240912163413.10019-1-aha310510@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | usb: iowarrior: fix infoleak in iowarrior_read() | expand |
On 12.09.24 18:34, Jeongjun Park wrote: > The dev->read_queue buffer memory allocated from iowarrior_probe is > allocated in an uninitialized state, and it is possible to copy the > uninitialized memory area to the user buffer through iowarrior_read. Hi, I am very sorry, but this is not a proper fix. That this happens shows that the driver has a bug in iowarrior_read(). Zeroing out the buffer just papers over it. Regards Oliver
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 6d28467ce352..5240e05c094e 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -831,9 +831,9 @@ static int iowarrior_probe(struct usb_interface *interface, dev->int_in_buffer, dev->report_size, iowarrior_callback, dev, dev->int_in_endpoint->bInterval); - /* create an internal buffer for interrupt data from the device */ + /* create an internal buffer for interrupt data from the device and initialize it */ dev->read_queue = - kmalloc_array(dev->report_size + 1, MAX_INTERRUPT_BUFFER, + kcalloc(dev->report_size + 1, MAX_INTERRUPT_BUFFER, GFP_KERNEL); if (!dev->read_queue) goto error;