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 46DAF1DA62E; Sat, 12 Sep 2026 11:38:42 +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=1789213123; cv=none; b=t9mopc90bT89S8DY7IirqDc9nlB7uPkISVA3m15cXFmCfQfXzLHklFz6NmIIZw3R6mL3WTXuy7HklCXVwRHW4ujpJW2Jy2UbCz0mWDldfpk/HGaZ5v2XuSEYY3BeBAFGvaQ2bJeOGn6SMUrCxEOvMjuhmPJS8V2N6T8FlrvTWpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789213123; c=relaxed/simple; bh=C4I+/e/pYRI+2IlKtyDEbRbqow4+a4pAJrVL2oeG9SY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fhi8GjASc3oo2ku3BP/D0ypret5JIpaincbK6QGH1dDPrzEJcLY+mhusYSxmK2yLrXwskeVYNZ5UkVVjkqcxdNqMMDO1TwJdxbxCEZ3x7zxAc+N4epjc5fYCDuTwPhXoybfklVR7tYYl2u5JvTU7pod4M/G6yOK7qk9eufS9zG4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iFDtERmy; 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="iFDtERmy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF1A11F000FF; Sat, 12 Sep 2026 11:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789213121; bh=SGqlW1S0hW5iy1mAf7emvVAaAQ9JL9GuBcf5B3Ccucg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iFDtERmyVrDr1vAwtfEHdPwatGbmDBfi5CJxWxbDXTmq9RBrPyHMVxmCuQ/gWiukd RdfUBfmi41OLZ8LdII/4HEOsp9tB0ztt9Fv8jAGGf/3QHyjENzVXZQPZ9OAxG5i0Hn qr58FSlxA+u+WZCdM8AeEDl+EKt1UEz19rOum2qU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Steven Rostedt , Martin Kaiser , Frank Li , Vinod Koul Subject: [PATCH 6.12 0058/1376] dmaengine: fsl-edma: tracing: no ptr dereference during log output Date: Sat, 12 Sep 2026 08:41:24 +0200 Message-ID: <20260912065608.851605480@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@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: Martin Kaiser commit 2ea04dca8e627f722caa7a2037cfbae0257f3501 upstream. The fsl edma events store a pointer to a struct fsl_edma_engine in the ringbuffer and dereference it when a log entry is printed. At this time, the pointer may no longer be valid. Event injection can be used to trigger a crash: $ cd /sys/kernel/tracing $ echo 'value = 0' > events/fsl_edma/edma_writeb/inject $ cat trace The log output needs only edma->membase. Add a membase field at the end of the event and use the new field for log output. Keep the existing fields for backward compatibility. Fixes: 11102d0c343b ("dmaengine: fsl-edma: add trace event support") Cc: stable@vger.kernel.org Reviewed-by: Steven Rostedt Signed-off-by: Martin Kaiser Reviewed-by: Frank Li Link: https://patch.msgid.link/20260718130024.341243-1-martin@kaiser.cx Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/fsl-edma-trace.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-trace.h b/drivers/dma/fsl-edma-trace.h index d3541301a247..45d964a3726d 100644 --- a/drivers/dma/fsl-edma-trace.h +++ b/drivers/dma/fsl-edma-trace.h @@ -19,14 +19,16 @@ DECLARE_EVENT_CLASS(edma_log_io, __field(struct fsl_edma_engine *, edma) __field(void __iomem *, addr) __field(u32, value) + __field(void __iomem *, membase) ), TP_fast_assign( __entry->edma = edma; __entry->addr = addr; __entry->value = value; + __entry->membase = edma->membase; ), TP_printk("offset %08x: value %08x", - (u32)(__entry->addr - __entry->edma->membase), __entry->value) + (u32)(__entry->addr - __entry->membase), __entry->value) ); DEFINE_EVENT(edma_log_io, edma_readl, -- 2.55.0