All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	Karl Mehltretter <kmehltretter@gmail.com>,
	Dapeng Mi <dapeng1.mi@linux.intel.com>,
	Marco Elver <elver@google.com>,
	Ethan Nelson-Moore <enelsonmoore@gmail.com>,
	Jeff Layton <jlayton@kernel.org>,
	x86@kernel.org
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Thorsten Blum" <blum@kernel.org>,
	"Habil Eren Türker" <habilerenturker@hotmail.com>
Subject: [PATCH RESEND 1/3] x86/vdso: Use kstrtouint() to validate vdso= boot parameter
Date: Tue,  3 Nov 2026 15:58:50 +0100	[thread overview]
Message-ID: <20261103145848.427309-6-blum@kernel.org> (raw)
In-Reply-To: <20261103145848.427309-5-blum@kernel.org>

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.

Reviewed-by: Habil Eren Türker <habilerenturker@hotmail.com>
Tested-by: Habil Eren Türker <habilerenturker@hotmail.com>
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 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 4bd3b22beea9..6e59bad7cf01 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -298,7 +298,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);

  reply	other threads:[~2026-11-03 14:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 14:58 [PATCH RESEND 0/3] x86/vdso: Improve vdso=/vdso32= boot parameter validation Thorsten Blum
2026-11-03 14:58 ` Thorsten Blum [this message]
2026-11-03 14:58 ` [PATCH RESEND 2/3] x86/vdso: Use kstrtouint() to validate vdso32= boot parameter Thorsten Blum
2026-11-03 14:58 ` [PATCH RESEND 3/3] Documentation/arch/x86: Remove obsolete vdso32=2 compatibility note Thorsten Blum
  -- strict thread matches above, loose matches on Subject: below --
2026-08-31 10:16 [PATCH RESEND 0/3] x86/vdso: Improve vdso=/vdso32= boot parameter validation Thorsten Blum
2026-08-31 10:16 ` [PATCH RESEND 1/3] x86/vdso: Use kstrtouint() to validate vdso= boot parameter Thorsten Blum
2026-07-13 23:34 [PATCH RESEND 0/3] x86/vdso: Improve vdso=/vdso32= boot parameter validation Thorsten Blum
2026-07-13 23:34 ` [PATCH RESEND 1/3] x86/vdso: Use kstrtouint() to validate vdso= boot parameter Thorsten Blum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261103145848.427309-6-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=elver@google.com \
    --cc=enelsonmoore@gmail.com \
    --cc=habilerenturker@hotmail.com \
    --cc=hpa@zytor.com \
    --cc=jlayton@kernel.org \
    --cc=kmehltretter@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.