From nobody Sat Feb 7 15:10:22 2026 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 8827437BE88 for ; Mon, 12 Jan 2026 17:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768238833; cv=none; b=PaOocCUYSfB1hzoy1xf9c1CDKUMKQYQo02d8utxaLbEIbFlP0Berr69Op/uvChL41oUOCTidQ8wyYXz6yUWik49jgxW0xo1EgALFKG23vQ1jF84aIwYt9MvkTbO6Ysi/PDWJcIp5gEu79csK92nFczUxm1Zr7NI5O7ezYZ7FHgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768238833; c=relaxed/simple; bh=bq68Z4evNDSmcRnpLGX/vEOTh9iAxxZOBgFS3gU0JBw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hj37sccAgByVNmE9jUN61uORwzIIz4vLpbdXkgSJKHddRf6O14tNmheorTdKsTfgVonVUgMVZcR28q8pr55RYhcLUkke2I+TBfwaPLT2nw7Ww8MSafDlWSwm/Ta2n5hFI3xZUFZkIp5IZSvxYX3qrdEAOxJXq/R4gc6aFAqdbBo= 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=TfuIMRr4; arc=none smtp.client-ip=95.215.58.178 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="TfuIMRr4" 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=1768238828; 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=sVxjUOAe3AAOecpPUSEfuGFjdEEUIjg6TsnM6tY0FdA=; b=TfuIMRr4Y1RiI3nwrpBNIhZpeo1rXzLVJU1Mo0g/+2LjlC1Onl34AX4QAQav2IBLnR3u9I 0y1wLaRcAZ6l4t+Z4jY9d2nlr76ohg5XvdO5Czr50GpNowBZCerZoFiMJMWdBCjAl4xVbW wFXTh1wnERIiFcP3b/n4WXvbjmsr7xY= From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andrew Morton , "Mike Rapoport (Microsoft)" , Alexander Graf , Changyuan Lyu Cc: Thorsten Blum , linux-kernel@vger.kernel.org Subject: [PATCH] x86/boot: Replace simple_strtoull in parse_gb_huge_pages Date: Mon, 12 Jan 2026 18:26:46 +0100 Message-ID: <20260112172649.764176-1-thorsten.blum@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: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace simple_strtoull() with the recommended boot_kstrtoul() for parsing the 'hugepages=3D' boot parameter. Unlike simple_strtoull(), which returns an unsigned long long, boot_kstrtoul() converts the string directly to an unsigned long and avoids implicit casting. Check the return value of boot_kstrtoul() and warn about invalid values. Signed-off-by: Thorsten Blum --- arch/x86/boot/compressed/kaslr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/ka= slr.c index 3b0948ad449f..e6c44a0d3640 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -219,7 +219,8 @@ static void parse_gb_huge_pages(char *param, char *val) =20 if (!strcmp(param, "hugepages") && gbpage_sz) { p =3D val; - max_gb_huge_pages =3D simple_strtoull(p, &p, 0); + if (boot_kstrtoul(p, 0, &max_gb_huge_pages)) + warn("Failed to parse boot parameter hugepages\n"); return; } } --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4