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 8C990C8F0; Sun, 1 Mar 2026 01:23:54 +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=1772328234; cv=none; b=m1l+BmI/+Y1EBuqPMC6E2F6j9p6xDCiRkLoNk39oBpQ1eDD68AKuAywiguqEOKqv5IRoYQjpe7t5qR7Q6bjObXHzcuYhcEROsxdvpN1+mmnb+SCmSvq+erAXTg5zOc2MEgTKwfS0H5V8X6qqMj9aBtFZLZ96WxtUDypOjE8WuiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328234; c=relaxed/simple; bh=R4ptpfdAijGMgEiEHvKLu0G3oD0M/Qt17XUcKVW0nFI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dtfuhQidSU3iL2qYM8mUTU/CfzECXYcRnH5GAMQXc19e+heZIVt9iPufDcQ0aYImTwK6lkw1w0w3+QHG7Hxk9gy+My1uqppqGVHLBpjjlN6Z/lDmy0FSeiwPdTkisGRWVBFL8h3uftYFXrNDEifycvCjCsaDKloqnZidEOyEIe8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DZvn9xb2; 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="DZvn9xb2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69256C19421; Sun, 1 Mar 2026 01:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772328234; bh=R4ptpfdAijGMgEiEHvKLu0G3oD0M/Qt17XUcKVW0nFI=; h=From:To:Cc:Subject:Date:From; b=DZvn9xb2OV56fi7Aj7U5dgDB9RJb/RruvpwtoTugnW2UI35P01K64iN1WtBDkD8WF TdK8Hwjr+xkDs3Xu8GjgVgbholQt0bYjam7bcrFbdp8uW+HzR5GqZtS1nLRPbqejTQ OPtuwgQUAgCZK90lM5I+JCB9IeuieuxwpvxpKgaVp7YDFQUeasv35nkAd6ml2LkB66 rLMnDbg6AXoawrqwwFrwAvs9d16cNkEjQTb7XmyG0IKUIl0yLfJSe12DUGfoaZGkpC foTvKS8gqdZ9YddQeREKw/XzzRzLcO7/iZA+BkcMXYjoaLHah6ltIb/FkNCy46K9IA TJ1MNeWhNzd4g== From: Sasha Levin To: stable@vger.kernel.org, harshit.m.mogalapalli@oracle.com Cc: 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 , Paul Webb , Sohil Mehta , Sourabh Jain , Thomas Gleinxer , Yifei Liu , Andrew Morton , devicetree@vger.kernel.org Subject: FAILED: Patch "of/kexec: refactor ima_get_kexec_buffer() to use ima_validate_range()" failed to apply to 6.12-stable tree Date: Sat, 28 Feb 2026 20:23:50 -0500 Message-ID: <20260301012351.1680624-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-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 4d02233235ed0450de9c10fcdcf3484e3c9401ce Mon Sep 17 00:00:00 2001 From: Harshit Mogalapalli Date: Tue, 30 Dec 2025 22:16:08 -0800 Subject: [PATCH] of/kexec: refactor ima_get_kexec_buffer() to use ima_validate_range() Refactor the OF/DT ima_get_kexec_buffer() to use a generic helper to validate the address range. No functional change intended. Link: https://lkml.kernel.org/r/20251231061609.907170-3-harshit.m.mogalapalli@oracle.com Signed-off-by: Harshit Mogalapalli 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: Paul Webb Cc: Sohil Mehta Cc: Sourabh Jain Cc: Thomas Gleinxer Cc: Yifei Liu Cc: Signed-off-by: Andrew Morton --- drivers/of/kexec.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c index 1ee2d31816aeb..c4cf3552c0183 100644 --- a/drivers/of/kexec.c +++ b/drivers/of/kexec.c @@ -128,7 +128,6 @@ int __init ima_get_kexec_buffer(void **addr, size_t *size) { int ret, len; unsigned long tmp_addr; - unsigned long start_pfn, end_pfn; size_t tmp_size; const void *prop; @@ -144,17 +143,9 @@ int __init ima_get_kexec_buffer(void **addr, size_t *size) if (!tmp_size) return -ENOENT; - /* - * Calculate the PFNs for the buffer and ensure - * they are with in addressable memory. - */ - start_pfn = PHYS_PFN(tmp_addr); - end_pfn = PHYS_PFN(tmp_addr + tmp_size - 1); - if (!page_is_ram(start_pfn) || !page_is_ram(end_pfn)) { - pr_warn("IMA buffer at 0x%lx, size = 0x%zx beyond memory\n", - tmp_addr, tmp_size); - return -EINVAL; - } + ret = ima_validate_range(tmp_addr, tmp_size); + if (ret) + return ret; *addr = __va(tmp_addr); *size = tmp_size; -- 2.51.0