]> git.baikalelectronics.ru Git - kernel.git/commit
igb: Check if num of q_vectors is smaller than max before array access
authorAleksandr Loktionov <aleksandr.loktionov@intel.com>
Thu, 22 Apr 2021 10:19:23 +0000 (10:19 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 1 Jul 2021 17:59:21 +0000 (10:59 -0700)
commit25587a0cfeefc2878b3d05a9c021d3803a18c74c
tree83bcdf19fef3bcd228e7acd1b1e5b5e0ae3df667
parentb17900fad4d37659fb8767714a2b509674000ce3
igb: Check if num of q_vectors is smaller than max before array access

Ensure that the adapter->q_vector[MAX_Q_VECTORS] array isn't accessed
beyond its size. It was fixed by using a local variable num_q_vectors
as a limit for loop index, and ensure that num_q_vectors is not bigger
than MAX_Q_VECTORS.

Fixes: 5fe3e3830326 ("igb: add new data structure for handling interrupts and NAPI")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Grzegorz Siwik <grzegorz.siwik@intel.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: Slawomir Laba <slawomirx.laba@intel.com>
Reviewed-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Reviewed-by: Mateusz Palczewski <mateusz.placzewski@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c