svn commit: r316967 - stable/11/sys/compat/linux

Dmitry Chagin dchagin at FreeBSD.org
Sat Apr 15 15:30:30 UTC 2017


Author: dchagin
Date: Sat Apr 15 15:30:28 2017
New Revision: 316967
URL: https://svnweb.freebsd.org/changeset/base/316967

Log:
  MFC r316393:
  
  As noted by bde@ negative tv_sec values are not checked for overflow,
  so overflow can still occur. Fix that. Also remove the extra check for
  tv_sec size as under COMPAT_LINUX32 it is always true.

Modified:
  stable/11/sys/compat/linux/linux_time.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linux/linux_time.c
==============================================================================
--- stable/11/sys/compat/linux/linux_time.c	Sat Apr 15 15:29:16 2017	(r316966)
+++ stable/11/sys/compat/linux/linux_time.c	Sat Apr 15 15:30:28 2017	(r316967)
@@ -125,8 +125,7 @@ native_to_linux_timespec(struct l_timesp
 
 	LIN_SDT_PROBE2(time, native_to_linux_timespec, entry, ltp, ntp);
 #ifdef COMPAT_LINUX32
-	if (ntp->tv_sec > INT_MAX &&
-	    sizeof(ltp->tv_sec) != sizeof(ntp->tv_sec))
+	if (ntp->tv_sec > INT_MAX || ntp->tv_sec < INT_MIN)
 		return (EOVERFLOW);
 #endif
 	ltp->tv_sec = ntp->tv_sec;


More information about the svn-src-all mailing list