mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
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>
This commit is contained in:
parent
1e6aed4a6d
commit
25b38a3ec5
1 changed files with 1 additions and 1 deletions
|
@ -378,7 +378,7 @@ bool ice_alloc_rx_bufs_zc(struct ice_ring *rx_ring, u16 count)
|
|||
|
||||
do {
|
||||
*xdp = xsk_buff_alloc(rx_ring->xsk_pool);
|
||||
if (!xdp) {
|
||||
if (!*xdp) {
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue