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

From: Habil Eren Türker

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


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

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/vdso32-setup.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/vdso/vdso32-setup.c b/arch/x86/entry/vdso/vdso32-setup.c
index 8894013ee..126c0398d 100644
--- a/arch/x86/entry/vdso/vdso32-setup.c
+++ b/arch/x86/entry/vdso/vdso32-setup.c
@@ -30,13 +30,20 @@ unsigned int __read_mostly vdso32_enabled = VDSO_DEFAULT;

static int __init vdso32_setup(char *s)
{
- vdso32_enabled = simple_strtoul(s, NULL, 0);
+ unsigned int val;

- if (vdso32_enabled > 1) {
+ if (unlikely(kstrtouint(s, 0, &val))) {
+ vdso32_enabled = 0;
+ return 1;
+ }
+
+ if (val > 1) {
pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n");
vdso32_enabled = 0;
+ return 1;
}

+ vdso32_enabled = val;
return 1;
}

--
2.47.3