]> git.baikalelectronics.ru Git - kernel.git/commit
ice: add validation in OP_CONFIG_VSI_QUEUES VF message
authorMichal Swiatkowski <michal.swiatkowski@intel.com>
Thu, 25 Jul 2019 09:53:59 +0000 (02:53 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 27 Aug 2019 06:25:14 +0000 (23:25 -0700)
commit72a88a0b5dcddac593ff8738d5b46329a7310c96
treeb851f7f082ceb42e4851bbed212e6ed3def6ecfe
parent088f0d0addf0e6babf845b2a51d56e52ab7b69f8
ice: add validation in OP_CONFIG_VSI_QUEUES VF message

Check num_queue_pairs to avoid access to unallocated field of
vsi->tx_rings/vsi->rx_rings. Without this validation we can set
vsi->alloc_txq/vsi->alloc_rxq to value smaller than ICE_MAX_BASE_QS_PER_VF
and send this command with num_queue_pairs greater than
vsi->alloc_txq/vsi->alloc_rxq. This lead to access to unallocated memory.

In VF vsi alloc_txq and alloc_rxq should be the same. Get minimum
because looks more readable.

Also add validation for ring_len param. It should be greater than 32 and
be multiple of 32. Incorrect value leads to hang traffic on PF.

Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c