From nobody Sat Feb 7 18:15:47 2026 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (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 E810F3559F9 for ; Thu, 18 Dec 2025 18:04:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766081078; cv=none; b=B5YUfeGeEq/ufQ6F7qJGxFtsP4m+c7Pspf3vv638g9uMffRwkUt38XtHw7n4Y7pCT78lLDIFACt/qLQRvMbJmS+eATarfShGG/hS/aTI6/oI989unC9wpm033OJQUibe9MIsVkXcu46HpqnFbOBx7zBzbZYU8zSotK5efDl+XRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766081078; c=relaxed/simple; bh=44DHbUgIqDp34Cd9Qg7EfbE6jo+r/UfwLHiEqXO0Wj8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tvOeUBy0t69OLp+iKxtm5JssFFEcGApwFUTD70xBa+ivlzyKBuPfRDjGwHziR2SUVFIys1AK88nZ+tW+PeF002g1b705TO8Q0lgq0CQbkYjVt4qbRA1pq9FRvMfxHQ2NdqrmvGdahao2pf9TmPeFZt2P8xuYc1Eoklrwl19JY+I= 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=cwLjfxnL; arc=none smtp.client-ip=91.218.175.173 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="cwLjfxnL" 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=1766081066; 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=7JpStxto3Jw4wvV34OM2Wo704K47vhMZ5KJzYN0OI/k=; b=cwLjfxnL40ux7x+UC2TpKZ5Hh+b5Jg0RhgNkypTmBiOBLf5pVihX7p3SOHAONwonTkIOOL Fm9faf5iMEobH7wmh7uwAAahKJa+zdpeL9N3j5CekPnoTe2gs750FRGTTkw28yqLK0oQID pY1Io5D0jDhmlp9758a13ye+qMzPw1I= 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] x86/vdso: Replace simple_strtoul with kstrtouint in vdso{32}_setup Date: Thu, 18 Dec 2025 19:04:12 +0100 Message-ID: <20251218180412.422164-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_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 afe105b2f907..468e0464be36 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -278,8 +278,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