]> git.baikalelectronics.ru Git - kernel.git/commit
ice: avoid premature Rx buffer reuse
authorBjörn Töpel <bjorn.topel@intel.com>
Tue, 25 Aug 2020 17:27:36 +0000 (19:27 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 9 Dec 2020 23:26:58 +0000 (15:26 -0800)
commit4a3a52b98a0562a5dfa2daf508168b3e56e218d7
treef96bf44dd20630a55a31d733ea85802d1fb2780e
parent2b0c4b591792f5340b7fd627959f02742eada831
ice: 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: 222ff8e45f21 ("ice: Add support for XDP")
Reported-and-analyzed-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_txrx.c