From nobody Sat Feb 7 13:41:48 2026 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (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 7D45F35959 for ; Tue, 27 Jan 2026 01:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769477588; cv=none; b=hNcXT1U6I3dhGgkUVHhADs5zwT3OtQt//XyX75NEK9Ygbkf+d/hGcIxwWjgTYEM54JqL66HEfgNUnLJPe/3a+Fl9z/V+OKWBCkT+rcuZo8CgIbUxQNnq9ar1qaiXAWQlhzSSLCo+zPKcd9R4Oi4CWqRgFyUe/2CO++UDqVDq8vk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769477588; c=relaxed/simple; bh=y+TcMHwnUMLEzSTK5wytt5CdMGR16fUZh+MpG7zTBus=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GtGtGGVNKaiB/fxnUilXDNTMDe2bFWr/LDgTmRA6h8ce8ke73o0dqrvWeEi/Q21Yuyve5X48S31+YF4pf7D2fEkL9GT9CglBTs+zFxJHm5ruKHPp8n8ctzG9oMNaEddZBuPeGZc/e422Igbjxfh8b8mL3sJivPcRTVci4oQcLgE= 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=YVhe8cOb; arc=none smtp.client-ip=95.215.58.179 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="YVhe8cOb" 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=1769477584; 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=UnRvJxr9q79DW3ea8BGlrgvFdnXu65gwEND4BgwPv3A=; b=YVhe8cObTeZpRypmKT5dWgQ9CEDVxcV24lMbmFwyb68P75+opgd3Cb5gStw2TbDC065mZJ yqninnxrzhJp2dO2uC6vUbW6eS2cAn9ukMfKgGMR8Wp+Rs7f7sKAZiO7kLvrzp2AVMHMMZ FDv/HKqll5JRO7FQiF37jQbJHTWX2YE= From: Thorsten Blum To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: Thorsten Blum , linux-kernel@vger.kernel.org Subject: [PATCH RESEND] x86/vdso: Replace simple_strtoul with kstrtouint in vdso{32}_setup Date: Tue, 27 Jan 2026 02:32:50 +0100 Message-ID: <20260127013249.432982-2-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_strtoul() with the recommended kstrtouint() for parsing the 'vdso=3D' and 'vdso32=3D' boot parameters. Unlike simple_strtoul(), which returns an unsigned long, kstrtouint() converts the string directly to an unsigned integer. Check the return value of kstrtouint() and reject invalid values. This adds error handling while preserving existing behavior for valid values, and removes use of the deprecated simple_strtoul() helper. Signed-off-by: Thorsten Blum --- arch/x86/entry/vdso/vdso32-setup.c | 4 +--- arch/x86/entry/vdso/vma.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/vdso/vdso32-setup.c b/arch/x86/entry/vdso/vdso3= 2-setup.c index 8894013eea1d..9556633c8f93 100644 --- a/arch/x86/entry/vdso/vdso32-setup.c +++ b/arch/x86/entry/vdso/vdso32-setup.c @@ -30,9 +30,7 @@ unsigned int __read_mostly vdso32_enabled =3D VDSO_DEFAUL= T; =20 static int __init vdso32_setup(char *s) { - vdso32_enabled =3D simple_strtoul(s, NULL, 0); - - if (vdso32_enabled > 1) { + if (kstrtouint(s, 0, &vdso32_enabled) || vdso32_enabled > 1) { pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso di= sabled\n"); vdso32_enabled =3D 0; } diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index e7fd7517370f..5292acbd8f2f 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -274,8 +274,7 @@ bool arch_syscall_is_vdso_sigreturn(struct pt_regs *reg= s) #ifdef CONFIG_X86_64 static __init int vdso_setup(char *s) { - vdso64_enabled =3D simple_strtoul(s, NULL, 0); - return 1; + return kstrtouint(s, 0, &vdso64_enabled) =3D=3D 0; } __setup("vdso=3D", vdso_setup); #endif /* CONFIG_X86_64 */ --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4