Re: [PATCH] spi: dw: Avoid stack content exposure

2021-02-12 Thread Mark Brown
On Thu, 11 Feb 2021 12:37:14 -0800, Kees Cook wrote: > Since "data" is u32, &data is a "u32 *" type, which means pointer math > will move in u32-sized steps. This was meant to be a byte offset, so > cast &data to "char *" to aim the copy into the correct location. > > Seen with -Warray-bounds (and

Re: [PATCH] spi: dw: Avoid stack content exposure

2021-02-11 Thread Serge Semin
On Thu, Feb 11, 2021 at 12:37:14PM -0800, Kees Cook wrote: > Since "data" is u32, &data is a "u32 *" type, which means pointer math > will move in u32-sized steps. This was meant to be a byte offset, so > cast &data to "char *" to aim the copy into the correct location. > > Seen with -Warray-bound

[PATCH] spi: dw: Avoid stack content exposure

2021-02-11 Thread Kees Cook
Since "data" is u32, &data is a "u32 *" type, which means pointer math will move in u32-sized steps. This was meant to be a byte offset, so cast &data to "char *" to aim the copy into the correct location. Seen with -Warray-bounds (and found by Coverity): In file included from ./include/linux/str