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]
Message-ID: <87jzfj9zc5.ffs@tglx>
Date: Tue, 10 Sep 2024 19:46:02 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Jeff Layton <jlayton@...nel.org>, John Stultz <jstultz@...gle.com>,
 Stephen Boyd <sboyd@...nel.org>
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
 linux-kernel@...r.kernel.org, Jeff Layton <jlayton@...nel.org>
Subject: Re: [PATCH v2] timekeeping: don't use seqcount loop in
 ktime_mono_to_any on 64-bit systems

On Tue, Sep 10 2024 at 08:55, Jeff Layton wrote:
> ktime_mono_to_any only fetches the offset inside the loop. This is a
> single word on 64-bit hosts, and seqcount_read_begin implies a full SMP
> barrier.
>
> When BITS_PER_LONG == 64, just do a simple ktime_add instead as there
> is no possibility of getting a torn offset value.
>
> Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
> Signed-off-by: Jeff Layton <jlayton@...nel.org>
> ---
> Thanks for the review so far, Thomas! Hopefully this looks better.
> Disregard my earlier question about making this a static inline too.
> That would require making offsets[] a global symbol, which I don't think
> we want to do.

This still fails to address these:

> Please describe functions with foo() and not foo.

>  Which will make KCSAN complain ...
>
>  So yes, READ_ONCE() is the correct thing todo, but then we want to have
>  the counterpart at the write sides.

KCSAN requires this to be annotated and it's also a good documentation
that this is a intentional unprotected access.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ