Commit b8064028 authored by Vinicius Costa Gomes's avatar Vinicius Costa Gomes Committed by liwei
Browse files

igb: Fix use-after-free error during reset

mainline inclusion
from mainline-v5.14-rc2
commit 7b292608
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9R4I4
CVE: CVE-2021-47301

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7b292608db23ccbbfbfa50cdb155d01725d7a52e



--------------------------------

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: 7cc6fd4c ("igb: Don't bother clearing Tx buffer_info in igb_clean_tx_ring")
Signed-off-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
Reported-by: default avatarErez Geva <erez.geva.ext@siemens.com>
Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: default avatardengquan <dengquan9@huawei.com>
parent 5673bfb2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment