linux/drivers/net/ethernet/intel/idpf
Greg Kroah-Hartman 6c77b95108 idpf: fix double free and use-after-free in aux device error paths
When auxiliary_device_add() fails in idpf_plug_vport_aux_dev() or
idpf_plug_core_aux_dev(), the err_aux_dev_add label calls
auxiliary_device_uninit() and falls through to err_aux_dev_init.  The
uninit call will trigger put_device(), which invokes the release
callback (idpf_vport_adev_release / idpf_core_adev_release) that frees
iadev.  The fall-through then reads adev->id from the freed iadev for
ida_free() and double-frees iadev with kfree().

Free the IDA slot and clear the back-pointer before uninit, while adev
is still valid, then return immediately.

Commit 65637c3a18 ("idpf: fix UAF in RDMA core aux dev deinitialization")
fixed the same use-after-free in the matching unplug path in this file but
missed both probe error paths.

Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: stable@kernel.org
Fixes: be91128c57 ("idpf: implement RDMA vport auxiliary dev create, init, and destroy")
Fixes: f4312e6bfa ("idpf: implement core RDMA auxiliary dev create, init, and destroy")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260506-jk-iwl-net-2026-05-04-v2-4-a5ea4dc837a9@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-08 16:01:09 -07:00
..
idpf_controlq_api.h idpf: convert control queue mutex to a spinlock 2025-07-01 08:25:01 -07:00
idpf_controlq_setup.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
idpf_controlq.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
idpf_controlq.h idpf: implement get LAN MMIO memory regions 2025-07-14 10:57:51 -07:00
idpf_dev.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
idpf_devids.h
idpf_ethtool.c Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 2026-02-28 08:43:56 -08:00
idpf_idc.c idpf: fix double free and use-after-free in aux device error paths 2026-05-08 16:01:09 -07:00
idpf_lan_pf_regs.h idpf: negotiate PTP capabilities and get PTP clock 2025-05-16 09:13:02 -07:00
idpf_lan_txrx.h idpf: add 4-byte completion descriptor definition 2025-09-08 11:05:17 -07:00
idpf_lan_vf_regs.h
idpf_lib.c Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 2026-02-28 08:43:56 -08:00
idpf_main.c PCI/PTM: Drop pci_enable_ptm() granularity parameter 2026-02-24 10:59:50 -06:00
idpf_mem.h idpf: implement get LAN MMIO memory regions 2025-07-14 10:57:51 -07:00
idpf_ptp.c idpf: fix read_dev_clk_lock spinlock init in idpf_ptp_init() 2026-05-08 16:01:09 -07:00
idpf_ptp.h idpf: add cross timestamping 2025-07-18 09:02:27 -07:00
idpf_singleq_txrx.c idpf: convert vport state to bitmap 2025-11-27 18:34:21 -08:00
idpf_txrx.c idpf: only assign num refillqs if allocation was successful 2026-03-23 13:29:51 -07:00
idpf_txrx.h idpf: add rss_data field to RSS function parameters 2026-01-22 14:00:06 -08:00
idpf_vf_dev.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
idpf_virtchnl_ptp.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
idpf_virtchnl.c idpf: set the payload size before calling the async handler 2026-04-06 13:39:15 -07:00
idpf_virtchnl.h idpf: fix PREEMPT_RT raw/bh spinlock nesting for async VC handling 2026-04-06 13:38:48 -07:00
idpf.h idpf: clear stale cdev_info ptr 2026-03-23 13:29:50 -07:00
Kconfig idpf: prepare structures to support XDP 2025-09-08 11:05:17 -07:00
Makefile idpf: add XSk pool initialization 2025-09-24 10:34:35 -07:00
virtchnl2_lan_desc.h
virtchnl2.h virtchnl2: add flow steering support 2025-07-18 09:02:27 -07:00
xdp.c libeth, idpf: use truesize as XDP RxQ info frag_size 2026-03-05 08:02:05 -08:00
xdp.h idpf: export RX hardware timestamping information to XDP 2026-01-26 09:32:36 -08:00
xsk.c libeth, idpf: use truesize as XDP RxQ info frag_size 2026-03-05 08:02:05 -08:00
xsk.h idpf: enable XSk features and ndo_xsk_wakeup 2025-09-24 10:34:45 -07:00