Re: [PATCH v2] mm, KMSAN: Add missing shadow memory initialization in special allocation paths

From: Andrew Morton

Date: Fri Apr 24 2026 - 13:06:59 EST


On Mon, 13 Apr 2026 10:12:40 +0800 Ke Zhao <ke.zhao.kernel@xxxxxxxxx> wrote:

> Some page allocation paths that call post_alloc_hook() but skip
> kmsan_alloc_page(), leaving stale KMSAN shadow on allocated pages.
> Although there is no reproducer for this issue, this patch should
> be able to fix it by explicitly calling kmsan_alloc_page()
> after they successfully get new pages.
>

Please refresh, retest and resend this.

When doing so, please cc the people who commented on the v1 patch
(Vlastimil, Usama).

Please also cc the KMSAN developers, as listed in the MAINTAINERS file.

Thanks.