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 A63B9531630; Wed, 23 Sep 2026 14:26:19 +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=1790173580; cv=none; b=RJXYdDt7eAkueBp5h4q0rok6050KcqcdOusKU7DW5Qg+mW8jf6wcZX82mw9828ACtWdZFSaE1LfVdLH74+eRE11OLEo4+YXy8+zWsz3jkyVV9BoODGloLtnYe5S40keH968YYoHW5FREXnCaFCCgxzfk9sJEKmXSNikTqCfzagY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173580; c=relaxed/simple; bh=0pYvdAmKjsks5bf1wi7oX7ZqvZdJIWAxjSPQlQzqhxg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JkfPRNmE7k/EZOY5qVc+/hUR1HkZ2k9OQJkA9QXWL25MYklVbshCo96To1ZXzNa+SmHIiBm1T6YeTp7UEgKOJKO/5vVattBTxdgFMumD/tJZLfk0/2S7SsZuXdelUrIhRYrpOdb5np/eGK4BX3Lj9ArZl5YsP1tRt/bSpMN5cU0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AI0kDy9c; 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="AI0kDy9c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B281F00898; Wed, 23 Sep 2026 14:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790173579; bh=jR4HnHRAgzyqamw1XtZL/eV0YDrjYDb+MT1yijwK7zI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AI0kDy9c7R2W1FMgE70CCR4l4wIg7EwyigDwP9WknNUrmbkM9WBAn1HxcXRdC7gcQ 5oX71QJZIdrQPuM31MqSdW8dfgEZSnu49aeNuoM3FdxwhEmwNdnfL/Yk+zfhHqdjIy JRg+6vaG98bbt0Oh2T0+h7ZfbzCAo4+HcHJpBLu8= 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 7.2 290/438] dmaengine: ti: k3-udma-glue: fix NULL dereference in k3_udma_glue_release_rx_chn() Date: Wed, 23 Sep 2026 16:05:11 +0200 Message-ID: <20260923140652.291951621@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140644.756254324@linuxfoundation.org> References: <20260923140644.756254324@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: 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 @@ -1243,8 +1243,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,