From nobody Sat Feb 7 04:47:34 2026 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 96ABF2571A5 for ; Mon, 2 Feb 2026 17:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770053565; cv=none; b=ifE/+E1I74x1+qJxVQg5svFu01CzjxqY30IYr4/4WW8lK/V4wBcDe8PDkobRGtAI4UU6Q28q7/d9YxBGIlb9hH/6Ds9nQOpmVbmFkZX/SAnot2Cxng13KR2e3SGog4NcohGl0iP/RxZ5cavllMVwWDE67DUw4ueekpW6HT9mSM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770053565; c=relaxed/simple; bh=bq68Z4evNDSmcRnpLGX/vEOTh9iAxxZOBgFS3gU0JBw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=m+JZj3tq1s1QDd2KlFxQnmWn25XZZY5Lac8ZoMzXSBBfP8E+nvT3VFdCrQEGI/YwmXFxPvlAajVbYhac9C64kvulwL8oLoZAkBmVX253+Gw4lhCKWFRieQy6UYuBoPynL8HvHUa8LoqKDcuLWvQNzatAYLs7bAyYnhhE/Z5WAoc= 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=GqAZ4jpL; arc=none smtp.client-ip=95.215.58.171 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="GqAZ4jpL" 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=1770053560; 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=GqAZ4jpLy+c0t2jGCFyMFWvUviwnXCbqoujGFOSdzM2lh3rFyNDM9AG+L/dLjjBefILgny Op4nfemVLYJm8OsvWBcHVRbOgd7neyEElf60R/xHdQSwUckApTj2I/D9piTiBWXciHNc3Y IIWa62eH55MRF0bbLdEXssDK4sgXgEY= From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Changyuan Lyu , Alexander Graf , Andrew Morton , "Mike Rapoport (Microsoft)" Cc: Thorsten Blum , linux-kernel@vger.kernel.org Subject: [PATCH RESEND] x86/boot: Replace simple_strtoull in parse_gb_huge_pages Date: Mon, 2 Feb 2026 18:32:20 +0100 Message-ID: <20260202173223.865709-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