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:   Tue, 20 Aug 2019 20:58:30 +0200
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Karel Zak <kzak@...hat.com>
Cc:     Lennart Poettering <mzxreary@...inter.de>,
        Arnd Bergmann <arnd@...db.de>,
        "Theodore Y. Ts'o" <tytso@....edu>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        John Stultz <john.stultz@...aro.org>,
        Stephen Boyd <sboyd@...nel.org>,
        Florian Weimer <fweimer@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Alistair Francis <alistair.francis@....com>,
        GNU C Library <libc-alpha@...rceware.org>,
        OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Subject: Re: New kernel interface for sys_tz and timewarp?

On 19/08/2019 13:09:03+0200, Karel Zak wrote:
> On Wed, Aug 14, 2019 at 11:32:08AM +0200, Alexandre Belloni wrote:
> > On 14/08/2019 11:09:36+0200, Lennart Poettering wrote:
> > > On Mi, 14.08.19 10:31, Arnd Bergmann (arnd@...db.de) wrote:
> > > 
> > > > - glibc stops passing the caller timezone argument to the kernel
> > > > - the distro kernel disables CONFIG_RTC_HCTOSYS,
> > > >   CONFIG_RTC_SYSTOHC  and CONFIG_GENERIC_CMOS_UPDATE
> > > 
> > > What's the benefit of letting userspace do this? It sounds a lot more
> > > fragile to leave this syncing to userspace if the kernel can do this
> > > trivially on its own.
> 
> Good point, why CONFIG_RTC_SYSTOHC has been added to the kernel? 
> 
> If I good remember than it's because synchronize userspace hwclock 
> with rtc is pretty fragile and frustrating. We have improved this
> hwclock code many times and it will never be perfect. See for example
> hwclock --delay= option, sometimes hwclock has no clue about RTC behaviour.
>  

With a bit of care, we can reliably set the rtc to the system time from
userspace. It takes a bit of time (up to 2 seconds) but it can be
reliably set with an accuracy of a few ms on a slow system and an rtc on
a slow bus or a few ns with a fast system and a fast bus.
I know I did say I would implement it in hwclock and I still didn't
(sorry) but we could do better than the --delay option.

> > It does it trivially and badly:
> > 
> >  -  hctosys will always think the RTC is in UTC so if the RTC is in
> >     local time, you will anyway have up to 12 hours difference until
> > userspace fixes that.
> 
> Cannot we provide all necessary information for example on kernel
> command line, or/and as rtc module option?
> 

We could but from a distro point of view, would that be convenient?

-- 
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