From: Takashi Iwai <tiwai@suse.de>
To: "Cássio Gabriel" <cassiogabrielcontato@gmail.com>
Cc: Takashi Iwai <tiwai@suse.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mark Brown <broonie@kernel.org>,
Wesley Cheng <quic_wcheng@quicinc.com>,
Arnd Bergmann <arnd@arndb.de>, Jaroslav Kysela <perex@perex.cz>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH RESEND] ALSA: usb-audio: qcom: Check offload mapping failures
Date: Fri, 15 May 2026 08:52:15 +0200 [thread overview]
Message-ID: <87ecjdupuo.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260511-alsa-usb-qcom-offload-map-errors-v1-1-6502695e58bc@gmail.com>
On Mon, 11 May 2026 06:36:37 +0200,
Cássio Gabriel wrote:
>
> uaudio_transfer_buffer_setup() calls dma_get_sgtable() and then passes
> the sg_table to uaudio_iommu_map_xfer_buf() without checking whether sg
> table construction succeeded. If dma_get_sgtable() fails, the sg_table
> contents are not valid.
>
> uaudio_iommu_map_pa() also ignores iommu_map() failures for the event and
> transfer rings and still returns the allocated IOVA to the QMI response.
> That can expose an unmapped IOVA to the audio DSP. For transfer rings,
> the failed mapping also leaves the IOVA allocator state marked in use.
>
> Check both operations. Free the coherent transfer buffer when sg table
> construction fails, free the sg table when transfer-buffer IOMMU mapping
> fails, and release the transfer-ring IOVA if iommu_map() fails. Also
> return the existing event-ring IOVA when the event ring is already mapped,
> matching the pre-split helper behavior.
>
> Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
> Fixes: 44499ecb4f28 ("ALSA: usb: qcom: Fix false-positive address space check")
> Cc: stable@vger.kernel.org
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Applied now. Thanks.
Takashi
prev parent reply other threads:[~2026-05-15 6:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 4:36 [PATCH RESEND] ALSA: usb-audio: qcom: Check offload mapping failures Cássio Gabriel
2026-05-15 6:52 ` Takashi Iwai [this message]
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=87ecjdupuo.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=cassiogabrielcontato@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=quic_wcheng@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.