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:		a1fd2911dd ("linux(4): Implement timer_settime64 syscall.")
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D52985
This commit is contained in:
Kyle Evans
2025-12-28 23:02:04 +01:00
committed by Dimitry Andric
parent 4cd7be3e81
commit 541a98d7e2
+2 -2
View File
@@ -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));
}