[RFC PATCH v2 13/43] crash: Check crash_notes size against PAGE_SIZE_MIN
Eric Curtin
ericcurtin17 at gmail.com
Mon Nov 30 17:51:45 PST 2026
From: Ryan Roberts <ryan.roberts at arm.com>
With boot-time page size selection PAGE_SIZE is not a compile-time
constant, so it cannot be used in BUILD_BUG_ON().
In crash_notes_memory_init(), check the size of the per-CPU crash notes
buffer against PAGE_SIZE_MIN. If it fits in the smallest possible page
it fits in whichever page size is chosen at boot.
No functional change for compile-time page sizes.
Signed-off-by: Ryan Roberts <ryan.roberts at arm.com>
Acked-by: Baoquan He <bhe at redhat.com>
Signed-off-by: Eric Curtin <eric.curtin at docker.com>
(cherry picked from commit 6f90d8bafde4f6460bc1e449ffd28bd649a85e4a)
---
kernel/crash_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index d0bd2d0cf899..c7eb72748fee 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -576,7 +576,7 @@ static int __init crash_notes_memory_init(void)
* Break compile if size is bigger than PAGE_SIZE since crash_notes
* definitely will be in 2 pages with that.
*/
- BUILD_BUG_ON(size > PAGE_SIZE);
+ BUILD_BUG_ON(size > PAGE_SIZE_MIN);
crash_notes = __alloc_percpu(size, align);
if (!crash_notes) {
More information about the linux-arm-kernel
mailing list