[PATCH] examples/ipsec-secgw: fix partial overflow

Dooley, Brian brian.dooley at intel.com
Thu Nov 23 11:48:07 CET 2023


Thanks Thomas, makes sense.

> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Wednesday, November 22, 2023 4:38 PM
> To: Dooley, Brian <brian.dooley at intel.com>
> Cc: dev at dpdk.org; stable at dpdk.org; Nicolau, Radu
> <radu.nicolau at intel.com>; Akhil Goyal <gakhil at marvell.com>; Power, Ciara
> <ciara.power at intel.com>
> Subject: Re: [PATCH] examples/ipsec-secgw: fix partial overflow
> 
> > > Case of partial overflow detected with ASan. Added extra padding to
> > > cdev_key structure.
> > >
> > > This structure is used for the key in hash table.
> > > Padding is added to force the struct to use 8 bytes, to ensure
> > > memory is notread past this structs boundary (the hash key
> > > calculation reads 8 bytes if this struct is size 5 bytes).
> > > The padding should be zeroed.
> > > If fields are modified in this struct, the padding must be updated
> > > to ensure multiple of 8 bytes size overall.
> > >
> > > Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample
> > > application")
> > > Cc: sergio.gonzalez.monroy at intel.com
> > > Cc: stable at dpdk.org
> > >
> > > Signed-off-by: Brian Dooley <brian.dooley at intel.com>
> >
> > Acked-by: Ciara Power <ciara.power at intel.com>
> 
> Applied and made the comment simpler with this:
> 
>   uint8_t padding[3]; /* padding to 8-byte size should be zeroed */
> 
> 



More information about the stable mailing list