NetBSD, architecture-dependent issues and forthcoming projects

| No Comments | No TrackBacks
We've been talking to a kernel developer of the NetBSD project (probably the most portable operating system out there), regarding its security status and some potential enhancements. While reading through the secmodel securelevel source, we spotted this interesting snippet:
case KAUTH_REQ_SYSTEM_TIME_SYSTEM: {

 struct timespec *ts = arg1;
 struct timeval *delta = arg2;
 
/*
  * Don't allow the time to be set forward so far it will wrap
  * and become negative, thus allowing an attacker to bypass
  * the next check below.  The cutoff is 1 year before rollover
  * occurs, so even if the attacker uses adjtime(2) to move
  * the time past the cutoff, it will take a very long time
  * to get to the wrap point.
  *
  * XXX: we check against INT_MAX since on 64-bit
  *      platforms, sizeof(int) != sizeof(long) and
  *      time_t is 32 bits even when atv.tv_sec is 64 bits.
  */

 if (securelevel > 1 &&
     ((ts->tv_sec > INT_MAX - 365*24*60*60) ||
      (delta->tv_sec < 0 || delta->tv_usec < 0)))
 	result = KAUTH_RESULT_DENY;

break;
}

No TrackBacks

TrackBack URL: http://www.subreption.com/mt/mt-tb.fcgi/85

Leave a comment

About this Entry

This page contains a single entry by Subreption LLC published on January 22, 2008 9:23 PM.

QA Hell: Quicktime again! was the previous entry in this blog.

Security decisions from the past: to cache or not to cache is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.