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 C597C2D0C94 for ; Sun, 1 Mar 2026 01:34:55 +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=1772328895; cv=none; b=rT402Z1lBn0V5m0A09Xx7NOqJe9GUT8O3SfEPCq6tZ2av4SddgfngOsLxsshbqIYCkgxz+LbgzmPaelFTUTsXpSjg4CrQJrATv9J8PfYi8nK2xhDf2ytka06ta/d09AJcSQmnJLrziv1qCjAn8VaFd3A+qQ9BBthVnyqvKX01pQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328895; c=relaxed/simple; bh=WSR8SalTEsYdOf33Ip2DrbYlkL26U9fzs9/kV5U21gk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=rqhOXDo4j6fgU7F2VGxD0qk31y4ERQSZUMfkjgNyxKl0EYAKESZjncY7scG+D2mhYxkh67s0vsF2+chmNXHxjUM9XWGnHeEBvzxl/PElWR9Bnhmh+P8Bbdjcwv/y4BdmgyG0JvVjU24X7ABpMsc9VKDVJbLYZm91ABrcpP62Shg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c59hxGW5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c59hxGW5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADE41C19421; Sun, 1 Mar 2026 01:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772328895; bh=WSR8SalTEsYdOf33Ip2DrbYlkL26U9fzs9/kV5U21gk=; h=From:To:Cc:Subject:Date:From; b=c59hxGW5h/nsnZU3eMHyc+NEJLdYlrxyUxbch9/LOmDSawpDg0CoI/amoQGj5aywN OLMbAQHtyV9nPzJTrtMvys9KhR+HK0Lm5hVhE5j+C7HIkh58IwCnrH3rgN/HJyXQNf l0DhqMGRkp+0ezz4LsIKk4OkywPsTMIQwN+Pxh91VvXFaVPWxfxbFdT5xmfxVRLN4A EUjq5h5Mo0vcvYyDUqOLEKmzdTv+CZ6bRF9Ju9Sv4XjtNFe4U61BWJGzYvrmuPkUlu 8BJhkFcAD35jBuFvwT+SASA3UFo/I9aBjVkFJ6Pq6vQJnpPYNnejxIBVWlupZhb8Vt PR0AwCRUrqf1Q== From: Sasha Levin To: stable@vger.kernel.org, harshit.m.mogalapalli@oracle.com Cc: Paul Webb , Mimi Zohar , Alexander Graf , Ard Biesheuvel , Baoquan He , Borislav Betkov , guoweikang , Henry Willard , "H. Peter Anvin" , Ingo Molnar , Jiri Bohac , Joel Granados , Jonathan McDowell , Mike Rapoport , Sohil Mehta , Sourabh Jain , Thomas Gleinxer , Yifei Liu , Andrew Morton Subject: FAILED: Patch "x86/kexec: add a sanity check on previous kernel's ima kexec buffer" failed to apply to 6.6-stable tree Date: Sat, 28 Feb 2026 20:34:52 -0500 Message-ID: <20260301013452.1694468-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Type: text/plain; charset=UTF-8 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 . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From c5489d04337b47e93c0623e8145fcba3f5739efd Mon Sep 17 00:00:00 2001 From: Harshit Mogalapalli Date: Tue, 30 Dec 2025 22:16:09 -0800 Subject: [PATCH] x86/kexec: add a sanity check on previous kernel's ima kexec buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the second-stage kernel is booted via kexec with a limiting command line such as "mem=", the physical range that contains the carried over IMA measurement list may fall outside the truncated RAM leading to a kernel panic. BUG: unable to handle page fault for address: ffff97793ff47000 RIP: ima_restore_measurement_list+0xdc/0x45a #PF: error_code(0x0000) – not-present page Other architectures already validate the range with page_is_ram(), as done in commit cbf9c4b9617b ("of: check previous kernel's ima-kexec-buffer against memory bounds") do a similar check on x86. Without carrying the measurement list across kexec, the attestation would fail. Link: https://lkml.kernel.org/r/20251231061609.907170-4-harshit.m.mogalapalli@oracle.com Signed-off-by: Harshit Mogalapalli Fixes: b69a2afd5afc ("x86/kexec: Carry forward IMA measurement log on kexec") Reported-by: Paul Webb Reviewed-by: Mimi Zohar Cc: Alexander Graf Cc: Ard Biesheuvel Cc: Baoquan He Cc: Borislav Betkov Cc: guoweikang Cc: Henry Willard Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jiri Bohac Cc: Joel Granados Cc: Jonathan McDowell Cc: Mike Rapoport Cc: Sohil Mehta Cc: Sourabh Jain Cc: Thomas Gleinxer Cc: Yifei Liu Cc: Signed-off-by: Andrew Morton --- arch/x86/kernel/setup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 1b2edd07a3e17..383d4a4784f5b 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -439,9 +439,15 @@ int __init ima_free_kexec_buffer(void) int __init ima_get_kexec_buffer(void **addr, size_t *size) { + int ret; + if (!ima_kexec_buffer_size) return -ENOENT; + ret = ima_validate_range(ima_kexec_buffer_phys, ima_kexec_buffer_size); + if (ret) + return ret; + *addr = __va(ima_kexec_buffer_phys); *size = ima_kexec_buffer_size; -- 2.51.0