From nobody Mon Jun 8 04:14:53 2026 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 2F69A27F72C for ; Sun, 7 Jun 2026 15:18:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780845525; cv=none; b=FAD0W4onYtPi12GGF4OWcGodE/pH+E2o15tk2jsdcJ/CNoV7x2dA2QWNmihjGeFXknEDX8Z23/yauYy9tnUJFUWIlfmIFV99+/4x4hPXoxVMwYw2a3BTumSI18aRhtr8VpLOBtgzkMDP+KZOcYglYox61meyEql4t6mkIGjoVBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780845525; c=relaxed/simple; bh=bfMHrToJcqjgW+DnKHgtGJx3PrOXXiuYQXaob0KiPpQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aOigNCKI6rNMBj9ZRpG6WEDJuAsscO7SvXD1Z92XZu15qqID318IPt2ZsvH+vxUIW2n/yiK+gdQhj1TojHrOHnapOaA6nNp+eHAS51cJqBY64zLpJuSpdW+yEaznOHiCO+x9SC43iRafo3Akhl1stsl01uHBKQEWW+ezUtO93hk= 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=OCljjPMR; arc=none smtp.client-ip=91.218.175.185 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="OCljjPMR" 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=1780845521; 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: in-reply-to:in-reply-to:references:references; bh=AVnDiESh+x1DRYqYZbCBHy4sUn9oEX58Cf8ALyZWHeA=; b=OCljjPMR00HcmFwycoRDVGRUOFTDFHigrwxTY16SBe6EuHAAoZs15ITum/JZeIKsfsP3zB mx1yXJ33zCaN3FIzVLvteZp3lpUeYhshgychnVh1sgnTaiRoFQxosQXM1NUNTe4PqF6jQ1 z7mr6sL12MBLNM5IPoHByLmT4K9tjJg= From: Thorsten Blum To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andrew Morton , Jonathan Corbet , Shuah Khan , Randy Dunlap Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH 1/3] x86/vdso: use kstrtouint() to validate vdso= boot parameter Date: Sun, 7 Jun 2026 17:16:16 +0200 Message-ID: <20260607151614.79567-6-thorsten.blum@linux.dev> In-Reply-To: <20260607151614.79567-5-thorsten.blum@linux.dev> References: <20260607151614.79567-5-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1214; i=thorsten.blum@linux.dev; h=from:subject; bh=bfMHrToJcqjgW+DnKHgtGJx3PrOXXiuYQXaob0KiPpQ=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFmq3R59P1+t4znM4pHxR/3O/P0nZvxZ/Wvh6/jPIT/7L R4eXjj9VkcpC4MYF4OsmCLLg1k/ZviW1lRuMonYCTOHlQlkCAMXpwBMRMKO4Z/ewnsevw0Uim1b 3PjTpc1k5p0Ilc9VUjuVOyV3DX966G2Gf5rrvt+/Yn/32cLWsPTP+oujEt62xzQ+X/iwbf21T6u luVkA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace the deprecated simple_strtoul() with kstrtouint() when parsing the vdso=3D boot parameter. simple_strtoul() accepts partial input and silently converts invalid input to 0. Use kstrtouint() for strict input validation instead and reject malformed input. Accept only 0 and 1; warn and disable vDSO support otherwise. kstrtouint() converts the input string directly to an unsigned int, avoiding an implicit conversion when assigning to vdso64_enabled. Signed-off-by: Thorsten Blum --- arch/x86/entry/vdso/vma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index d903bce24f15..b45549cd7acf 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -270,7 +270,11 @@ bool arch_syscall_is_vdso_sigreturn(struct pt_regs *re= gs) #ifdef CONFIG_X86_64 static __init int vdso_setup(char *s) { - vdso64_enabled =3D simple_strtoul(s, NULL, 0); + if (kstrtouint(s, 0, &vdso64_enabled) || vdso64_enabled > 1) { + pr_warn("vdso=3D values other than 0 and 1 are invalid; vdso disabled\n"= ); + vdso64_enabled =3D 0; + } + return 1; } __setup("vdso=3D", vdso_setup); From nobody Mon Jun 8 04:14:53 2026 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.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 40C3E27FB37 for ; Sun, 7 Jun 2026 15:18:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780845527; cv=none; b=Q8BKmH8Xd2n7IF601ikOnjxfuZtpaGZKUGaEa2UNz9cxxN7SKF32CkyF7lXwLLR2oCysgxXrZJJZGjTtE62GRoB9Q4gbfDZEnfcDpC1+t35STqz5CDrrz+piCqgfggIByWKzXAJ5EZ7Nk5CrVL8j/JtqKwf4qu9xmm/TUBGZmKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780845527; c=relaxed/simple; bh=Jhyde+qVXhwYKT+jfqAojkE5MDc+zEv4Q/4BXY9Wek4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Psvbr3AkCZj/UXzcNo07c5H7+AqW5mijBuwKZuWiUUvbNCfsKh6efYTuIh5mTJgZFCNggFU5j0kuvGu6roghQTihXp/xWdTaDCxI5Zb+UYe6JekXpKwkGp4lgrvMDFfxCwmHx2dnvB1cnVHCA7/f40Y16r9KvcfPk/DTCGZwSwo= 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=wO0G6jGX; arc=none smtp.client-ip=91.218.175.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="wO0G6jGX" 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=1780845523; 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: in-reply-to:in-reply-to:references:references; bh=PH+ap9Z9jRyHTeU0JE3+i1OoIv68/HHTxd5g9JcEcPs=; b=wO0G6jGX2+HmbCmRIDLyXk3Kgh03RW3nqrx/tcDtUf0tywBJljKK17xm5Uh9v/XRSLs3Ss Jooi8bhcLKKkS8f48SFlzbKn+AqUcfrSQfv9gsV1+Ag1RCO1o0PeOOFYGFojn22VPs+WIj bzUNeGQ5ytXhilO9M3aV0Z8uohVUiSQ= From: Thorsten Blum To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andrew Morton , Jonathan Corbet , Shuah Khan , Randy Dunlap Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH 2/3] x86/vdso: use kstrtouint() to validate vdso32= boot parameter Date: Sun, 7 Jun 2026 17:16:17 +0200 Message-ID: <20260607151614.79567-7-thorsten.blum@linux.dev> In-Reply-To: <20260607151614.79567-5-thorsten.blum@linux.dev> References: <20260607151614.79567-5-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1839; i=thorsten.blum@linux.dev; h=from:subject; bh=Jhyde+qVXhwYKT+jfqAojkE5MDc+zEv4Q/4BXY9Wek4=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFmq3R5LhN7FbQpcGntnQ1DV9jmRjN94zsboPTfmt7+22 sxyUn5gRykLgxgXg6yYIsuDWT9m+JbWVG4yidgJM4eVCWQIAxenAExEO5iR4UC14urp05Y/mPWS d+7bFXImm54KLnkoKnDq3YLWD0KHL71hZLjt1BAvPuXQ6TKmUIkENQUb19vzZqZWV7VHrVeSfR5 pyQ8A X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace the deprecated simple_strtoul() with kstrtouint() when parsing the vdso32=3D boot parameter and its X86_32 vdso=3D alias. simple_strtoul() accepts partial input and silently converts invalid input to 0. Use kstrtouint() for strict input validation instead and reject malformed input. Accept only 0 and 1; warn and disable vDSO support otherwise. kstrtouint() converts the input string directly to an unsigned int, avoiding an implicit conversion when assigning to vdso32_enabled. Update the vdso32=3D handler comment to reflect the supported values. Signed-off-by: Thorsten Blum --- arch/x86/entry/vdso/vdso32-setup.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/entry/vdso/vdso32-setup.c b/arch/x86/entry/vdso/vdso3= 2-setup.c index 8894013eea1d..5f3e548ebf19 100644 --- a/arch/x86/entry/vdso/vdso32-setup.c +++ b/arch/x86/entry/vdso/vdso32-setup.c @@ -30,10 +30,8 @@ unsigned int __read_mostly vdso32_enabled =3D VDSO_DEFAU= LT; =20 static int __init vdso32_setup(char *s) { - vdso32_enabled =3D simple_strtoul(s, NULL, 0); - - if (vdso32_enabled > 1) { - pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso di= sabled\n"); + if (kstrtouint(s, 0, &vdso32_enabled) || vdso32_enabled > 1) { + pr_warn("vdso32=3D values other than 0 and 1 are invalid; vdso disabled\= n"); vdso32_enabled =3D 0; } =20 @@ -41,9 +39,9 @@ static int __init vdso32_setup(char *s) } =20 /* - * For consistency, the argument vdso32=3D[012] affects the 32-bit vDSO + * For consistency, the argument vdso32=3D[01] affects the 32-bit vDSO * behavior on both 64-bit and 32-bit kernels. - * On 32-bit kernels, vdso=3D[012] means the same thing. + * On 32-bit kernels, vdso=3D[01] means the same thing. */ __setup("vdso32=3D", vdso32_setup); From nobody Mon Jun 8 04:14:53 2026 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 6679C2D738F for ; Sun, 7 Jun 2026 15:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780845527; cv=none; b=Grbr94AvKNmvhGLEU1NPZdGeS+sHVU8Uz3v8wafiGqLhTgReS9bTuUdPGuPYTz70i0Hh7St3bMxHNI3E3NZOkkogp0oqY7r5ewf7Hzfoa5zcLH77RQdwYGfBR74bPsKyhpnWkNOQQHdUg6k8NnrxPn6mjmPHqOFWGsnJBfGX+C4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780845527; c=relaxed/simple; bh=rHECXCEW8xWVS/Yest4w8oz1GJgdRW8jNbhEpHbgujA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tfVkEiuSPiwjib6lbDIeYFvJAefYqt4YxY5KDEJKyTDPs7y54Ozy2ostMT8BUnEvig7kI1jMtOeYDlXWKqk2uYiL2291PKTlnM2WHtAPdPioeAN9MHwyLTXGXvY0IVg68n4fb3vcQDxfVEW7pnyfcH8x93ZApg1kivpmvwk5Xp8= 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=ihExTOWc; arc=none smtp.client-ip=91.218.175.181 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="ihExTOWc" 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=1780845524; 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: in-reply-to:in-reply-to:references:references; bh=x1Q5oRNAeFDnB5QhTx9pvk1aNFFzW3nQLKiFuG72XZQ=; b=ihExTOWchc5o/4OJHNzRNSwbzAy7oD7bDCP+5P37mcBIF8aAFMq850JjoL88zjwFVfubaU 57b0iyp0S7WU9dmiBF0JViiW63Clff9gcxzD+5jJcw3iBax/0ClZrEaIqA3JM8W/Wu3ZyA 0zx/c7GvbArfWzix57m0iYPDoWfWFWc= From: Thorsten Blum To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andrew Morton , Jonathan Corbet , Shuah Khan , Randy Dunlap Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH 3/3] Documentation/arch/x86: remove obsolete vdso32=2 compatibility note Date: Sun, 7 Jun 2026 17:16:18 +0200 Message-ID: <20260607151614.79567-8-thorsten.blum@linux.dev> In-Reply-To: <20260607151614.79567-5-thorsten.blum@linux.dev> References: <20260607151614.79567-5-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1420; i=thorsten.blum@linux.dev; h=from:subject; bh=rHECXCEW8xWVS/Yest4w8oz1GJgdRW8jNbhEpHbgujA=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFmq3R6P7Ta/Wfu0TWwuS/AH+c/hHar7O789UxJmu5p21 /7VLcPPHSUsDGJcDLJiiiwPZv2Y4VtaU7nJJGInzBxWJpAhDFycAjCRBVcZ/hn8CuCK3rh30+vG KXJ9Iu+qdx63Wyrus7bh5s+JwivZniYx/JhzWaM1Y2VCjWLCFdsFjD5On//d6dM6M2OGn1746d8 GbAA= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Commit b0b49f2673f0 ("x86, vdso: Remove compat vdso support") removed compat vDSO support and documented vdso32=3D2 as an alias for vdso32=3D0. However, since commit c06989da39cd ("x86/vdso: Ensure vdso32_enabled gets set to valid values only"), vdso32_setup() accepts only 0 and 1. Remove the obsolete vdso32=3D2 compatibility note and document only the supported values. Signed-off-by: Thorsten Blum Reviewed-by: Randy Dunlap --- Documentation/admin-guide/kernel-parameters.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 97007f4f69d4..ce1c630d6859 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -8249,15 +8249,12 @@ Kernel parameters =20 vdso32=3D [X86] Control the 32-bit vDSO vdso32=3D1: enable 32-bit VDSO - vdso32=3D0 or vdso32=3D2: disable 32-bit VDSO + vdso32=3D0: disable 32-bit VDSO =20 See the help text for CONFIG_COMPAT_VDSO for more details. If CONFIG_COMPAT_VDSO is set, the default is vdso32=3D0; otherwise, the default is vdso32=3D1. =20 - For compatibility with older kernels, vdso32=3D2 is an - alias for vdso32=3D0. - Try vdso32=3D0 if you encounter an error that says: dl_main: Assertion `(void *) ph->p_vaddr =3D=3D _rtld_local._dl_sysinfo= _dso' failed!