From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABADE3EFD36 for ; Tue, 20 Jan 2026 13:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768914452; cv=none; b=RY+AZNIJSF+ozXZ5oMmbG5M/sOXqYOzOzV7A+Hmsj27yA3x9aGQ2r9J1ZnqNH7WkrHAedOxJ8LX+6ZBYZYg/WRIxQjAdJ2jitxbCTCvjmzL4skcN+D534qOHHI11HA9ZxJgyAQzV17s5FSVdXMVSg4y05vTLcAg2pNYz3pZ43yE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768914452; c=relaxed/simple; bh=pvez2tRDOLgvQy1EQXy3RidUy7ayJ3eAIz3ynpb3RLE=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=qaEJebllkI9dxnTVNKGxtY+McE3fzBsNFI0wW4E56hrvjii/FywYF7vehdt3Dm7aD1/KAV7fRmXxco01Xs+1pjzagWRkTjkfBXFf94wH/9HRROc5X+/TTkeyOonByjo6zgLCWUDlf9O9T1+Nw3e/ckjzfD9fSTcwYEJ1kjOFupI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v/+qGfJ3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="v/+qGfJ3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20C66C16AAE; Tue, 20 Jan 2026 13:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768914452; bh=pvez2tRDOLgvQy1EQXy3RidUy7ayJ3eAIz3ynpb3RLE=; h=Subject:To:Cc:From:Date:From; b=v/+qGfJ3/B472bahWl182pPg3nC2qcXlSGrP7E++pKf19KY35S5Uewpt+30VCVh8i erTvztIA5c8uW6eflvRkyAauW2Vyjq9MfPSI6AWzXXJLU/ERCFJiWcFIbIWDq59M8B VWRCvmIiaoWlbGJwUUxatPepOAFDmayYEDNPLBwU= Subject: FAILED: patch "[PATCH] mm: kmsan: fix poisoning of high-order non-compound pages" failed to apply to 6.6-stable tree To: ryan.roberts@arm.com,akpm@linux-foundation.org,dvyukov@google.com,elver@google.com,glider@google.com,stable@vger.kernel.org Cc: From: Date: Tue, 20 Jan 2026 14:07:26 +0100 Message-ID: <2026012026-rotunda-turtle-6de0@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 4795d205d78690a46b60164f44b8bb7b3e800865 # git commit -s git send-email --to '' --in-reply-to '2026012026-rotunda-turtle-6de0@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 4795d205d78690a46b60164f44b8bb7b3e800865 Mon Sep 17 00:00:00 2001 From: Ryan Roberts Date: Sun, 4 Jan 2026 13:43:47 +0000 Subject: [PATCH] mm: kmsan: fix poisoning of high-order non-compound pages kmsan_free_page() is called by the page allocator's free_pages_prepare() during page freeing. Its job is to poison all the memory covered by the page. It can be called with an order-0 page, a compound high-order page or a non-compound high-order page. But page_size() only works for order-0 and compound pages. For a non-compound high-order page it will incorrectly return PAGE_SIZE. The implication is that the tail pages of a high-order non-compound page do not get poisoned at free, so any invalid access while they are free could go unnoticed. It looks like the pages will be poisoned again at allocation time, so that would bookend the window. Fix this by using the order parameter to calculate the size. Link: https://lkml.kernel.org/r/20260104134348.3544298-1-ryan.roberts@arm.com Fixes: b073d7f8aee4 ("mm: kmsan: maintain KMSAN metadata for page operations") Signed-off-by: Ryan Roberts Reviewed-by: Alexander Potapenko Tested-by: Alexander Potapenko Cc: Dmitriy Vyukov Cc: Dmitry Vyukov Cc: Marco Elver Cc: Ryan Roberts Cc: Signed-off-by: Andrew Morton diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c index e7f554a31bb4..9e1c5f2b7a41 100644 --- a/mm/kmsan/shadow.c +++ b/mm/kmsan/shadow.c @@ -207,7 +207,7 @@ void kmsan_free_page(struct page *page, unsigned int order) if (!kmsan_enabled || kmsan_in_runtime()) return; kmsan_enter_runtime(); - kmsan_internal_poison_memory(page_address(page), page_size(page), + kmsan_internal_poison_memory(page_address(page), PAGE_SIZE << order, GFP_KERNEL & ~(__GFP_RECLAIM), KMSAN_POISON_CHECK | KMSAN_POISON_FREE); kmsan_leave_runtime();