Project

General

Profile

Bug #4811

in.mpathd: tv2ns suffers from an integer overflow bug

Added by Josef Sipek almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2014-04-25
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

tv2ns multiplies time_t with NANOSEC:

return (tvp->tv_sec * NANOSEC + tvp->tv_usec * 1000);

Since time_t is 32-bit int and NANOSEC is 32-bit int, the product is calculated using 32-bit arithmetic.


Related issues

Related to illumos gate - Bug #4809: NANOSEC should be 'long long' to avoid integer overflow bugsClosed2014-04-25

Actions

History

#1

Updated by Electric Monk almost 5 years ago

  • Status changed from New to Closed
  • % Done changed from 80 to 100

git commit b59e2127f21675e88c58a4dd924bc55eeb83c7a6

commit  b59e2127f21675e88c58a4dd924bc55eeb83c7a6
Author: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Date:   2014-04-29T15:42:11.000Z

    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>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

#2

Updated by Robert Mustacchi almost 5 years ago

  • Tags deleted (needs-triage)

Also available in: Atom PDF