linux/drivers/net/ethernet/amazon/ena
Guangshuo Li 9476b44688 net: ena: fix MMIO read buffer leak on probe failure
ena_device_init() initializes the MMIO read mechanism with
ena_com_mmio_reg_read_request_init(), which allocates a coherent DMA
buffer for MMIO read responses.

The normal removal path releases this buffer through
ena_com_mmio_reg_read_request_destroy(). However, if ena_probe() fails
after ena_device_init() succeeds, the error path destroys the admin
resources and eventually frees ena_dev without destroying the MMIO read
request, leaving the coherent DMA buffer allocated.

Call ena_com_mmio_reg_read_request_destroy() in the probe error path
before releasing the remaining device resources.

This issue was found by manual code inspection.

Fixes: 1738cd3ed3 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20260921154202.471662-3-lgs201920130244@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-24 09:57:55 -07:00
..
ena_admin_defs.h net: Fix typos 2025-07-25 10:29:07 -07:00
ena_com.c net: ena: PHC: Add missing barrier 2026-06-05 18:28:21 -07:00
ena_com.h net: ena: Add PHC support in the ENA driver 2025-06-18 18:57:28 -07:00
ena_common_defs.h
ena_debugfs.c net: ena: View PHC stats using debugfs 2025-06-18 18:57:29 -07:00
ena_debugfs.h net: ena: Add debugfs support to the ENA driver 2025-06-18 18:57:29 -07:00
ena_devlink.c devlink: pass param values by pointer 2026-05-25 14:03:06 -07:00
ena_devlink.h net: ena: Control PHC enable through devlink 2025-06-18 18:57:29 -07:00
ena_eth_com.c net: ena: Add validation for completion descriptors consistency 2024-05-13 14:42:04 -07:00
ena_eth_com.h net: ena: Reduce holes in ena_com structures 2024-05-13 14:42:04 -07:00
ena_eth_io_defs.h
ena_ethtool.c net: ena: convert to use .get_rx_ring_count 2026-01-17 18:10:16 -08:00
ena_netdev.c net: ena: fix MMIO read buffer leak on probe failure 2026-09-24 09:57:55 -07:00
ena_netdev.h net: ena: Add debugfs support to the ENA driver 2025-06-18 18:57:29 -07:00
ena_pci_id_tbl.h
ena_phc.c net: ena: PHC: Check return code before setting timestamp output 2026-05-11 17:22:48 -07:00
ena_phc.h net: ena: Add PHC support in the ENA driver 2025-06-18 18:57:28 -07:00
ena_regs_defs.h net: ena: Add PHC support in the ENA driver 2025-06-18 18:57:28 -07:00
ena_xdp.c net: ena: Set tx_info->xdpf value to NULL 2024-04-11 11:21:02 +02:00
ena_xdp.h net: ena: Always register RX queue info 2024-01-03 18:00:58 -08:00
Makefile net: ena: Add debugfs support to the ENA driver 2025-06-18 18:57:29 -07:00