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 <[email protected]>
> ---
> 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 <[email protected]>

Reply via email to