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 19B7033E345; Wed, 30 Sep 2026 16:33: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=1790786026; cv=none; b=rWGjK2NgvXDB4byLk4QcjAvX2KF9Tqq/JAPu5GLv7p+l72kXNMAM+UHyklPU2ZOQQiasuKuQ22QmteGoS/koJ0M995RM0HnIL+Khqy/my0K31ZassJTqDxHPHqobncI3a+AROWinjpcAxu/RL+x/qkjtxqqvoA1VNZy+WcGj2Qo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790786026; c=relaxed/simple; bh=u1Kfduom18bYbLwHbiIYpfHQoiTO2gCEDk4p39xrrJI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=owBfWUiC85BbhxWKggoCP2JSwjUcGyz+UQnYaOcSuvVIJcbsRAx7KZTXmVvHLOFBm6lZ72QHHEa2QkCYgaRktPUljpEi4qHsiTs13gVEoTv0Dt870Res0Mm9weK2LrF0n+2DtO6/N+bctae0//DN46g0/CDv3LUuoZek3hXB7Ao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JTCMDkoK; 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="JTCMDkoK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 765261F000FF; Wed, 30 Sep 2026 16:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790786025; bh=Vuk5III+4+F80DeNYY1LpMmSw5DIFjNCM++R7Ic4i/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JTCMDkoK6M+3NM6pKl+cTV0sAUHsrYnCSOpRXtluYxbGTHVOGAPLblbJ5WL2auL3p 3bd6vtFzzEk6NBPkk2ib/kFG3nyPI9ljFOHd4ig/6n6/K9vdQJub1wh/meQsIO1gjs IpUbaIcIueVgW6kgRHX8UhBMFQdOsW07872RHI08= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pavel Zhigulin , Alexander Chesnokov , Frank Li , Vinod Koul Subject: [PATCH 6.1 715/982] dmaengine: ti: k3-udma-glue: fix NULL dereference in k3_udma_glue_release_rx_chn() Date: Wed, 30 Sep 2026 17:24:11 +0200 Message-ID: <20260930152432.112498758@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexander Chesnokov commit 0294b6dd515256c03ea2dbf508ddd3826d788579 upstream. If devm_kcalloc() for rx_chn->flows fails in a channel request function, the error path calls k3_udma_glue_release_rx_chn(), which dereferences the NULL rx_chn->flows pointer in k3_udma_glue_release_rx_flow(). Skip the flow release loop in k3_udma_glue_release_rx_chn() when rx_chn->flows is not allocated. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d70241913413 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine users") Cc: stable@vger.kernel.org Reported-by: Pavel Zhigulin Signed-off-by: Alexander Chesnokov Reviewed-by: Frank Li Link: https://patch.msgid.link/20260812053426.3521589-1-Alexander.Chesnokov@kaspersky.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/ti/k3-udma-glue.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/dma/ti/k3-udma-glue.c +++ b/drivers/dma/ti/k3-udma-glue.c @@ -1103,8 +1103,9 @@ void k3_udma_glue_release_rx_chn(struct rx_chn->psil_paired = false; } - for (i = 0; i < rx_chn->flow_num; i++) - k3_udma_glue_release_rx_flow(rx_chn, i); + if (rx_chn->flows) + for (i = 0; i < rx_chn->flow_num; i++) + k3_udma_glue_release_rx_flow(rx_chn, i); if (xudma_rflow_is_gp(rx_chn->common.udmax, rx_chn->flow_id_base)) xudma_free_gp_rflow_range(rx_chn->common.udmax,