[PATCH v2 2/2] x86/vdso: Replace deprecated simple_strtoul() with kstrtouint() in vdso_setup

From: Habil Eren Türker

Date: Mon Oct 05 2026 - 12:34:51 EST


The simple_strtoul() function is deprecated because it explicitly ignores
overflows. Replace it with the proper variant, kstrtouint(),
in vdso_setup(). Also add pr_warn().

It was detected while running a static analysis on the use of
simple_strtoul() in the kernel.

Signed-off-by: Habil Eren Türker <habilerenturker@xxxxxxxxxxx>
---
arch/x86/entry/vdso/vma.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index 18dfd80a8..62d96a537 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -299,7 +299,20 @@ 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);
+ unsigned int val;
+
+ if (unlikely(kstrtouint(s, 0, &val))) {
+ vdso64_enabled = 0;
+ return 1;
+ }
+
+ if (val > 1) {
+ pr_warn("vdso64 values other than 0 and 1 are no longer allowed; vdso disabled\n");
+ vdso64_enabled = 0;
+ return 1;
+ }
+
+ vdso64_enabled = val;
return 1;
}
__setup("vdso=", vdso_setup);
--
2.47.3