From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (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 995551D61B7 for ; Fri, 12 Jun 2026 03:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781233651; cv=none; b=VP8riVmdk5IwGj5fBrkFHnoI3viIqwTVVQBqHPiiSle/qc+LQewrVPYyloikF2IK8HCDrEZg4YCY1xa+Gih5x+71hQQFl3rLvs0oiNXlIYl0IHiWXTb1xgpf/TDAmBhGrAft2xAyB50VnK9SQi0WLutGHsqws7Y4YJVY3yKkr8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781233651; c=relaxed/simple; bh=FlEByKyqVi+9PFYzed7B2ZyZ18vEan4G7oCwm8wpXV4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FdICkjE92MX3CSyhk54b/vJKwYzKHXObejsF+m+lJet7cE1CtL1GJyhp/TLOxpR71HihnK/lLU+Rlzsg8RY3C3H8bOvmu/qYRU0IhEjSw9RS5lN51kFyQrHMa/XVciyyLmcRMxHCzP+a16ZkHtaSlzz25cfKpZ4nJyaoIlsFEAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=G6E8BbED; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="G6E8BbED" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781233647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/O2tEnQP/LzJmZ0AYYZ+i2xPnXCA24/SfbILRyuNzjQ=; b=G6E8BbEDPJpQQErLev1m0Acv/AkEumaj+PrbBcXeEwzwSuq+BGKI0SLHWt5ZEodA0FBrvL IoRbBqX9wKjK2WbGYlD9Nx2r9ERd62ToxGOs0SOsgWG7qv6s0uUD4h89uU/FAjx8uvzy2R H6MmdjDgAPlZq1sdxjZICvXT/4Yr42w= From: Kaitao Cheng To: Petr Mladek , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Andrew Morton Cc: linux-kernel@vger.kernel.org, Kaitao Cheng Subject: [PATCH v2] lib/vsprintf: Make no_hash_pointers take effect early Date: Fri, 12 Jun 2026 11:06:42 +0800 Message-ID: <20260612030642.14239-1-kaitao.cheng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Kaitao Cheng 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. In Documentation/admin-guide/kernel-parameters.txt, the descriptions of both no_hash_pointers and hash_pointers= are already marked as [KNL,EARLY], which match the current semantics. Signed-off-by: Kaitao Cheng --- Changes in v2 (Andy Shevchenko): - Add a description of the kernel documentation to the commit log. Link to v1: https://lore.kernel.org/all/20260610124525.59110-1-kaitao.cheng@linux.dev/ --- 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.43.0