Re: [Linux-kernel-mentees] [PATCH] v4l2-tpg: Fix global-out-of-bounds read in precalculate_color()

2020-08-21 Thread Peilin Ye
On Fri, Aug 21, 2020 at 12:12:28PM +0200, Hans Verkuil wrote: > Arrgh! I know what this is. /dev/video6 corresponds to the Metadata output > device of vivid, and that metadata format sets brightness, contrast, > saturation and hue: > > struct vivid_meta_out_buf { > u16 brightness; >

Re: [Linux-kernel-mentees] [PATCH] v4l2-tpg: Fix global-out-of-bounds read in precalculate_color()

2020-08-21 Thread Hans Verkuil
On 21/08/2020 11:48, Peilin Ye wrote: > Hi Mr. Verkuil, > > On Wed, Aug 19, 2020 at 04:26:28PM +0200, Hans Verkuil wrote: >> Hi Peilin, >> >> On 10/08/2020 07:05, Peilin Ye wrote: >>> precalculate_color() is reading out of `sin` since `tpg->hue` is not being >>> properly checked. Fix it. `cos` is

Re: [Linux-kernel-mentees] [PATCH] v4l2-tpg: Fix global-out-of-bounds read in precalculate_color()

2020-08-21 Thread Peilin Ye
Hi Mr. Verkuil, On Wed, Aug 19, 2020 at 04:26:28PM +0200, Hans Verkuil wrote: > Hi Peilin, > > On 10/08/2020 07:05, Peilin Ye wrote: > > precalculate_color() is reading out of `sin` since `tpg->hue` is not being > > properly checked. Fix it. `cos` is safe, as long as `tpg->hue` is higher > > than

Re: [Linux-kernel-mentees] [PATCH] v4l2-tpg: Fix global-out-of-bounds read in precalculate_color()

2020-08-19 Thread Peilin Ye
Hi Mr. Verkuil, On Wed, Aug 19, 2020 at 04:26:28PM +0200, Hans Verkuil wrote: > Hi Peilin, > > On 10/08/2020 07:05, Peilin Ye wrote: > > precalculate_color() is reading out of `sin` since `tpg->hue` is not being > > properly checked. Fix it. `cos` is safe, as long as `tpg->hue` is higher > >

Re: [Linux-kernel-mentees] [PATCH] v4l2-tpg: Fix global-out-of-bounds read in precalculate_color()

2020-08-19 Thread Hans Verkuil
Hi Peilin, On 10/08/2020 07:05, Peilin Ye wrote: > precalculate_color() is reading out of `sin` since `tpg->hue` is not being > properly checked. Fix it. `cos` is safe, as long as `tpg->hue` is higher > than or equal to -192. Thank you for this patch, but there is something I don't understand,

[Linux-kernel-mentees] [PATCH] v4l2-tpg: Fix global-out-of-bounds read in precalculate_color()

2020-08-09 Thread Peilin Ye
precalculate_color() is reading out of `sin` since `tpg->hue` is not being properly checked. Fix it. `cos` is safe, as long as `tpg->hue` is higher than or equal to -192. Fixes: 63881df94d3e ("[media] vivid: add the Test Pattern Generator") Reported-and-tested-by: