Re: [PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-12 Thread Greg KH
On Fri, Sep 12, 2014 at 06:11:49PM +0200, Maciej Matraszek wrote: > On Wed, 2014-09-10 at 10:10 -0700, Greg KH wrote: > > > Fixes: b0d3159be9a3 ("V4L/DVB (11901): v4l2: Create helper function for > > > bounding and aligning images") > > > Signed-off-by: Maciej Matraszek > > > Acked-by: Sakari

Re: [PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-12 Thread Maciej Matraszek
On Wed, 2014-09-10 at 10:10 -0700, Greg KH wrote: > > Fixes: b0d3159be9a3 ("V4L/DVB (11901): v4l2: Create helper function for > > bounding and aligning images") > > Signed-off-by: Maciej Matraszek > > Acked-by: Sakari Ailus > > > > --- > > > > This is not the correct way to submit patches

Re: [PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-12 Thread Maciej Matraszek
On Wed, 2014-09-10 at 10:10 -0700, Greg KH wrote: Fixes: b0d3159be9a3 (V4L/DVB (11901): v4l2: Create helper function for bounding and aligning images) Signed-off-by: Maciej Matraszek m.matras...@samsung.com Acked-by: Sakari Ailus sakari.ai...@linux.intel.com --- formletter This

Re: [PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-12 Thread Greg KH
On Fri, Sep 12, 2014 at 06:11:49PM +0200, Maciej Matraszek wrote: On Wed, 2014-09-10 at 10:10 -0700, Greg KH wrote: Fixes: b0d3159be9a3 (V4L/DVB (11901): v4l2: Create helper function for bounding and aligning images) Signed-off-by: Maciej Matraszek m.matras...@samsung.com Acked-by:

Re: [PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-10 Thread Greg KH
On Wed, Sep 10, 2014 at 06:51:09PM +0200, Maciej Matraszek wrote: > Fix clamp_align() used in v4l_bound_align_image() to prevent overflow when > passed large value like UINT32_MAX. In the current implementation: > clamp_align(UINT32_MAX, 8, 8192, 3) > returns 8, because in line: > x = (x +

[PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-10 Thread Maciej Matraszek
Fix clamp_align() used in v4l_bound_align_image() to prevent overflow when passed large value like UINT32_MAX. In the current implementation: clamp_align(UINT32_MAX, 8, 8192, 3) returns 8, because in line: x = (x + (1 << (align - 1))) & mask; x overflows to (-1 + 4) & 0x7 = 3, while

[PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-10 Thread Maciej Matraszek
Fix clamp_align() used in v4l_bound_align_image() to prevent overflow when passed large value like UINT32_MAX. In the current implementation: clamp_align(UINT32_MAX, 8, 8192, 3) returns 8, because in line: x = (x + (1 (align - 1))) mask; x overflows to (-1 + 4) 0x7 = 3, while expected

Re: [PATCH v2] [media] v4l2-common: fix overflow in v4l_bound_align_image()

2014-09-10 Thread Greg KH
On Wed, Sep 10, 2014 at 06:51:09PM +0200, Maciej Matraszek wrote: Fix clamp_align() used in v4l_bound_align_image() to prevent overflow when passed large value like UINT32_MAX. In the current implementation: clamp_align(UINT32_MAX, 8, 8192, 3) returns 8, because in line: x = (x + (1