Skip to content

Commit 4394bb8

Browse files
committed
linux_timer: Fix bad copyout of uninitialized oval
The native_to_linux_itimerspec() call should have used l_oval as the output parameter here.
1 parent 83377a0 commit 4394bb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sys/compat/linux/linux_timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ linux_timer_settime(struct thread *td, struct linux_timer_settime_args *uap)
131131
return (error);
132132
error = kern_ktimer_settime(td, uap->timerid, flags, &val, ovalp);
133133
if (error == 0 && uap->old != NULL) {
134-
error = native_to_linux_itimerspec(&l_val, &val);
134+
error = native_to_linux_itimerspec(&l_oval, &val);
135135
if (error == 0)
136136
error = copyout(&l_oval, uap->old, sizeof(l_oval));
137137
}
@@ -158,7 +158,7 @@ linux_timer_settime64(struct thread *td, struct linux_timer_settime64_args *uap)
158158
return (error);
159159
error = kern_ktimer_settime(td, uap->timerid, flags, &val, ovalp);
160160
if (error == 0 && uap->old != NULL) {
161-
error = native_to_linux_itimerspec64(&l_val, &val);
161+
error = native_to_linux_itimerspec64(&l_oval, &val);
162162
if (error == 0)
163163
error = copyout(&l_oval, uap->old, sizeof(l_oval));
164164
}

0 commit comments

Comments
 (0)