summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2017-04-15 15:29:16 +0000
committerdchagin <dchagin@FreeBSD.org>2017-04-15 15:29:16 +0000
commit2294073c02b1cc4affd731619f63d8a291d583c5 (patch)
tree010802ea3cad83af558c3b7ec3a542165ff974ed
parentc448b0539fd7ea2ddccf76c00ef12a4320c3300f (diff)
downloadFreeBSD-src-2294073c02b1cc4affd731619f63d8a291d583c5.zip
FreeBSD-src-2294073c02b1cc4affd731619f63d8a291d583c5.tar.gz
MFC r315498:
Check for negative nanoseconds. Linux do that in timespec_valid().
-rw-r--r--sys/compat/linux/linux_time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c
index 979ea3e..5c66b1a 100644
--- a/sys/compat/linux/linux_time.c
+++ b/sys/compat/linux/linux_time.c
@@ -142,7 +142,7 @@ linux_to_native_timespec(struct timespec *ntp, struct l_timespec *ltp)
LIN_SDT_PROBE2(time, linux_to_native_timespec, entry, ntp, ltp);
- if (ltp->tv_sec < 0 || ltp->tv_nsec > (l_long)999999999L) {
+ if (ltp->tv_sec < 0 || (l_ulong)ltp->tv_nsec > 999999999L) {
LIN_SDT_PROBE1(time, linux_to_native_timespec, return, EINVAL);
return (EINVAL);
}
OpenPOWER on IntegriCloud