[PATCH 1/2] x86/vdso: Replace deprecated simple_strtoul() with kstrtouint()
From: Habil Eren Türker
Date: Sat Oct 03 2026 - 12:39:10 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 | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/entry/vdso/vdso32-setup.c b/arch/x86/entry/vdso/vdso32-setup.c
index 8894013ee..5bd45ae32 100644
--- a/arch/x86/entry/vdso/vdso32-setup.c
+++ b/arch/x86/entry/vdso/vdso32-setup.c
@@ -30,9 +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) {
+ if (kstrtouint(s, 0, &vdso32_enabled) || vdso32_enabled > 1) {
pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n");
vdso32_enabled = 0;
}
--
2.47.3