Re: [RFC net] net: skbuff: fix stack variable out of bounds access

From: Willem de Bruijn
Date: Tue Mar 23 2021 - 13:16:20 EST


On Tue, Mar 23, 2021 at 12:30 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>
> On Tue, Mar 23, 2021 at 3:42 PM Willem de Bruijn
> <willemdebruijn.kernel@xxxxxxxxx> wrote:
> >
> > On Tue, Mar 23, 2021 at 8:52 AM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
> > >>
> > A similar fix already landed in 5.12-rc3: commit b228c9b05876 ("net:
> > expand textsearch ts_state to fit skb_seq_state"). That fix landed in
> > 5.12-rc3.
>
> Ah nice, even the same BUILD_BUG_ON() ;-)

Indeed :) Sorry that your work ended up essentially reproducing that.

> Too bad it had to be found through runtime testing when it could have been
> found by the compiler warning.

Definitely useful. Had I enabled it, it would have saved me a lot of debug time.