From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B66D6524AE8; Wed, 30 Sep 2026 17:48:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790790481; cv=none; b=T2GlxzuCjqQE6qIp/t0w9U9wdFXaMZe7na+wbGS6B0/rt4Q0Eo2XMHOSbNG38fnaqt7wq65XqdWFbJYQFCswMlMwp7I7Tqk/uGo2EJ6VrWNRnykiNFELTorwbPZ1PFc95Gf8IpKEFDp1cpl45dTN8hMLr7fy6IcdjmMyipOd7U0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790790481; c=relaxed/simple; bh=UfslXHh43kfszb+niZztdRjlWGmKOHIFUyYZHb5U+vE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l9udeB5oExTjFYxVkkjfvSvV/AzoXRc4+8TCBwvFdHMv4S6FFf5Aq1dRC7ZKd9wirBCoB9rUDr4+meuZ0DZEZYt9sHOHrdUMwk6Va1+sxHp/UGLlHMZ7o214vvrxoLAD09/qvv2Ei4i7gy/aoBLHc5I29TjOovRfls0b7nAtfNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XGFHImJf; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XGFHImJf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BD701F000FF; Wed, 30 Sep 2026 17:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790790480; bh=5qaKIHy/AP/xv5Kc/+uonpvUfX4flqiyz/4oQZYwpdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XGFHImJfRLp4SDBho4zzI+DBxqOd3WA7bMpcy1hMJGWtV5rFOlFF0M5PsoVBljdf7 8p6fCuFUYlblc9QfsgP/PPyd+5FRyufFeytO0mVdjygnQ1TnD5l7dlxyohAJNIjagG 7Q7V1ghmWzD6wphSBNZ4UYJyeCnUMjUzO/6l6pEo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 845/877] net: ena: fix MMIO read buffer leak on probe failure Date: Wed, 30 Sep 2026 17:29:16 +0200 Message-ID: <20260930152432.973870035@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152414.738996857@linuxfoundation.org> References: <20260930152414.738996857@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li [ Upstream commit 9476b4468862927297c94c440863cd8ed1e7cc83 ] 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: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Link: https://patch.msgid.link/20260921154202.471662-3-lgs201920130244@gmail.com Signed-off-by: Jakub Kicinski [ Adjusted cleanup context for missing PHC and devlink support. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -4088,6 +4088,7 @@ err_worker_destroy: err_device_destroy: ena_com_delete_host_info(ena_dev); ena_com_admin_destroy(ena_dev); + ena_com_mmio_reg_read_request_destroy(ena_dev); err_metrics_destroy: ena_com_delete_customer_metrics_buffer(ena_dev); err_netdev_destroy: