diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2025-12-28 23:02:04 +0100 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2026-01-02 21:49:59 +0100 |
| commit | 958f2ab6d400de5a8990c392d17eecaf2e47e6c4 (patch) | |
| tree | d9a7213218866af39f0bd4b9c3ea51bf1f07541d | |
| parent | 02624874966d57e482baa6f0d1e87c37608506dc (diff) | |
compat: linux: use appropriate variables for copying out old timers
We copyout &l_oval but do the conversions into &l_val, leaving us with
stack garbage. A build with an LLVM21 cross-toolchain seems to catch
this.
Reported by: Florian Limberger <flo purplekraken com>
Reviewed by: markj
Fixes: a1fd2911ddb06 ("linux(4): Implement timer_settime64 syscall.")
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52985
(cherry picked from commit 541a98d7e28a8e4697ac2fa78dd4c4203c2c3a9c)
| -rw-r--r-- | sys/compat/linux/linux_timer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_timer.c b/sys/compat/linux/linux_timer.c index bfa17d7e8aa5..632c4c530eec 100644 --- a/sys/compat/linux/linux_timer.c +++ b/sys/compat/linux/linux_timer.c @@ -131,7 +131,7 @@ linux_timer_settime(struct thread *td, struct linux_timer_settime_args *uap) return (error); error = kern_ktimer_settime(td, uap->timerid, flags, &val, ovalp); if (error == 0 && uap->old != NULL) { - error = native_to_linux_itimerspec(&l_val, &val); + error = native_to_linux_itimerspec(&l_oval, &oval); if (error == 0) error = copyout(&l_oval, uap->old, sizeof(l_oval)); } @@ -158,7 +158,7 @@ linux_timer_settime64(struct thread *td, struct linux_timer_settime64_args *uap) return (error); error = kern_ktimer_settime(td, uap->timerid, flags, &val, ovalp); if (error == 0 && uap->old != NULL) { - error = native_to_linux_itimerspec64(&l_val, &val); + error = native_to_linux_itimerspec64(&l_oval, &oval); if (error == 0) error = copyout(&l_oval, uap->old, sizeof(l_oval)); } |
