]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
i40e: disallow changing the number of descriptors when AF_XDP is on
authorBjörn Töpel <bjorn.topel@intel.com>
Fri, 7 Sep 2018 08:18:48 +0000 (10:18 +0200)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 25 Sep 2018 20:16:19 +0000 (13:16 -0700)
commit3ab52af58fa481324bb7c839a2187c54c4af912b
tree23c7f5927c27ba3bbaabc241bf9b2ddd4d546a17
parent411dc16ff1775517ec91cdb64be7ee0daca44e22
i40e: disallow changing the number of descriptors when AF_XDP is on

When an AF_XDP UMEM is attached to any of the Rx rings, we disallow a
user to change the number of descriptors via e.g. "ethtool -G IFNAME".

Otherwise, the size of the stash/reuse queue can grow unbounded, which
would result in OOM or leaking userspace buffers.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_txrx_common.h
drivers/net/ethernet/intel/i40e/i40e_xsk.c