From: sashiko-bot@kernel.org
To: "Alexander Gordeev" <agordeev@linux.ibm.com>
Cc: "Heiko Carstens" <hca@linux.ibm.com>,
linux-s390@vger.kernel.org,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>
Subject: Re: [PATCH v7 3/4] mm/kasan: Introduce helpers for lazy MMU mode sanitizer
Date: Mon, 17 Aug 2026 11:43:07 +0000 [thread overview]
Message-ID: <20260817114308.1C8061F000E9@smtp.kernel.org> (raw)
In-Reply-To: <52c9be0cf71a8896a5d76c148c38fb24a2005dd9.1786956464.git.agordeev@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Using KASAN to catch direct PTE accesses during per-CPU lazy MMU mode will cause false positive BUG reports on valid concurrent accesses from other CPUs.
--
--- Patch [3]: [PATCH v7 3/4] mm/kasan: Introduce helpers for lazy MMU mode sanitizer ---
commit 934c56df440d17dce73b955e4a04d2ffc114ef49
Author: Alexander Gordeev <agordeev@linux.ibm.com>
mm/kasan: Introduce helpers for lazy MMU mode sanitizer
This commit introduces helpers to allow architectures to use KASAN to catch
illegitimate direct PTE accesses while lazy MMU mode is enabled.
> diff --git a/mm/kasan/common.c b/mm/kasan/common.c
> index b7d05c2a6d93d..94d1060949891 100644
> --- a/mm/kasan/common.c
> +++ b/mm/kasan/common.c
[ ... ]
> @@ -163,6 +163,20 @@ void __kasan_poison_slab(struct slab *slab)
> KASAN_SLAB_REDZONE, false);
> }
>
> +void __kasan_poison_pte(pte_t *pte, int nr)
> +{
> + if (IS_ALIGNED(sizeof(*pte), KASAN_GRANULE_SIZE))
> + kasan_poison(pte, sizeof(*pte) * nr, KASAN_LAZY_MMU_PTE, false);
> +}
[Severity: Medium]
If this helper poisons the PTE in the global KASAN shadow memory, will it
cause false positive KASAN splats for valid concurrent lockless readers?
For example, if another CPU performs a lockless page table walk like
GUP-fast and executes ptep_get(), the instrumented READ_ONCE(*ptep) would
trigger a lazy-mmu-pte-access report because the shadow memory was poisoned
by the per-CPU lazy MMU mode.
Does this API design conflict with shared page tables?
> +EXPORT_SYMBOL_GPL(__kasan_poison_pte);
> +
> +void __kasan_unpoison_pte(pte_t *pte, int nr)
> +{
> + if (IS_ALIGNED(sizeof(*pte), KASAN_GRANULE_SIZE))
> + kasan_unpoison(pte, sizeof(*pte) * nr, false);
> +}
> +EXPORT_SYMBOL_GPL(__kasan_unpoison_pte);
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1786956464.git.agordeev@linux.ibm.com?part=3
next prev parent reply other threads:[~2026-08-17 11:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 11:32 [PATCH v7 0/4] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev
2026-08-17 11:32 ` [PATCH v7 1/4] mm: Make lazy MMU mode context-aware Alexander Gordeev
2026-08-17 11:49 ` sashiko-bot
2026-08-17 11:33 ` [PATCH v7 2/4] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev
2026-08-17 11:48 ` sashiko-bot
2026-08-17 11:33 ` [PATCH v7 3/4] mm/kasan: Introduce helpers for lazy MMU mode sanitizer Alexander Gordeev
2026-08-17 11:43 ` sashiko-bot [this message]
2026-08-17 11:33 ` [PATCH v7 4/4] s390/mm: Lazy " Alexander Gordeev
2026-08-17 11:40 ` sashiko-bot
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=20260817114308.1C8061F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@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 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.