Bug #4811

in.mpathd: tv2ns suffers from an integer overflow bug

Added by Josef Sipek over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:2014-04-25
Priority:NormalDue date:
Assignee:Josef Sipek% Done:

100%

Category:cmd - userland programs
Target version:-
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 bugs Closed 2014-04-25

History

#1 Updated by Electric Monk over 4 years ago

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

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 over 4 years ago

  • Tags deleted (needs-triage)

Also available in: Atom