[Intel-wired-lan] [PATCH S35 14/15] ice: Add a boundary check in ice_xsk_umem()

Bowers, AndrewX andrewx.bowers at intel.com
Wed Dec 18 22:34:06 UTC 2019


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Tony Nguyen
> Sent: Thursday, December 12, 2019 3:13 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S35 14/15] ice: Add a boundary check in
> ice_xsk_umem()
> 
> From: Krzysztof Kazimierczak <krzysztof.kazimierczak at intel.com>
> 
> In ice_xsk_umem(), variable qid which is later used as an array index, is not
> validated for a possible boundary exceedance. Because of that, a calling
> function might receive an invalid address, which causes general protection
> fault when dereferenced.
> 
> To address this, add a boundary check to see if qid is greater than the size of
> a UMEM array. Also, don't let user change vsi->num_xsk_umems just by
> trying to setup a second UMEM if its value is already set up (i.e. UMEM
> region has already been allocated for this VSI).
> 
> While at it, make sure that ring->zca.free pointer is always zeroed out if there
> is no UMEM on a specified ring.
> 
> Signed-off-by: Krzysztof Kazimierczak <krzysztof.kazimierczak at intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice.h      | 5 +++--
>  drivers/net/ethernet/intel/ice/ice_base.c | 1 +
> drivers/net/ethernet/intel/ice/ice_xsk.c  | 3 ++-
>  3 files changed, 6 insertions(+), 3 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers at intel.com>




More information about the Intel-wired-lan mailing list