[PATCH] lib/vsprintf: Make no_hash_pointers take effect early
From: Kaitao Cheng
Date: Wed Jun 10 2026 - 08:55:30 EST
From: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
The no_hash_pointers boot parameter is now handled as an alias for
hash_pointers=never. However, hash_pointers=never only records the
selected mode during early parameter parsing, and no_hash_pointers is
not updated until hash_pointers_finalize() runs later from SLUB init.
This leaves a window during very early boot where %p output is still
hashed even though the user explicitly requested unhashed pointers with
no_hash_pointers or hash_pointers=never.
Set no_hash_pointers as soon as the "never" mode is parsed. The later
hash_pointers_finalize() call still keeps the final policy decision in
one place, but explicit requests to disable pointer hashing now take
effect for early boot users too.
Signed-off-by: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
---
lib/vsprintf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 4221e95701f9..9d35c84f6c49 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -2361,6 +2361,7 @@ static int __init hash_pointers_mode_parse(char *str)
} else if (strcmp(str, "never") == 0) {
pr_info("Hash pointers mode set to never.\n");
hash_pointers_mode = HASH_PTR_NEVER;
+ no_hash_pointers = true;
} else if (strcmp(str, "always") == 0) {
pr_info("Hash pointers mode set to always.\n");
hash_pointers_mode = HASH_PTR_ALWAYS;
--
2.50.1 (Apple Git-155)