ixgbe: avoid premature Rx buffer reuse
authorBjörn Töpel <bjorn.topel@intel.com>
Tue, 25 Aug 2020 17:27:35 +0000 (19:27 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 9 Dec 2020 23:26:58 +0000 (15:26 -0800)
commita06316dc87bdc000f7f39a315476957af2ba0f05
tree6d1e9914dde4ff01a0c96dd856467d35999d1bf1
parent75aab4e10ae6a4593a60f66d13de755d4e91f400
ixgbe: avoid premature Rx buffer reuse

The page recycle code, incorrectly, relied on that a page fragment
could not be freed inside xdp_do_redirect(). This assumption leads to
that page fragments that are used by the stack/XDP redirect can be
reused and overwritten.

To avoid this, store the page count prior invoking xdp_do_redirect().

Fixes: 6453073987ba ("ixgbe: add initial support for xdp redirect")
Reported-and-analyzed-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c