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 AB5A22561A2; Thu, 17 Sep 2026 15:54:45 +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=1789660486; cv=none; b=GjH2skZW5yw98P/7AOattNFdPkcFEiOxpW+Mf8zgY73ZaKg6FyjEeOB8pAVTdrdRLGec7fLqnKCHijnm/rlkaXNHdxzgaV8x3w1uHq7dDXPQgOpw7VLeoPwrFAt7+Uuvwa5N/Rvj0oBI/tG5pf9g8VdID103W31lVuniY1BQ37w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789660486; c=relaxed/simple; bh=7kbAlvNzNOsbfa1s3OqTycDypoGynnRB/+S4A8866Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dUj8mv1kogRBl4udyUWbDv1X2BTm7AxC1umAKib0En6hkpzYQ6O/bFfyWyChieuv5B6nb8M896ilhBhbhg3vgcTdOLycNT8wiSEi9jR3OgrD1qtcJab0jZ0u3G1IvAToLD26GEd9T+6dYmx+vhCzwXIS8DiUEjGGuqrrawxYD+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OPIOZMz/; 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="OPIOZMz/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD4E51F000FF; Thu, 17 Sep 2026 15:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789660485; bh=R8uRzHtu/da5N4rUusjXyL1xqDpGs4NlM94bBnZJvL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OPIOZMz/QIzpb5i0niLJmS6fw7v0Yo2Vp/laCizEFlo7AA73uvGmaX3UbXPjI1OiO nHE77gvdCE6K6/K72L2rm4gXsDPDsXNbIdGVWaAg6zMQFqUPvA2eDWDBw40H1SVVPq N4KeNkAxebDcCOWIdlydmRoqKTIJVxif+i0SeAl4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Joe Damato , Paolo Abeni Subject: [PATCH 7.2 607/733] bnxt_en: Handle buffer allocation failure in bnxt_rx_ring_reset() Date: Thu, 17 Sep 2026 16:15:15 +0100 Message-ID: <20260917151407.611786423@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151350.597953846@linuxfoundation.org> References: <20260917151350.597953846@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joe Damato commit 961e2a17c5e3559b3f8654d2daabdd25a42e770a upstream. bnxt_rx_ring_reset() frees the ring buffers and then reallocates them, ignoring the result. bnxt_alloc_one_rx_ring() can fail in bnxt_alloc_one_tpa_info_data(), which returns -ENOMEM on the first failed allocation and leaves the remaining rxr->rx_tpa[] entries zeroed. The error isn't propagated up, so the loop in bnxt_rx_ring_reset continues and at the end the code re-enables TPA with partially unallocated rx_tpa array. This means that when the agg_id from hardware is mapped to a SW index in rxr->rx_tpa[], an uninitialized slot can be chosen which would hand a zero DMA address to the device. Fix this by falling back to a global reset, which is what the existing code already does when other functions fail, but unlike the other failure cases this particular failure has to return because TPA can't be re-enabled since the allocation failed. Fixes: 8fbf58e17dce ("bnxt_en: Implement RX ring reset in response to buffer errors.") Reported-by: Sashiko Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260828190900.1767611-1-joe%40dama.to Cc: stable@vger.kernel.org Signed-off-by: Joe Damato Link: https://patch.msgid.link/20260902015652.2421609-5-joe@dama.to Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -14564,7 +14564,14 @@ static void bnxt_rx_ring_reset(struct bn rxr->rx_sw_agg_prod = 0; rxr->rx_next_cons = 0; rxr->bnapi->in_reset = false; - bnxt_alloc_one_rx_ring(bp, i); + rc = bnxt_alloc_one_rx_ring(bp, i); + if (rc) { + netdev_warn(bp->dev, "RX ring reset failed to allocate buffers, rc = %d, falling back to global reset\n", + rc); + bnxt_reset_task(bp, true); + bnxt_rtnl_unlock_sp(bp); + return; + } cpr = &rxr->bnapi->cp_ring; cpr->sw_stats->rx.rx_resets++; if (bp->flags & BNXT_FLAG_AGG_RINGS)