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:   Mon, 21 Jun 2021 09:29:51 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, benh@...nel.crashing.org,
        boqun.feng@...il.com, bp@...en8.de, catalin.marinas@....com,
        dvyukov@...gle.com, elver@...gle.com, ink@...assic.park.msu.ru,
        jonas@...thpole.se, juri.lelli@...hat.com, linux@...linux.org.uk,
        luto@...nel.org, mattst88@...il.com, mingo@...hat.com,
        monstr@...str.eu, mpe@...erman.id.au, paulmck@...nel.org,
        paulus@...ba.org, peterz@...radead.org, rth@...ddle.net,
        shorne@...il.com, stefan.kristiansson@...nalahti.fi,
        vincent.guittot@...aro.org, will@...nel.org
Subject: Re: [RFC PATCH 01/10] thread_info: add helpers to snapshot thread
 flags

On Sun, Jun 20, 2021 at 12:28:04AM +0200, Thomas Gleixner wrote:
> On Wed, Jun 09 2021 at 13:19, Mark Rutland wrote:
> > We have common helpers to manipulate individual thread flags, but where
> > code wants to check several flags at once, it must open code reading
> > current_thread_info()->flags and operating on a snapshot.
> 
> Who's we?

Locally I've changed that to:

| In <linux/thread_info.h> there are helpers to [...]

Please shout if there's a better way of wording that!

> > As some flags can be set remotely it's necessary to use READ_ONCE() to
> > get a consistent snapshot even when IRQs are disabled, but some code
> > forgets to do this. Generally this is unlike to cause a problem in
> > practice, but it is somewhat unsound, and KCSAN will legitimately warn
> > that there is a data race.
> >
> > To make it easier to do the right thing, and to highlight that
> > concurrent modification is possible, let's add a new helpers to
> > snapshot
> 
> let's add? Why not simply "add"?

Done.

> > +static inline unsigned long read_ti_thread_flags(struct thread_info *ti)
> 
> __always_inline() as Marco pointed out already
> 
> Other than those nitpicks:
> 
>  Reviewed-by: Thomas Gleixner <tglx@...utronix.de>

Thanks!

Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ