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] [day] [month] [year] [list]
Date:   Tue, 03 Jul 2018 09:28:56 +0200
From:   Richard Weinberger <richard@....at>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Artem Bityutskiy <dedekind1@...il.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        y2038@...ts.linaro.org, Deepa Dinamani <deepa.kernel@...il.com>,
        linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ubifs: tnc: use monotonic znode timestamp

Am Montag, 2. Juli 2018, 16:24:15 CEST schrieb Richard Weinberger:
> Arnd,
> 
> Am Mittwoch, 20. Juni 2018, 10:29:11 CEST schrieb Arnd Bergmann:
> > The tnc uses get_seconds() based timestamps to check the age of a znode,
> > which has two problems: on 32-bit architectures this may overflow in
> > 2038 or 2106, and it gives incorrect information when the system time
> > is updated using settimeofday().
> > 
> > Using montonic timestamps with ktime_get_seconds() solves both thes
> > problems.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > ---
> >  fs/ubifs/shrinker.c | 2 +-
> >  fs/ubifs/tnc.c      | 4 ++--
> >  fs/ubifs/tnc_misc.c | 2 +-
> >  fs/ubifs/ubifs.h    | 2 +-
> >  4 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/fs/ubifs/shrinker.c b/fs/ubifs/shrinker.c
> > index 9a9fb94a41c6..9d10cbdec2cc 100644
> > --- a/fs/ubifs/shrinker.c
> > +++ b/fs/ubifs/shrinker.c
> > @@ -71,7 +71,7 @@ static int shrink_tnc(struct ubifs_info *c, int nr, int age, int *contention)
> >  {
> >  	int total_freed = 0;
> >  	struct ubifs_znode *znode, *zprev;
> > -	int time = get_seconds();
> > +	time64_t time = ktime_get_seconds();
> 
> ubifs does
> 	abs(time - znode->time) >= age) {
> 
> Is this still legit with time64_t?

Answering my own question, yes.
abs() seems to be able to deal with 64bit numbers and time64_t is just a number.

Thanks,
//richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ