Please ignore the first submitted patch. I forgot to remove the memset(mem, 0, size); statement. Please use this patch instead. Sorry about that....
This patch replaces vmalloc_32 with vmalloc_32_user. Allocating virtually contiguous memory (32bit addressable) which is zeroed so it can be mapped to userspace without leaking data.
Signed-off-by: Dwaine P. Garden <DwaineGarden@xxxxxxxxxx>
This patch replaces vmalloc_32 with vmalloc_32_user. Allocating virtually contiguous memory (32bit addressable) which is zeroed so it can be mapped to userspace without leaking data.
Signed-off-by: Dwaine P. Garden <DwaineGarden@xxxxxxxxxx>
diff -U 3 -H -d -r -N -- a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c --- a/linux/drivers/media/video/usbvision/usbvision-core.c 2007-01-15 19:11:11.000000000 -0500 +++ b/linux/drivers/media/video/usbvision/usbvision-core.c 2007-01-15 21:38:31.000000000 -0500 @@ -131,11 +131,10 @@ unsigned long adr; size = PAGE_ALIGN(size); - mem = vmalloc_32(size); + mem = vmalloc_32_user(size); if (!mem) return NULL; - memset(mem, 0, size); /* Clear the ram out, no junk to the user */ adr = (unsigned long) mem; while (size > 0) { SetPageReserved(vmalloc_to_page((void *)adr)); @@ -414,7 +413,7 @@ int usbvision_scratch_alloc(struct usb_usbvision *usbvision) { - usbvision->scratch = vmalloc_32(scratch_buf_size); + usbvision->scratch = vmalloc_32_user(scratch_buf_size); scratch_reset(usbvision); if(usbvision->scratch == NULL) { err("%s: unable to allocate %d bytes for scratch", @@ -525,7 +524,7 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision) { int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2; - usbvision->IntraFrameBuffer = vmalloc_32(IFB_size); + usbvision->IntraFrameBuffer = vmalloc_32_user(IFB_size); if (usbvision->IntraFrameBuffer == NULL) { err("%s: unable to allocate %d for compr. frame buffer", __FUNCTION__, IFB_size); return -ENOMEM;
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb