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]
Message-ID: <YJukIUXFVdp1Fr7t@lx-t490>
Date:   Wed, 12 May 2021 11:47:13 +0200
From:   "Ahmed S. Darwish" <a.darwish@...utronix.de>
To:     Davidlohr Bueso <dave@...olabs.net>
Cc:     bigeasy@...utronix.de, peterz@...radead.org, tglx@...utronix.de,
        shung-hsi.yu@...e.com, linux-kernel@...r.kernel.org,
        Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH] seqlock,lockdep: Only check for preemption_disabled in
 non-rt

On Fri, May 07, 2021, Davidlohr Bueso wrote:
> This silences the writer hitting this nonsensical warning on PREEMPT_RT.
>
> Reported-by: Shung-Hsi Yu <shung-hsi.yu@...e.com>
> Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
> ---
>  include/linux/seqlock.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
> index f61e34fbaaea..c8f9253f1a2f 100644
> --- a/include/linux/seqlock.h
> +++ b/include/linux/seqlock.h
> @@ -268,7 +268,9 @@ static inline bool __seqprop_preemptible(const seqcount_t *s)
>
>  static inline void __seqprop_assert(const seqcount_t *s)
>  {
> +#ifndef CONFIG_PREEMPT_RT
>  	lockdep_assert_preemption_disabled();
> +#endif
>  }
>

Nope, it is more complicated than that.

In general, for RT, seqcount_LOCKNAME_t variants should be used instead
of plain seqcount_t, as they can be safely used while preemption is
enabled on the write side.

For plain seqcount_t (which __seqprop_assert() is about), preemption
must be disabled, even for PREEMPT_RT. So the patch above is invalid.

Now, there are still some call sites in the kernel which needs
conversion obviously. I have a large patch series in queue which convert
a number of remaining networking call sites (the changes are locking
algorithm changes, not just direct substitution).

Good luck,

--
Ahmed S. Darwish
Linutronix GmbH

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ