Print this page
OS-5566 ppoll timeout calculation can overflow
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Alex Wilson <alex.wilson@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/time.h
          +++ new/usr/src/uts/common/sys/time.h
↓ open down ↓ 7 lines elided ↑ open up ↑
   8    8   * specifies the terms and conditions for redistribution.
   9    9   */
  10   10  
  11   11  /*
  12   12   * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  13   13   *
  14   14   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  15   15   * Use is subject to license terms.
  16   16   *
  17   17   * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       18 + * Copyright 2016 Joyent, Inc.
  18   19   */
  19   20  
  20   21  /*
  21   22   * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
  22   23   */
  23   24  
  24   25  #ifndef _SYS_TIME_H
  25   26  #define _SYS_TIME_H
  26   27  
  27   28  #include <sys/feature_tests.h>
↓ open down ↓ 226 lines elided ↑ open up ↑
 254  255  
 255  256  #ifndef _ASM
 256  257  
 257  258  /*
 258  259   * Time expressed as a 64-bit nanosecond counter.
 259  260   */
 260  261  typedef longlong_t      hrtime_t;
 261  262  
 262  263  #if defined(_KERNEL) || defined(_FAKE_KERNEL)
 263  264  
      265 +/*
      266 + * Unsigned counterpart to hrtime_t
      267 + */
      268 +typedef u_longlong_t    uhrtime_t;
      269 +
      270 +#define HRTIME_MAX      LLONG_MAX
      271 +#define UHRTIME_MAX     ULLONG_MAX
      272 +
 264  273  #include <sys/time_impl.h>
 265  274  #include <sys/mutex.h>
 266  275  
 267  276  extern int tick_per_msec;       /* clock ticks per millisecond (may be zero) */
 268  277  extern int msec_per_tick;       /* milliseconds per clock tick (may be zero) */
 269  278  extern int usec_per_tick;       /* microseconds per clock tick */
 270  279  extern int nsec_per_tick;       /* nanoseconds per clock tick */
 271  280  
 272  281  /*
 273  282   * Macros to convert from common units of time (sec, msec, usec, nsec,
↓ open down ↓ 208 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX