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:   Wed, 12 May 2021 10:44:53 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Davidlohr Bueso <dave@...olabs.net>
Cc:     a.darwish@...utronix.de, bigeasy@...utronix.de, tglx@...utronix.de,
        shung-hsi.yu@...e.com, linux-kernel@...r.kernel.org,
        Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH v2] seqlock,lockdep: Only check for preemption_disabled
 in non-rt

On Fri, May 07, 2021 at 04:47:13PM -0700, 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>
> ---
> 
> v2: Resending because I had left out some small comments I had meant to add.
> 
>  include/linux/seqlock.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
> index f61e34fbaaea..2ce3e1efc9a9 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
>  }
>  
>  #define __SEQ_RT	IS_ENABLED(CONFIG_PREEMPT_RT)
> @@ -529,6 +531,8 @@ static inline void do_write_seqcount_begin_nested(seqcount_t *s, int subclass)
>   * only if the seqcount write serialization lock is associated, and
>   * preemptible.  If readers can be invoked from hardirq or softirq
>   * context, interrupts or bottom halves must be respectively disabled.
> + * The PREEMPT_RT case relies on the reader serializing via LOCK+UNLOCK,
> + * so the context is preemptible.
>   */

I'm confused, and the Changelog is useless. The code you actually
changed is for seqcount_t, which doesn't have an associated LOCK. If
there is a lock, the code should be changed to use the appropriate
seqcount_LOCKNAME_t and the assertion will change into the one found in
__seqprop_##lockname##_assert(), namely:

  lockdep_assert_held(lockmember)


But as is, seqcount_t usage relies on being non-preemptible, even for
PREEMPT_RT, and this is a good thing. Please describe the site that goes
boom and explain things..

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ