linux/drivers/net/ethernet/intel/ice/devlink
Xuanqiang Luo 1402fc67d2 ice: fix use-after-free in dynamic port cleanup
ice_dealloc_dynamic_port() uses dyn_port->vsi->idx to erase the dynamic
port from pf->dyn_ports. However, it frees the VSI before reading the
index for the erase, resulting in a use-after-free.

Follow the reverse of the allocation order in ice_alloc_dynamic_port()
by erasing the xarray entry before freeing the VSI.

Fixes: eda69d654c ("ice: add basic devlink subfunctions support")
Cc: stable@vger.kernel.org
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Patryk Holda <patryk.holda@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://patch.msgid.link/20260928230429.495442-3-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-02 13:38:08 -07:00
..
devlink.c ice: acquire NVM lock around each flash read 2026-08-11 13:22:57 -07:00
devlink.h ice: allocate devlink for subfunction 2024-09-06 11:01:24 -07:00
health.c devlink: Move graceful period parameter to reporter ops 2025-08-26 17:24:16 -07:00
health.h ice: add fw and port health reporters 2025-01-14 14:37:34 -08:00
port.c ice: fix use-after-free in dynamic port cleanup 2026-10-02 13:38:08 -07:00
port.h net: Fix typos 2025-07-25 10:29:07 -07:00