[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251113-vdso-test-types-v2-7-0427eff70d08@linutronix.de>
Date: Thu, 13 Nov 2025 16:30:23 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Shuah Khan <shuah@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH v2 07/14] selftests: vDSO: vdso_test_abi: Validate return
value of syscall(clock_getres)
If the system call failed the output memory is not usable.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
tools/testing/selftests/vDSO/vdso_test_abi.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/selftests/vDSO/vdso_test_abi.c
index 7826d9c10ccaf313dc003e8959d9eb84b2cda874..ff142b3b9075b18e60a46b77492d285e9937fa71 100644
--- a/tools/testing/selftests/vDSO/vdso_test_abi.c
+++ b/tools/testing/selftests/vDSO/vdso_test_abi.c
@@ -168,12 +168,15 @@ static void vdso_test_clock_getres(__kernel_clockid_t clk_id)
}
ret = syscall(SYS_clock_getres, clk_id, &sys_ts);
+ if (ret == 0) {
+ ksft_print_msg("The syscall resolution is %lld %lld\n",
+ (long long)sys_ts.tv_sec, (long long)sys_ts.tv_nsec);
- ksft_print_msg("The syscall resolution is %lld %lld\n",
- (long long)sys_ts.tv_sec, (long long)sys_ts.tv_nsec);
-
- if ((sys_ts.tv_sec != ts.tv_sec) || (sys_ts.tv_nsec != ts.tv_nsec))
+ if ((sys_ts.tv_sec != ts.tv_sec) || (sys_ts.tv_nsec != ts.tv_nsec))
+ clock_getres_fail++;
+ } else {
clock_getres_fail++;
+ }
if (clock_getres_fail > 0) {
ksft_test_result_fail("%s %s\n", name[3],
--
2.51.0
Powered by blists - more mailing lists