RE: [Intel-wired-lan] [PATCH net-next 3/3] virtchnl: fix fake 1-elem arrays for structures allocated as `nents`

From: Romanowski, Rafal
Date: Wed Aug 16 2023 - 08:52:45 EST


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> Kees Cook
> Sent: piątek, 4 sierpnia 2023 10:30
> To: Lobakin, Aleksander <aleksander.lobakin@xxxxxxxxx>
> Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>; Zaremba,
> Larysa <larysa.zaremba@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; Gustavo A. R.
> Silva <gustavoars@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Eric Dumazet
> <edumazet@xxxxxxxxxx>; intel-wired-lan@xxxxxxxxxxxxxxxx; linux-
> hardening@xxxxxxxxxxxxxxx; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>
> Subject: Re: [Intel-wired-lan] [PATCH net-next 3/3] virtchnl: fix fake 1-elem
> arrays for structures allocated as `nents`
>
> On Fri, Jul 28, 2023 at 05:52:07PM +0200, Alexander Lobakin wrote:
> > Finally, fix 3 structures which are allocated technically correctly,
> > i.e. the calculated size equals to the one that struct_size() would
> > return, except for sizeof(). For &virtchnl_vlan_filter_list_v2, use
> > the same approach when there are no enough space as taken previously
> > for &virtchnl_vlan_filter_list, i.e. let the maximum size be
> > calculated automatically instead of trying to guestimate it using maths.
> >
> > Signed-off-by: Alexander Lobakin <aleksander.lobakin@xxxxxxxxx>
>
> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
>
> --
> Kees Cook
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@xxxxxxxxxx
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan


Tested-by: Rafal Romanowski <rafal.romanowski@xxxxxxxxx>