From: Christoph Hellwig <hch@lst.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
kasan-dev@googlegroups.com, iommu@lists.linux.dev,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Alexander Potapenko <glider@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
Marco Elver <elver@google.com>, Kees Cook <keescook@chromium.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>
Subject: Re: Using KASAN to catch streaming DMA API violations
Date: Thu, 12 Dec 2024 06:40:14 +0100 [thread overview]
Message-ID: <20241212054014.GA4695@lst.de> (raw)
In-Reply-To: <360e2ec9-556e-4507-a539-f86f7619fe29@app.fastmail.com>
On Fri, Dec 06, 2024 at 09:14:27AM +0100, Arnd Bergmann wrote:
> Right. I would go even further and say that transferring ownership
> to the device poisons an area that is aligned to ARCH_DMA_MINALIGN,
> making it possibly bigger on both ends of the area. Transferring
> ownership back to the CPU only unpoisons the exact area that was
> specified, leaving the unaligned bytes around it as uninitialized.
Yes.
> That may need to be controlled by an additional Kconfig option on
> top of poisoning the data initially.
Note that we'll definitively need a config option for the basic
checks as well. There is plenty o drivers that don't do any DMA
ownership management right now. And while I'd like to see everything
fixed it's going to take a while to get there.
prev parent reply other threads:[~2024-12-12 5:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 14:54 Using KASAN to catch streaming DMA API violations Ahmad Fatoum
2024-12-06 7:06 ` Dmitry Vyukov
2024-12-06 8:09 ` Ahmad Fatoum
2024-12-06 8:14 ` Arnd Bergmann
2024-12-12 5:40 ` Christoph Hellwig [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=20241212054014.GA4695@lst.de \
--to=hch@lst.de \
--cc=a.fatoum@pengutronix.de \
--cc=andreyknvl@gmail.com \
--cc=arnd@arndb.de \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=iommu@lists.linux.dev \
--cc=kasan-dev@googlegroups.com \
--cc=keescook@chromium.org \
--cc=kernel@pengutronix.de \
--cc=m.szyprowski@samsung.com \
--cc=paulmck@kernel.org \
--cc=robin.murphy@arm.com \
--cc=ryabinin.a.a@gmail.com \
--cc=vincenzo.frascino@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox