FAILED: patch "[PATCH] ice: fix use-after-free in dynamic port cleanup" failed to apply to 6.12-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 1402fc67d2f4e2e1fc7bf8ee0825b8ad994557ff
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026101237-unmoral-plaster-544b@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 1402fc67d2f4e2e1fc7bf8ee0825b8ad994557ff Mon Sep 17 00:00:00 2001
From: Xuanqiang Luo <[email protected]>
Date: Mon, 28 Sep 2026 16:04:23 -0700
Subject: [PATCH] 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.
drivers/net/ethernet/intel/ice/devlink/port.c +1 -1
@@ -590,8 +590,8 @@ static void ice_dealloc_dynamic_port(struct ice_dynamic_port *dyn_port)xa_erase (&pf->sf_nums, devlink_port->attrs.pci_sf.sf);ice_eswitch_detach_sf (pf, dyn_port); -ice_vsi_free (dyn_port->vsi);xa_erase (&pf->dyn_ports, dyn_port->vsi->idx); +ice_vsi_free (dyn_port->vsi);kfree (dyn_port); }
Sasha Levin
maintainerPATCH 1/1 ice: fix use-after-free in dynamic port cleanup
From: Xuanqiang Luo <[email protected]>
[ Upstream commit 1402fc67d2f4e2e1fc7bf8ee0825b8ad994557ff ]
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.
--- drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/devlink/devlink_port.c +1 -1
@@ -588,8 +588,8 @@ static void ice_dealloc_dynamic_port(struct ice_dynamic_port *dyn_port)xa_erase (&pf->sf_nums, devlink_port->attrs.pci_sf.sf);ice_eswitch_detach_sf (pf, dyn_port); -ice_vsi_free (dyn_port->vsi);xa_erase (&pf->dyn_ports, dyn_port->vsi->idx); +ice_vsi_free (dyn_port->vsi);kfree (dyn_port); }
Signature · 1 line
2.53.0