Print this page
4809 NANOSEC should be 'long long' to avoid integer overflow bugs
4810 spa_async_tasks_pending suffers from an integer overflow bug
4811 in.mpathd: tv2ns suffers from an integer overflow bug
Reviewed by: Marcel Telka <marcel.telka@nexenta.com>


 217         TIMEVAL_TO_TIMEVAL32(&(itv32)->it_interval, &(itv)->it_interval); \
 218         TIMEVAL_TO_TIMEVAL32(&(itv32)->it_value, &(itv)->it_value);       \
 219 }
 220 
 221 #define ITIMERVAL_OVERFLOW(itv)                         \
 222         (TIMEVAL_OVERFLOW(&(itv)->it_interval) ||        \
 223         TIMEVAL_OVERFLOW(&(itv)->it_value))
 224 
 225 #endif  /* _SYSCALL32 */
 226 #endif  /* _ASM */
 227 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) ... */
 228 
 229 
 230 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 231 /*
 232  *      Definitions for commonly used resolutions.
 233  */
 234 #define SEC             1
 235 #define MILLISEC        1000
 236 #define MICROSEC        1000000
 237 #define NANOSEC         1000000000
 238 
 239 #define MSEC2NSEC(m)    ((hrtime_t)(m) * (NANOSEC / MILLISEC))
 240 #define NSEC2MSEC(n)    ((n) / (NANOSEC / MILLISEC))
 241 
 242 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 243 
 244 #ifndef _ASM
 245 
 246 /*
 247  * Time expressed as a 64-bit nanosecond counter.
 248  */
 249 typedef longlong_t      hrtime_t;
 250 
 251 #ifdef _KERNEL
 252 
 253 #include <sys/time_impl.h>
 254 #include <sys/mutex.h>
 255 
 256 extern int tick_per_msec;       /* clock ticks per millisecond (may be zero) */
 257 extern int msec_per_tick;       /* milliseconds per clock tick (may be zero) */




 217         TIMEVAL_TO_TIMEVAL32(&(itv32)->it_interval, &(itv)->it_interval); \
 218         TIMEVAL_TO_TIMEVAL32(&(itv32)->it_value, &(itv)->it_value);       \
 219 }
 220 
 221 #define ITIMERVAL_OVERFLOW(itv)                         \
 222         (TIMEVAL_OVERFLOW(&(itv)->it_interval) ||        \
 223         TIMEVAL_OVERFLOW(&(itv)->it_value))
 224 
 225 #endif  /* _SYSCALL32 */
 226 #endif  /* _ASM */
 227 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) ... */
 228 
 229 
 230 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 231 /*
 232  *      Definitions for commonly used resolutions.
 233  */
 234 #define SEC             1
 235 #define MILLISEC        1000
 236 #define MICROSEC        1000000
 237 #define NANOSEC         1000000000LL
 238 
 239 #define MSEC2NSEC(m)    ((hrtime_t)(m) * (NANOSEC / MILLISEC))
 240 #define NSEC2MSEC(n)    ((n) / (NANOSEC / MILLISEC))
 241 
 242 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 243 
 244 #ifndef _ASM
 245 
 246 /*
 247  * Time expressed as a 64-bit nanosecond counter.
 248  */
 249 typedef longlong_t      hrtime_t;
 250 
 251 #ifdef _KERNEL
 252 
 253 #include <sys/time_impl.h>
 254 #include <sys/mutex.h>
 255 
 256 extern int tick_per_msec;       /* clock ticks per millisecond (may be zero) */
 257 extern int msec_per_tick;       /* milliseconds per clock tick (may be zero) */