Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Changyul Lee
Wed, 18 Nov 2026 05:16
[PATCH iwl-net] idpf: free the RDMA auxiliary device ID after deleting the device
Author: Changyul Lee
Date: Wed, 18 Nov 2026 05:16
Date: Wed, 18 Nov 2026 05:16
40 lines
12071 bytes
12071 bytes
idpf_unplug_aux_dev() returns the ID to idpf_idc_ida before
auxiliary_device_delete() removes the device. If another idpf device
plugs an RDMA auxiliary device in between, it can get the same ID, and
its auxiliary_device_add() fails with -EEXIST because the old
"idpf.<vendor>.rdma.core.<id>" or "idpf.<vendor>.rdma.vdev.<id>" device
is still registered. RDMA is then not set up on that device.
Free the ID after auxiliary_device_delete(). It still has to be freed
before auxiliary_device_uninit(), whose release callback frees adev.
Fixes: 65637c3a1811 ("idpf: fix UAF in RDMA core aux dev deinitialization")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
---
Found with a static analysis tool we are developing.
Compile-tested only, with x86_64_defconfig plus IDPF and W=1.
drivers/net/ethernet/intel/idpf/idpf_idc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_idc.c b/drivers/net/ethernet/intel/idpf/idpf_idc.c
index b6cd1c25ae5d..9d3c55854477 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_idc.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_idc.c
@@ -253,9 +253,8 @@ static void idpf_unplug_aux_dev(struct auxiliary_device *adev)
if (!adev)
return;
- ida_free(&idpf_idc_ida, adev->id);
-
auxiliary_device_delete(adev);
+ ida_free(&idpf_idc_ida, adev->id);
auxiliary_device_uninit(adev);
}
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.43.0
Re: [PATCH iwl-net] idpf: free the RDMA auxiliary device ID after deleting the device
Author: Simon Horman
Date: Mon, 23 Nov 2026 16:30
Date: Mon, 23 Nov 2026 16:30
20 lines
8851 bytes
8851 bytes
On Wed, Nov 18, 2026 at 12:16:11AM -0500, Changyul Lee wrote:
> idpf_unplug_aux_dev() returns the ID to idpf_idc_ida before
> auxiliary_device_delete() removes the device. If another idpf device
> plugs an RDMA auxiliary device in between, it can get the same ID, and
> its auxiliary_device_add() fails with -EEXIST because the old
> "idpf.<vendor>.rdma.core.<id>" or "idpf.<vendor>.rdma.vdev.<id>" device
> is still registered. RDMA is then not set up on that device.
>
> Free the ID after auxiliary_device_delete(). It still has to be freed
> before auxiliary_device_uninit(), whose release callback frees adev.
>
> Fixes: 65637c3a1811 ("idpf: fix UAF in RDMA core aux dev deinitialization")
> Signed-off-by: Changyul Lee <lcy8047@gmail.com>
> ---
> Found with a static analysis tool we are developing.
>
> Compile-tested only, with x86_64_defconfig plus IDPF and W=1.
Reviewed-by: Simon Horman <horms@kernel.org>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads