]> git.baikalelectronics.ru Git - kernel.git/commit
igc: Check if num of q_vectors is smaller than max before array access
authorSasha Neftin <sasha.neftin@intel.com>
Mon, 14 Jun 2021 12:19:39 +0000 (15:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:27 +0000 (12:26 +0200)
commit9a89b7b59862da4e423d6e7aaacd19d050d2cc06
tree94013e1847701a7e61d6fa40f25942a4e5a1870d
parent40dc071dec25e16708231b33af3342161379b5c5
igc: Check if num of q_vectors is smaller than max before array access

[ Upstream commit 373e2829e7c2e1e606503cdb5c97749f512a4be9 ]

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.

Suggested-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igc/igc_main.c