Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Austin <austin.schlegel@arthrex.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH 1/2] serial: tegra: fix RX DMA descriptor use-after-free
Date: Fri, 02 Oct 2026 09:13:14 +0000	[thread overview]
Message-ID: <20261002091314.BC2551F00893@smtp.kernel.org> (raw)
In-Reply-To: <20261001-tty-linus-v1-1-ecb8576c802d@arthrex.com>

> From: Austin <austin.schlegel@arthrex.com>
> 
> tegra_uart_terminate_rx_dma() calls dmaengine_terminate_all() and then
> tegra_uart_rx_buffer_push(), which calls async_tx_ack(tup->rx_dma_desc)
> on the just-terminated descriptor. With the GPC DMA driver,
> dmaengine_terminate_all() frees the active descriptor immediately, so
> the subsequent async_tx_ack() touches freed memory. dmaengine clients
> are not allowed to touch a descriptor once it has been terminated.
> 
> The same freed-descriptor access happens via tegra_uart_rx_dma_complete(),
> which also reaches tegra_uart_rx_buffer_push() after RX has stopped.
> 
> Move the ack into the two call sites that still own a live descriptor:
> tegra_uart_rx_dma_complete() (before the completion callback hands the
> descriptor back) and tegra_uart_terminate_rx_dma() (before terminating),
> [ ... ]
> KFENCE reports, tx/rx byte counts in /proc/tty/driver/tegra_hsuart
> remained equal throughout with no framing or break errors.
> 
> Fixes: b31245b94207 ("serial: tegra: ack the rx dma desc after transfer terminated")
> Signed-off-by: Austin <austin.schlegel@arthrex.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261001-tty-linus-v1-0-ecb8576c802d@arthrex.com?part=1


  parent reply	other threads:[~2026-10-02  9:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 19:04 [PATCH 0/2] serial: tegra: fix RX/TX DMA descriptor use-after-free Austin via B4 Relay
2026-10-01 19:04 ` [PATCH 1/2] serial: tegra: fix RX " Austin via B4 Relay
2026-10-02  4:06   ` Austin Schlegel
2026-10-02  5:53     ` Greg Kroah-Hartman
2026-10-02  9:13   ` sashiko-bot [this message]
2026-10-01 19:04 ` [PATCH 2/2] serial: tegra: fix TX " Austin via B4 Relay
2026-10-02  4:07   ` Austin Schlegel
2026-10-02  9:13   ` sashiko-bot
2026-10-02  4:06 ` [PATCH 0/2] serial: tegra: fix RX/TX " Austin Schlegel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261002091314.BC2551F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=austin.schlegel@arthrex.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox