ice: fix crash at allocation failure
authorMagnus Karlsson <magnus.karlsson@intel.com>
Wed, 25 May 2022 07:19:53 +0000 (09:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:28:58 +0000 (09:28 +0200)
commitbf5a3c51e9f7af02f6e0fff01751b623c68f2263
tree6bdc1fae5dea8c338891dc7b66d7a7e068da1618
parentacd12d16528152b32fa09be2c5ef95047f69af05
ice: fix crash at allocation failure

Fix a crash in the zero-copy driver that occurs when it fails to
allocate buffers from user-space. This crash can easily be triggered
by a malicious program that does not provide any buffers in the fill
ring for the kernel to use.

Note that this bug does not exist in upstream since the batched buffer
allocation interface got introduced in 5.16 and replaced this code.

Reported-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Tested-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/ice/ice_xsk.c