Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Dec 2014 02:14:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 195868] New: Integer overflow in kern/subr_clock.c : clock_ct_to_ts() [patch]
Message-ID:  <bug-195868-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195868

            Bug ID: 195868
           Summary: Integer overflow in kern/subr_clock.c :
                    clock_ct_to_ts() [patch]
           Product: Base System
           Version: 10.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: leo@sai.msu.ru

Created attachment 150452
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=150452&action=edit
Patch for integer overflow

How to repeat: set RTC 99 year by BIOS
Result: Error message "Invalid time in real time clock" in system log
Expected: system time must be set to 2099

Integer overflow for case sizeof(time_t) > 4 at operator:
kern/subr_clock.c:
clock_ct_to_ts(struct clocktime *ct, struct timespec *ts)
{
        time_t secs;
        int i, year, days;
....
        secs = ((days * 24 + ct->hour) * 60 + ct->min) * 60 + ct->sec;

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-195868-8>