Added check for negative seconds value. Found by syscall() fuzzing.
MFC after: 1 week
This commit is contained in:
parent
1a1f41b8fe
commit
7bbcd22d38
@ -474,7 +474,8 @@ kern_thr_suspend(struct thread *td, struct timespec *tsp)
|
||||
}
|
||||
|
||||
if (tsp != NULL) {
|
||||
if (tsp->tv_nsec < 0 || tsp->tv_nsec > 1000000000)
|
||||
if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 ||
|
||||
tsp->tv_nsec > 1000000000)
|
||||
return (EINVAL);
|
||||
if (tsp->tv_sec == 0 && tsp->tv_nsec == 0)
|
||||
error = EWOULDBLOCK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user