[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251008203111.e6ce309e9f937652856d9aa5@linux-foundation.org>
Date: Wed, 8 Oct 2025 20:31:11 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Aleksei Nikiforov <aleksei.nikiforov@...ux.ibm.com>
Cc: Alexander Potapenko <glider@...gle.com>, Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org, Ilya Leoshkevich
<iii@...ux.ibm.com>
Subject: Re: [PATCH] mm/kmsan: Fix kmsan kmalloc hook when no stack depots
are allocated yet
On Tue, 30 Sep 2025 13:56:01 +0200 Aleksei Nikiforov <aleksei.nikiforov@...ux.ibm.com> wrote:
> If no stack depot is allocated yet,
> due to masking out __GFP_RECLAIM flags
> kmsan called from kmalloc cannot allocate stack depot.
> kmsan fails to record origin and report issues.
>
> Reusing flags from kmalloc without modifying them should be safe for kmsan.
> For example, such chain of calls is possible:
> test_uninit_kmalloc -> kmalloc -> __kmalloc_cache_noprof ->
> slab_alloc_node -> slab_post_alloc_hook ->
> kmsan_slab_alloc -> kmsan_internal_poison_memory.
>
> Only when it is called in a context without flags present
> should __GFP_RECLAIM flags be masked.
>
> With this change all kmsan tests start working reliably.
I'm not seeing reports of "hey, kmsan is broken", so I assume this
failure only occurs under special circumstances?
Please explain how you're triggering this failure and whether you think
we should backport the fix into -stable kernels and if so, are you able
to identify a suitable Fixes: target?
Thanks.
Powered by blists - more mailing lists