Re: [patch -longterm] V4L/DVB: v4l2-ioctl: integer overflow in

Greg KH
2012-01-03T20:55:39Z

On Thu, Dec 15, 2011 at 07:50:30AM -0200, Mauro Carvalho Chehab wrote:
> On 15-12-2011 07:33, Hans Verkuil wrote:
> > On Thursday, December 15, 2011 10:21:41 Mauro Carvalho Chehab wrote:
> >> On 15-12-2011 04:34, Dan Carpenter wrote:
> >>> On a 32bit system the multiplication here could overflow. p->count is
> >>> used in some of the V4L drivers.
> >>
> >> ULONG_MAX / sizeof(v4l2_ext_control) is too much. This ioctl is used on things
> >> like setting MPEG paramenters, where several parameters need adjustments at
> >> the same time. I risk to say that 64 is probably a reasonably safe upper limit.
> >
> > Let's make it 1024. That gives more than enough room for expansion without taking
> > too much memory.
> >
> > Especially for video encoders a lot of controls are needed, and sensor drivers
> > are also getting more complex, so 64 is a bit too low for my taste.
> >
> > I agree that limiting this to some sensible value is a good idea.
>
> I'm fine with 1024. Yet, this could easily be changed to whatever upper value needed,
> and still be backward compatible.

Ok, can someone please send me the "accepted" version of this patch for
inclusion in the 2.6.32-stable tree?

thanks,

greg k-h