Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 0/3] x86/vdso: improve vdso=/vdso32= boot parameter validation
@ 2026-06-07 15:16 Thorsten Blum
  2026-06-07 15:16 ` [PATCH 1/3] x86/vdso: use kstrtouint() to validate vdso= boot parameter Thorsten Blum
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-06-07 15:16 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin, Andrew Morton, Jonathan Corbet,
	Shuah Khan, Randy Dunlap
  Cc: x86, linux-doc, linux-kernel, Thorsten Blum

Replace the deprecated simple_strtoul() [1] with kstrtouint() when
parsing the vDSO boot parameters. This provides strict input validation,
rejects partial input, and warns when disabling vDSO for invalid values.

Adjust both warnings for consistency and update the documentation.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull

Thorsten Blum (3):
  x86/vdso: use kstrtouint() to validate vdso= boot parameter
  x86/vdso: use kstrtouint() to validate vdso32= boot parameter
  Documentation/arch/x86: remove obsolete vdso32=2 compatibility note

 Documentation/admin-guide/kernel-parameters.txt |  5 +----
 arch/x86/entry/vdso/vdso32-setup.c              | 10 ++++------
 arch/x86/entry/vdso/vma.c                       |  6 +++++-
 3 files changed, 10 insertions(+), 11 deletions(-)


base-commit: 979c294509f9248fe1e7c358d582fb37dd5ca12d

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] x86/vdso: use kstrtouint() to validate vdso= boot parameter
  2026-06-07 15:16 [PATCH 0/3] x86/vdso: improve vdso=/vdso32= boot parameter validation Thorsten Blum
@ 2026-06-07 15:16 ` Thorsten Blum
  2026-06-07 15:16 ` [PATCH 2/3] x86/vdso: use kstrtouint() to validate vdso32= " Thorsten Blum
  2026-06-07 15:16 ` [PATCH 3/3] Documentation/arch/x86: remove obsolete vdso32=2 compatibility note Thorsten Blum
  2 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-06-07 15:16 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin, Andrew Morton, Jonathan Corbet,
	Shuah Khan, Randy Dunlap
  Cc: x86, linux-doc, linux-kernel, Thorsten Blum

Replace the deprecated simple_strtoul() with kstrtouint() when parsing
the vdso= 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 <thorsten.blum@linux.dev>
---
 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 *regs)
 #ifdef CONFIG_X86_64
 static __init int vdso_setup(char *s)
 {
-	vdso64_enabled = simple_strtoul(s, NULL, 0);
+	if (kstrtouint(s, 0, &vdso64_enabled) || vdso64_enabled > 1) {
+		pr_warn("vdso= values other than 0 and 1 are invalid; vdso disabled\n");
+		vdso64_enabled = 0;
+	}
+
 	return 1;
 }
 __setup("vdso=", vdso_setup);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] x86/vdso: use kstrtouint() to validate vdso32= boot parameter
  2026-06-07 15:16 [PATCH 0/3] x86/vdso: improve vdso=/vdso32= boot parameter validation Thorsten Blum
  2026-06-07 15:16 ` [PATCH 1/3] x86/vdso: use kstrtouint() to validate vdso= boot parameter Thorsten Blum
@ 2026-06-07 15:16 ` Thorsten Blum
  2026-06-07 15:16 ` [PATCH 3/3] Documentation/arch/x86: remove obsolete vdso32=2 compatibility note Thorsten Blum
  2 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-06-07 15:16 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin, Andrew Morton, Jonathan Corbet,
	Shuah Khan, Randy Dunlap
  Cc: x86, linux-doc, linux-kernel, Thorsten Blum

Replace the deprecated simple_strtoul() with kstrtouint() when parsing
the vdso32= boot parameter and its X86_32 vdso= 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= handler comment to reflect the supported values.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 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/vdso32-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 = VDSO_DEFAULT;
 
 static int __init vdso32_setup(char *s)
 {
-	vdso32_enabled = simple_strtoul(s, NULL, 0);
-
-	if (vdso32_enabled > 1) {
-		pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n");
+	if (kstrtouint(s, 0, &vdso32_enabled) || vdso32_enabled > 1) {
+		pr_warn("vdso32= values other than 0 and 1 are invalid; vdso disabled\n");
 		vdso32_enabled = 0;
 	}
 
@@ -41,9 +39,9 @@ static int __init vdso32_setup(char *s)
 }
 
 /*
- * For consistency, the argument vdso32=[012] affects the 32-bit vDSO
+ * For consistency, the argument vdso32=[01] affects the 32-bit vDSO
  * behavior on both 64-bit and 32-bit kernels.
- * On 32-bit kernels, vdso=[012] means the same thing.
+ * On 32-bit kernels, vdso=[01] means the same thing.
  */
 __setup("vdso32=", vdso32_setup);
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] Documentation/arch/x86: remove obsolete vdso32=2 compatibility note
  2026-06-07 15:16 [PATCH 0/3] x86/vdso: improve vdso=/vdso32= boot parameter validation Thorsten Blum
  2026-06-07 15:16 ` [PATCH 1/3] x86/vdso: use kstrtouint() to validate vdso= boot parameter Thorsten Blum
  2026-06-07 15:16 ` [PATCH 2/3] x86/vdso: use kstrtouint() to validate vdso32= " Thorsten Blum
@ 2026-06-07 15:16 ` Thorsten Blum
  2 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-06-07 15:16 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin, Andrew Morton, Jonathan Corbet,
	Shuah Khan, Randy Dunlap
  Cc: x86, linux-doc, linux-kernel, Thorsten Blum

Commit b0b49f2673f0 ("x86, vdso: Remove compat vdso support") removed
compat vDSO support and documented vdso32=2 as an alias for vdso32=0.

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=2 compatibility note and document only the
supported values.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 Documentation/admin-guide/kernel-parameters.txt | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/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
 
 	vdso32=		[X86] Control the 32-bit vDSO
 			vdso32=1: enable 32-bit VDSO
-			vdso32=0 or vdso32=2: disable 32-bit VDSO
+			vdso32=0: disable 32-bit VDSO
 
 			See the help text for CONFIG_COMPAT_VDSO for more
 			details.  If CONFIG_COMPAT_VDSO is set, the default is
 			vdso32=0; otherwise, the default is vdso32=1.
 
-			For compatibility with older kernels, vdso32=2 is an
-			alias for vdso32=0.
-
 			Try vdso32=0 if you encounter an error that says:
 			dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-07 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-07 15:16 [PATCH 0/3] x86/vdso: improve vdso=/vdso32= boot parameter validation Thorsten Blum
2026-06-07 15:16 ` [PATCH 1/3] x86/vdso: use kstrtouint() to validate vdso= boot parameter Thorsten Blum
2026-06-07 15:16 ` [PATCH 2/3] x86/vdso: use kstrtouint() to validate vdso32= " Thorsten Blum
2026-06-07 15:16 ` [PATCH 3/3] Documentation/arch/x86: remove obsolete vdso32=2 compatibility note Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox