]> git.baikalelectronics.ru Git - 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)
commitd62c0e2316a9a26e9e633938cc0fe1b2dc15e837
tree23c7f5927c27ba3bbaabc241bf9b2ddd4d546a17
parent8632b5a032cc020d1dce7b8930aab7cc542c0014
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