]> git.baikalelectronics.ru Git - kernel.git/commit
igb: Fix use-after-free error during reset
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Fri, 14 May 2021 00:31:04 +0000 (17:31 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 1 Jul 2021 17:53:04 +0000 (10:53 -0700)
commite5d68133dbcf3748a7ecbf6a1116e96b08669400
treeaaf9e657a3986864c24fe0d29854ff9eb2eefefe
parent31a9598c5df95231949ea23e275750e1a9d771f6
igb: Fix use-after-free error during reset

Cleans the next descriptor to watch (next_to_watch) when cleaning the
TX ring.

Failure to do so can cause invalid memory accesses. If igb_poll() runs
while the controller is reset this can lead to the driver try to free
a skb that was already freed.

(The crash is harder to reproduce with the igb driver, but the same
potential problem exists as the code is identical to igc)

Fixes: 50260c83106b ("igb: Don't bother clearing Tx buffer_info in igb_clean_tx_ring")
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Reported-by: Erez Geva <erez.geva.ext@siemens.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