Re: [PATCH v2] staging: fbtft: fix out of bound access

From: Sudip Mukherjee
Date: Mon Jun 08 2015 - 10:52:25 EST


On Thu, Jun 04, 2015 at 10:46:51PM -0700, Joe Perches wrote:
> 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:
> []
<snip>
> 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.
Hi Joe,
I was doing this one today, and just changed write_reg8_bus8 to test.
but when started compiling I found out another variation:
#define write_reg(par, ...) \
par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__)

and there are only 870 calls to write_reg. :(
I was making it like void write_reg8_bus8(struct fbtft_par *par, int len, int *sbuf)
but if i have to add an integer array to the places where write_reg is called
it will become a big change. Any simple idea?

regards
sudip
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/