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]
Date:	Wed, 14 Jan 2015 18:03:45 +0100
From:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
To:	Xunlei Pang <pang.xunlei@...aro.org>
Cc:	Xunlei Pang <xlpang@....com>, lkml <linux-kernel@...r.kernel.org>,
	John Stultz <john.stultz@...aro.org>,
	Arnd Bergmann <arnd.bergmann@...aro.org>,
	"rtc-linux@...glegroups.com" <rtc-linux@...glegroups.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Alessandro Zummo <a.zummo@...ertech.it>
Subject: Re: [RFC PATCH v2 5/9] rtc/mc13xxx: Update driver to address
 y2038/y2106 issues

Hello,

On Wed, Jan 14, 2015 at 11:07:31PM +0800, Xunlei Pang wrote:
> Cc Uwe Kleine-Koenig <u.kleine-koenig@...gutronix.de>
Thanks, that was useful.

> 
> On 13 January 2015 at 23:44, Xunlei Pang <xlpang@....com> wrote:
> > From: Xunlei Pang <pang.xunlei@...aro.org>
> >
> > This driver has a number of y2038/y2106 issues.
> >
> > This patch resolves them by:
> > - Replace rtc_time_to_tm() with rtc_time64_to_tm()
> > - Change mc13xxx_rtc_set_mmss() to use rtc_class_ops's set_mmss64()
> >
> > After this patch, the driver should not have any remaining
> > y2038/y2106 issues.
> >
> > Signed-off-by: Xunlei Pang <pang.xunlei@...aro.org>
> > ---
> >  drivers/rtc/rtc-mc13xxx.c | 32 ++++++++++++++------------------
> >  1 file changed, 14 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-mc13xxx.c b/drivers/rtc/rtc-mc13xxx.c
> > index 5bce904b..32df1d8 100644
> > --- a/drivers/rtc/rtc-mc13xxx.c
> > +++ b/drivers/rtc/rtc-mc13xxx.c
> > @@ -83,20 +83,19 @@ static int mc13xxx_rtc_read_time(struct device *dev, struct rtc_time *tm)
> >                         return ret;
> >         } while (days1 != days2);
> >
> > -       rtc_time_to_tm(days1 * SEC_PER_DAY + seconds, tm);
> > +       rtc_time64_to_tm((time64_t)days1 * SEC_PER_DAY + seconds, tm);
> >
> >         return rtc_valid_tm(tm);
> >  }
> >
> > -static int mc13xxx_rtc_set_mmss(struct device *dev, unsigned long secs)
> > +static int mc13xxx_rtc_set_mmss(struct device *dev, time64_t secs)
I don't know if there is a usual conversion rule, but I'd expect that
the function is also renamed to get a suffix 64.

Other than that the patch looks good.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ