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:   Fri, 28 Jan 2022 17:19:13 +0100
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     Jonathan Neuschäfer <j.neuschaefer@....net>,
        Andy Lutomirski <luto@...capital.net>,
        LKML <linux-kernel@...r.kernel.org>,
        Theodore Ts'o <tytso@....edu>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
        Waiman Long <longman@...hat.com>,
        Boqun Feng <boqun.feng@...il.com>
Subject: Re: "BUG: Invalid wait context" in invalidate_batched_entropy

On 2022-01-28 17:04:13 [+0100], Jason A. Donenfeld wrote:
> Hi Sebastian/Jonathan,
> 
> On Fri, Jan 28, 2022 at 9:35 AM Sebastian Andrzej Siewior
> <bigeasy@...utronix.de> wrote:
> > This report is due to CONFIG_PROVE_LOCKING=y _and_
> > CONFIG_PROVE_RAW_LOCK_NESTING=y. It reports a nesting problem
> > (raw_spinlock_t -> spinlock_t lock ordering) which becomes a real
> > problem on PREEMPT_RT.
> 
> Hmm, I'm still having a tough time reproducing this. I'm trying to
> understand your intuition. Is the problem you see that something else
> in the IRQ path uses a raw_spinlock_t, and then with that lock still
> held, we call invalidate_batched_entropy(), which takes an ordinary
> spinlock_t, non-raw? And taking a spinlock-t while holding a
> raw_spinlock_t is illegal?

Correct. You must not acquire a spinlock_t while holding a
raw_spinlock_t. This is because on PREEMPT_RT the spinlock_t is a
sleeping lock while raw_spinlock_t disables preemption/ interrupts and
sleeping is not possible.
	Documentation/locking/locktypes.rst

On non-PREEMPT both lock types (spinlock_t & raw_spinlock_t) behave in
the same way but lockdep can tell them apart with
CONFIG_PROVE_RAW_LOCK_NESTING=y and show code that is problematic on RT.

> Jason

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ