Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Apr 2017 15:30:29 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r316967 - stable/11/sys/compat/linux
Message-ID:  <201704151530.v3FFUTot088210@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704151530.v3FFUTot088210>