#2135 closed defect (fixed)

times() and _times() are subject to integer overflows

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: low Milestone: 5.1
Component: posix Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The clock_t type is defined as unsigned long for RTEMS in Newlib. With a 1ms clock tick an overflow happens after 7 days on 32-bit long targets.

Change History (10)

comment:1 Changed on Jul 30, 2013 at 1:19:19 PM by Joel Sherrill

Replying to comment:1:

Replying to comment:0:

The clock_t type is defined as unsigned long for RTEMS in Newlib. With a 1ms
clock tick an overflow happens after 7 days on 32-bit long targets.

I mean 7 weeks.

CentOS 6.4 has this has clock_t as clock_t which appears to be a long int.
So no better.

comment:2 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

comment:3 Changed on Dec 18, 2014 at 12:29:27 PM by Sebastian Huber

Milestone: 4.115.0
Priority: normallow

comment:4 Changed on Aug 14, 2017 at 12:41:59 AM by Chris Johns

Milestone: 5.04.12.0
Version: 4.114.12

Moving to 4.12.0. Please update and move if this is not valid.

comment:5 Changed on Aug 24, 2017 at 6:55:23 AM by Sebastian Huber

This should change to at least 64-bit just like time_t.

comment:6 Changed on Aug 25, 2017 at 12:37:43 PM by Sebastian Huber <sebastian.huber@…>

In 4f364ef/rtems-source-builder:

4.12: Change clock_t to 64-bit

Update #2135.
Update #3111.

comment:7 Changed on Aug 25, 2017 at 1:37:31 PM by Sebastian Huber

Owner: changed from Joel Sherrill to Sebastian Huber
Status: newaccepted

comment:8 Changed on Sep 6, 2017 at 5:43:52 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: acceptedclosed

In 731e68a3/rtems:

Fix integer overflow problems in times()

An integer overflow may still happen, however, only after 68 years of
system uptime.

Close #2135.

comment:9 Changed on Oct 16, 2017 at 6:17:09 AM by Sebastian Huber

Component: scoreposix

comment:10 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.