From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ti_am335x_adc: Fix potential use-after-free on DMA unbind
Date: Thu, 19 Nov 2026 09:01:22 +0200 [thread overview]
Message-ID: <av6ewi7KaAHG3aQv@ashevche-desk.local> (raw)
In-Reply-To: <20261118-324f82bd41-iio-adc-0@mail.sdu.edu.cn>
On Wed, Nov 18, 2026 at 10:27:02PM +0800, Guangshuo Li wrote:
> A channel reference does not keep the DMA provider bound. If the EDMA
> provider is unbound first, ADC removal accesses the freed channel when
> freeing its DMA buffer and releasing the channel.
>
> Link the ADC platform device to the provider so the ADC is removed first,
> including when firmware device links are disabled. The driver core drops
> the link on probe failure or ADC removal.
>
> This issue was found by our static analysis tool under development.
...
> + if (!device_link_add(&pdev->dev, dma->chan->device->dev,
Now we need to use helpers to access DMA devices. For backport you will need
another patch. See dmaengine_get_provider_device().
> + DL_FLAG_AUTOREMOVE_CONSUMER))
> + goto err;
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-11-19 7:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 14:27 Guangshuo Li
2026-11-19 7:01 ` Andy Shevchenko [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=av6ewi7KaAHG3aQv@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=liguangshuo@mail.sdu.edu.cn \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®