lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190923201938.GB4141@piout.net>
Date:   Mon, 23 Sep 2019 22:19:38 +0200
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Nick Crews <ncrews@...omium.org>
Cc:     Pavel Machek <pavel@....cz>, Benson Leung <bleung@...omium.org>,
        Alessandro Zummo <a.zummo@...ertech.it>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Duncan Laurie <dlaurie@...omium.org>
Subject: Re: [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations

On 23/09/2019 11:20:42-0600, Nick Crews wrote:
> > This is coming from struct tm, it is part of C89 but I think I was not
> > born when this decision was made. man rtc properly reports that those
> > fields are unused and no userspace tools are actually making use of
> > them. Nobody cares about the broken down representation of the time.
> > What is done is use the ioctl then mktime to have a UNIX timestamp.
> >
> > "The mktime function ignores the specified contents of the tm_wday,
> > tm_yday, tm_gmtoff, and tm_zone members of the broken-down time
> > structure. It uses the values of the other components to determine the
> > calendar time; it’s permissible for these components to have
> > unnormalized values outside their normal ranges. The last thing that
> > mktime does is adjust the components of the brokentime structure,
> > including the members that were initially ignored."
> 
> This is very non-obvious and I only knew this from talking to you,
> Alexandre. Perhaps we should add this note to the RTC core,
> such as in the description for rtc_class_ops?
> 

I'm planning to add documentation on what should be done in an RTC
driver, I'll ensure to add something on this topic.

> For this patch, do you want me to make any further changes?
> 

No need for any changes, however, I can't apply it right now because we
are in the middle of the merge window.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ