lkml.org 
[lkml]   [2015]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] staging: fbtft: fix out of bound access
From
Date
On Fri, 2015-06-05 at 10:22 +0530, Sudip Mukherjee wrote:
> On Thu, Jun 04, 2015 at 01:48:31PM -0700, Joe Perches wrote:
[]
> ccing you just slipped out of my mind.

No worries.

> > > diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> > []
> > > @@ -1067,8 +1067,6 @@ static int fbtft_init_display_dt(struct fbtft_par *par)
> > > const __be32 *p;
> > > u32 val;
> > > int buf[64], i, j;
> > []
> > > par->fbtftops.write_register(par, i,
> > > buf[0], buf[1], buf[2], buf[3],
> >
> > It seems there are only 2 callers of (*write_register)()
> > and the arguments are always an in-order array int[64]
> >
> > Maybe it'd be nicer to change the prototypes of the
> > write_register functions to take a const int *
> > instead of pushing 64 ints on the stack.
> yes, I will send it as a separate patch as that is another change.

I looked at it a bit more and there's a macro that calls
write_register so there are actually many more call sites.

It's a bit non trivial to change the macro as all the
called (*write_register) functions would need changing
and these functions use va_list.

Maybe if you _really_ feel like it, but it's a bit of work.




\
 
 \ /
  Last update: 2015-06-05 08:01    [W:0.049 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site