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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iK12QGBagUiNr+j-ToawJ9J1behtySyL9vLattYPAD-7w@mail.gmail.com>
Date:   Wed, 6 Nov 2019 10:19:44 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        syzbot <syzkaller@...glegroups.com>
Subject: Re: [PATCH] hrtimer: Annotate lockless access to timer->state

On Wed, Nov 6, 2019 at 10:09 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> On Wed, 6 Nov 2019, Eric Dumazet wrote:
> > @@ -1013,8 +1013,9 @@ static void __remove_hrtimer(struct hrtimer *timer,
> >  static inline int
> >  remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart)
> >  {
> > -     if (hrtimer_is_queued(timer)) {
> > -             u8 state = timer->state;
> > +     u8 state = timer->state;
>
> Shouldn't that be a read once then at least for consistency sake?

We own the lock here, this is not really needed ?

Note they are other timer->state reads I chose to leave unchanged.

But no big deal if you prefer I can add a READ_ONCE()

Thanks.
>
> > +
> > +     if (state & HRTIMER_STATE_ENQUEUED) {
> >               int reprogram;
>
> Thanks,
>
>         tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ