OpenCloudOS-Kernel/drivers/net/ethernet/intel
Cristian Dumitrescu 7128c834d3 i40e: fix potential NULL pointer dereferencing
Currently, the function i40e_construct_skb_zc only frees the input xdp
buffer when the output skb is successfully built. On error, the
function i40e_clean_rx_irq_zc does not commit anything for the current
packet descriptor and simply exits the packet descriptor processing
loop, with the plan to restart the processing of this descriptor on
the next invocation. Therefore, on error the ring next-to-clean
pointer should not advance, the xdp i.e. *bi buffer should not be
freed and the current buffer info should not be invalidated by setting
*bi to NULL. Therefore, the *bi should only be set to NULL when the
function i40e_construct_skb_zc is successful, otherwise a NULL *bi
will be dereferenced when the work for the current descriptor is
eventually restarted.

Fixes: 3b4f0b66c2 ("i40e, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL")
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Link: https://lore.kernel.org/r/20210111181138.49757-1-cristian.dumitrescu@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-01-13 19:33:28 -08:00
..
e1000 e1000: remove unused and incorrect code 2020-10-13 19:44:01 -07:00
e1000e e1000e: Export S0ix flags to ethtool 2020-12-23 15:18:34 -08:00
fm10k net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
i40e i40e: fix potential NULL pointer dereferencing 2021-01-13 19:33:28 -08:00
iavf iavf: fix double-release of rtnl_lock 2020-12-17 14:12:55 -08:00
ice ice, xsk: clear the status bits for the next_to_use descriptor 2020-12-16 10:51:07 -08:00
igb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
igbvf igbvf: Refactor traces 2020-11-24 08:02:24 -08:00
igc igc: Add new device ID 2020-12-10 13:13:24 -08:00
ixgb intel: handle unused assignments 2020-09-25 16:28:59 -07:00
ixgbe Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
ixgbevf xsk: Propagate napi_id to XDP socket Rx path 2020-12-01 00:09:25 +01:00
Kconfig ice: implement device flash update via devlink 2020-07-28 17:07:06 -07:00
Makefile igc: Add skeletal frame for Intel(R) 2.5G Ethernet Controller support 2018-10-17 12:14:54 -07:00
e100.c net: e100: Remove in_interrupt() usage and pointless GFP_ATOMIC allocation 2020-09-29 14:02:54 -07:00