From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Jeff Xu <jeffxu@chromium.org>, Tomasz Figa <tfiga@chromium.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Andrey Ryabinin" <ryabinin.a.a@gmail.com>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Liam R . Howlett" <liam@infradead.org>,
"Mike Rapoport" <rppt@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Michal Hocko" <mhocko@suse.com>,
"Brendan Jackman" <brendan.jackman@linux.dev>,
"Zi Yan" <ziy@nvidia.com>,
"Alexander Potapenko" <glider@google.com>,
"Andrey Konovalov" <andreyknvl@gmail.com>,
"Dmitry Vyukov" <dvyukov@google.com>,
"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
"Marco Elver" <elver@google.com>,
"Boris Brezillon" <boris.brezillon@collabora.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Chia-I Wu" <olvaffe@gmail.com>, "Dev Jain" <dev.jain@arm.com>,
"Evgenii Stepanov" <eugenis@google.com>,
"Ian Rickards" <ian.rickards@arm.com>,
"Jann Horn" <jannh@google.com>,
"Jeff Vander Stoep" <jeffv@google.com>,
"Jeff Xu" <jeffxu@google.com>, "Kees Cook" <kees@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Peter Collingbourne" <peter@pcc.me.uk>,
"Pierre-Clément Tosi" <ptosi@google.com>,
"Ryan Roberts" <ryan.roberts@arm.com>,
"Will Deacon" <will@kernel.org>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
"Jan Kara" <jack@suse.cz>, "Miklos Szeredi" <miklos@szeredi.hu>,
"Baoquan He" <baoquan.he@linux.dev>,
"Pasha Tatashin" <pasha.tatashin@soleen.com>,
"Pratyush Yadav" <pratyush@kernel.org>,
"Allison Henderson" <achender@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
linux-mm@kvack.org, kasan-dev@googlegroups.com,
linux-arm-kernel@lists.infradead.org,
linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev,
kexec@lists.infradead.org, netdev@vger.kernel.org,
linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com,
linux-kernel@vger.kernel.org,
"Ryan Roberts" <ryan.roberts@arm.com>
Subject: Re: [PATCH v1 0/7] mm: kasan: skip KASAN for GFP_HIGHUSER
Date: Wed, 18 Nov 2026 10:46:24 +0100 [thread overview]
Message-ID: <332f315d-ea27-488a-9a3c-28cdfdcd5f27@kernel.org> (raw)
In-Reply-To: <20261118012858.289236-1-jeffxu@chromium.org>
On 11/18/26 02:28, Jeff Xu wrote:
> On Tue, Nov 17, 2026 at 11:11 PM Tomasz Figa <tfiga@chromium.org> wrote:
>>
>> On Tue, Nov 17, 2026 at 7:10 PM David Hildenbrand (Arm)
>> <david@kernel.org> wrote:
>>>
>>> I really don't want us to spread KASAN-related GFP flags in the kernel.
>>>
>>> There must be a proper way to abstract this.
>>>
>>> Why is GFP_HIGHUSER not sufficient? We were already told that this is memory to
>>> be mapped into user space. Placing data structure on it and handing out pointers
>>> to that would already be a bit questionable.
>>>
>>> So what are the ways to avoid GFP_HIGHUSER_KASAN?
>>
>> I think the idea behind GFP_HIGHUSER_KASAN is to make it possible to
>> skip KASAN for GFP_HIGHUSER by default (for most of its users), but
>> keep it for some of the users which today use GFP_HIGHUSER for their
>> memory allocations, but could benefit from the added security. As per
>> the other patches in the series:
>>
>> pipe, fuse: use GFP_HIGHUSER_KASAN for pipe buffer pages
>> kexec: use GFP_HIGHUSER_KASAN for segment pages
>> net/rds: use GFP_HIGHUSER_KASAN for message pages
>>
>> That said, I'm not familiar with any of the code mentioned by those
>> patches, so I can't really tell how much they would benefit from KASAN
>> or if their choice of GFP_HIGHUSER to begin with is correct.
>
> Thanks David and Tomasz for the feedback.
>
> Tomasz is right about why I added GFP_HIGHUSER_KASAN in v1: out of
> caution, I audited existing GFP_HIGHUSER callers to find any that never
> map the pages to userspace and instead fill/drain them in the kernel via
> kmap_local_page() (pipe, FUSE, kexec, rds). Since this series intends to
> improve KASAN performance while preserving its security aspects, and the
> performance impact on pipe/FUSE/kexec/rds was negligible in my testing,
> v1 was optimized for minimum behavioral change.
>
> Looking closer at both of your questions, I agree that the security
> benefit of keeping those 4 under KASAN is minimal -- e.g., only linear
> overflows out of the pipe/FUSE/kexec/rds page, since none of them store
> kernel structures or pointers. That is the exact same trade-off we
> already make for GFP_HIGHUSER_MOVABLE.
Yes, that's my understanding as well.
>
> To avoid introducing GFP_HIGHUSER_KASAN, I see two options:
>
> 1) Simply keep those 4 cases under GFP_HIGHUSER (drop patches 1-4 and
> 7), reducing the series to just the GFP_HIGHUSER change and its KUnit
> test.
That's what I would look into first.
>
> 2) Switch those 4 callers to GFP_USER. Since CONFIG_KASAN_HW_TAGS is
> 64-bit arm64 only (!CONFIG_HIGHMEM), GFP_USER is identical to today's
> GFP_HIGHUSER on arm64 and all other 64-bit builds (and if 32-bit
> CONFIG_HIGHMEM=y builds still need ZONE_HIGHMEM, that could be gated
> on CONFIG_HIGHMEM, though that feels ugly at call sites).
>
> (1) seems much cleaner to me. David, would (1) work for you?
Agreed, (2) looks more hacky and I don't see the value of doing it like that
just yet.
--
Cheers,
David
prev parent reply other threads:[~2026-11-18 9:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 23:06 [PATCH v1 0/7] mm: kasan: skip KASAN for GFP_HIGHUSER Jeff Xu
2026-11-16 23:06 ` [PATCH v1 1/7] mm: add GFP_HIGHUSER_KASAN Jeff Xu
2026-11-16 23:15 ` sashiko-bot
2026-11-16 23:06 ` [PATCH v1 2/7] pipe, fuse: use GFP_HIGHUSER_KASAN for pipe buffer pages Jeff Xu
2026-11-16 23:15 ` sashiko-bot
2026-11-16 23:06 ` [PATCH v1 3/7] kexec: use GFP_HIGHUSER_KASAN for segment pages Jeff Xu
2026-11-16 23:15 ` sashiko-bot
2026-11-16 23:06 ` [PATCH v1 4/7] net/rds: use GFP_HIGHUSER_KASAN for message pages Jeff Xu
2026-11-16 23:15 ` sashiko-bot
2026-11-16 23:06 ` [PATCH v1 5/7] mm: kasan: skip KASAN for GFP_HIGHUSER Jeff Xu
2026-11-16 23:15 ` sashiko-bot
2026-11-17 10:21 ` Lorenzo Stoakes (ARM)
2026-11-17 12:06 ` David Hildenbrand (Arm)
2026-11-17 12:21 ` Lorenzo Stoakes (ARM)
2026-11-18 1:29 ` Jeff Xu
2026-11-16 23:06 ` [PATCH v1 6/7] mm/kasan/kunit: add page_alloc_skip_kasan test Jeff Xu
2026-11-16 23:15 ` sashiko-bot
2026-11-16 23:06 ` [PATCH v1 7/7] mm/kasan/kunit: add page_alloc_highuser_kasan test Jeff Xu
2026-11-16 23:15 ` sashiko-bot
2026-11-17 10:10 ` [PATCH v1 0/7] mm: kasan: skip KASAN for GFP_HIGHUSER David Hildenbrand (Arm)
2026-11-17 14:11 ` Tomasz Figa
2026-11-18 1:28 ` Jeff Xu
2026-11-18 9:46 ` David Hildenbrand (Arm) [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=332f315d-ea27-488a-9a3c-28cdfdcd5f27@kernel.org \
--to=david@kernel.org \
--cc=achender@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=baoquan.he@linux.dev \
--cc=boris.brezillon@collabora.com \
--cc=brauner@kernel.org \
--cc=brendan.jackman@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=davem@davemloft.net \
--cc=dev.jain@arm.com \
--cc=dvyukov@google.com \
--cc=edumazet@kernel.org \
--cc=elver@google.com \
--cc=eugenis@google.com \
--cc=fuse-devel@lists.linux.dev \
--cc=glider@google.com \
--cc=hannes@cmpxchg.org \
--cc=horms@kernel.org \
--cc=ian.rickards@arm.com \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=jeffv@google.com \
--cc=jeffxu@chromium.org \
--cc=jeffxu@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kees@kernel.org \
--cc=kexec@lists.infradead.org \
--cc=kuba@kernel.org \
--cc=liam@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhocko@suse.com \
--cc=miklos@szeredi.hu \
--cc=netdev@vger.kernel.org \
--cc=olvaffe@gmail.com \
--cc=pabeni@redhat.com \
--cc=pasha.tatashin@soleen.com \
--cc=peter@pcc.me.uk \
--cc=pratyush@kernel.org \
--cc=ptosi@google.com \
--cc=rds-devel@oss.oracle.com \
--cc=rppt@kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=surenb@google.com \
--cc=tfiga@chromium.org \
--cc=vbabka@kernel.org \
--cc=vincenzo.frascino@arm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=will@kernel.org \
--cc=ziy@nvidia.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.