* [LTP] Syscall param clock_settime(tp) points to uninitialised byte(s)
@ 2026-04-13 15:57 Martin Cermak via ltp
2026-04-13 16:17 ` [LTP] Avoid " linuxtestproject.agent
2026-04-14 8:23 ` [LTP] " Cyril Hrubis
0 siblings, 2 replies; 3+ messages in thread
From: Martin Cermak via ltp @ 2026-04-13 15:57 UTC (permalink / raw)
To: Petr Vorel, Cyril Hrubis, valgrind-developers, ltp
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Hello there,
one LTP nit attached.
Cheers,
m.
[-- Attachment #2: 0001-Avoid-Syscall-param-clock_settime-tp-points-to-unini.patch --]
[-- Type: text/plain, Size: 3559 bytes --]
From 1acc76579c81b37814b0111044e1a1f8282cfbfb Mon Sep 17 00:00:00 2001
From: Martin Cermak <mcermak@redhat.com>
Date: Mon, 13 Apr 2026 17:48:43 +0200
Subject: [PATCH] Avoid Syscall param clock_settime(tp) points to uninitialised
byte(s)
Without this update, clock_settime03 fails under valgrind with an error like the following:
el10 x86_64 # ./vg-in-place --track-origins=yes ./auxprogs/auxchecks/ltp-full-20260130/testcases/kernel/syscalls/clock_settime/clock_settime03
==1638250== Memcheck, a memory error detector
==1638250== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1638250== Using Valgrind-3.27.0.GIT and LibVEX; rerun with -h for copyright info
==1638250== Command: ./auxprogs/auxchecks/ltp-full-20260130/testcases/kernel/syscalls/clock_settime/clock_settime03
==1638250==
tst_test.c:2047: TINFO: LTP version: 20260130
tst_test.c:2050: TINFO: Tested kernel: 6.12.0-218.el10.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 31 08:07:36 EDT 2026 x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.0-218.el10.x86_64/build/.config'
tst_test.c:1875: TINFO: Overall timeout per run is 0h 00m 34s
clock_settime03.c:35: TINFO: Testing variant: syscall with old kernel spec
clock_settime03.c:103: TPASS: clock_settime(): Y2038 test passed
==1638252==
==1638252== HEAP SUMMARY:
==1638252== in use at exit: 0 bytes in 0 blocks
==1638252== total heap usage: 17 allocs, 17 frees, 13,761 bytes allocated
==1638252==
==1638252== All heap blocks were freed -- no leaks are possible
==1638252==
==1638252== For lists of detected and suppressed errors, rerun with: -s
==1638252== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Summary:
passed 1
failed 0
broken 0
skipped 0
warnings 0
==1638250== Syscall param clock_settime(tp) points to uninitialised byte(s)
==1638250== at 0x496215D: syscall (in /usr/lib64/libc.so.6)
==1638250== by 0x416780: syscall_supported_by_kernel (tst_clocks.c:24)
==1638250== by 0x416780: tst_clock_settime (tst_clocks.c:104)
==1638250== by 0x40DB67: tst_wallclock_restore (tst_wallclock.c:63)
==1638250== by 0x407E06: do_cleanup (tst_test.c:1671)
==1638250== by 0x407E06: do_exit (tst_test.c:1054)
==1638250== by 0x40B280: run_tcases_per_fs (tst_test.c:2025)
==1638250== by 0x40B280: tst_run_tcases (tst_test.c:2065)
==1638250== by 0x404D8D: main (tst_test.h:755)
==1638250== Address 0x1ffefffbe0 is on thread 1's stack
==1638250== in frame #1, created by tst_clock_settime (tst_clocks.c:92)
==1638250== Uninitialised value was created by a stack allocation
==1638250== at 0x416710: tst_clock_settime (tst_clocks.c:92)
==1638250==
==1638250==
==1638250== HEAP SUMMARY:
==1638250== in use at exit: 0 bytes in 0 blocks
==1638250== total heap usage: 10 allocs, 10 frees, 10,552 bytes allocated
==1638250==
==1638250== All heap blocks were freed -- no leaks are possible
==1638250==
==1638250== For lists of detected and suppressed errors, rerun with: -s
==1638250== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
el10 x86_64 #
---
lib/tst_clocks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tst_clocks.c b/lib/tst_clocks.c
index 704ce9551..107938e4e 100644
--- a/lib/tst_clocks.c
+++ b/lib/tst_clocks.c
@@ -19,7 +19,7 @@ typedef int (*mysyscall)(clockid_t clk_id, void *ts);
int syscall_supported_by_kernel(long sysnr)
{
int ret;
- struct __kernel_timespec foo;
+ struct __kernel_timespec foo = { 0, };
ret = syscall(sysnr, 0, &foo);
if (ret == -1 && errno == ENOSYS)
--
2.53.0
[-- Attachment #3: Type: text/plain, Size: 60 bytes --]
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] Avoid Syscall param clock_settime(tp) points to uninitialised byte(s)
2026-04-13 15:57 [LTP] Syscall param clock_settime(tp) points to uninitialised byte(s) Martin Cermak via ltp
@ 2026-04-13 16:17 ` linuxtestproject.agent
2026-04-14 8:23 ` [LTP] " Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: linuxtestproject.agent @ 2026-04-13 16:17 UTC (permalink / raw)
To: Martin Cermak; +Cc: ltp
Hi Martin,
our agent completed the review of the patch.
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
On Mon, 13 Apr 2026, Martin Cermak wrote:
> Subject: [PATCH] Avoid Syscall param clock_settime(tp) points to uninitialised byte(s)
The subject copies the valgrind error message verbatim. Please use
the standard LTP format:
lib/tst_clocks: fix uninitialized memory in syscall_supported_by_kernel
> - struct __kernel_timespec foo;
> + struct __kernel_timespec foo = { 0, };
Fix itself looks correct.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] Syscall param clock_settime(tp) points to uninitialised byte(s)
2026-04-13 15:57 [LTP] Syscall param clock_settime(tp) points to uninitialised byte(s) Martin Cermak via ltp
2026-04-13 16:17 ` [LTP] Avoid " linuxtestproject.agent
@ 2026-04-14 8:23 ` Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2026-04-14 8:23 UTC (permalink / raw)
To: Martin Cermak; +Cc: valgrind-developers, ltp
Hi!
I've added your Signed-off-by: to the patch and applied, thanks.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-14 8:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 15:57 [LTP] Syscall param clock_settime(tp) points to uninitialised byte(s) Martin Cermak via ltp
2026-04-13 16:17 ` [LTP] Avoid " linuxtestproject.agent
2026-04-14 8:23 ` [LTP] " Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox