Use copyout to access user memory.
Submittted by: pho MFC After: 2 days
This commit is contained in:
parent
1f17965656
commit
a11acc6f8a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108896
@ -306,6 +306,7 @@ int sched_rr_get_interval(struct thread *td,
|
||||
{
|
||||
int e;
|
||||
struct thread *targettd;
|
||||
struct timespec timespec;
|
||||
struct proc *targetp;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
@ -326,7 +327,10 @@ int sched_rr_get_interval(struct thread *td,
|
||||
PROC_UNLOCK(targetp);
|
||||
if (e == 0) {
|
||||
e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd,
|
||||
uap->interval);
|
||||
×pec);
|
||||
if (e == 0)
|
||||
e = copyout(×pec, uap->interval,
|
||||
sizeof(timespec));
|
||||
}
|
||||
done2:
|
||||
mtx_unlock(&Giant);
|
||||
|
@ -306,6 +306,7 @@ int sched_rr_get_interval(struct thread *td,
|
||||
{
|
||||
int e;
|
||||
struct thread *targettd;
|
||||
struct timespec timespec;
|
||||
struct proc *targetp;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
@ -326,7 +327,10 @@ int sched_rr_get_interval(struct thread *td,
|
||||
PROC_UNLOCK(targetp);
|
||||
if (e == 0) {
|
||||
e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd,
|
||||
uap->interval);
|
||||
×pec);
|
||||
if (e == 0)
|
||||
e = copyout(×pec, uap->interval,
|
||||
sizeof(timespec));
|
||||
}
|
||||
done2:
|
||||
mtx_unlock(&Giant);
|
||||
|
Loading…
Reference in New Issue
Block a user