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:   Sun, 12 Jun 2022 11:43:47 -0400
From:   Sasha Levin <sashal@...nel.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     linux-kernel@...r.kernel.org,
        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>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Theodore Ts'o <tytso@....edu>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] locking/lockdep: Use sched_clock() for random numbers.

On Tue, May 17, 2022 at 11:16:14AM +0200, Sebastian Andrzej Siewior wrote:
>Since the rewrote of prandom_u32(), in the commit mentioned below, the
>function uses sleeping locks which extracing random numbers and filling
>the batch.
>This breaks lockdep on PREEMPT_RT because lock_pin_lock() disables
>interrupts while calling __lock_pin_lock(). This can't be moved earlier
>because the main user of the function (rq_pin_lock()) invokes that
>function after disabling interrupts in order to acquire the lock.
>
>The cookie does not require random numbers as its goal is to provide a
>random value in order to notice unexpected "unlock + lock" sites.
>
>Use sched_clock() to provide random numbers.
>
>Fixes: a0103f4d86f88 ("random32: use real rng for non-deterministic randomness")
>Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
>---
>
>So if the architecture does not provide sched_clock() and does not
>enabled GENERIC_SCHED_CLOCK then we use jiffies here. Most of them do
>one or the other except for alpha, csky, hexagon, ... but I don't worry
>here since arm*, power*, x86* do provide it.

I'm seeing hangs on AMD based machines with lockdep enabled, and
bisected the issue to a0103f4d86f88 ("random32: use real rng for
non-deterministic randomness").

No hangs on Intel/arm64, no hangs with lockdep disabled.

Spotted this patch on the list, and confirmed that it addresses the
issue I'm seeing.

-- 
Thanks,
Sasha

Powered by blists - more mailing lists