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: <20190328101726.u2y7v46mo66i5aoi@linutronix.de>
Date:   Thu, 28 Mar 2019 11:17:26 +0100
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Juri Lelli <juri.lelli@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     linux-rt-users <linux-rt-users@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Clark Williams <williams@...hat.com>
Subject: Re: [RT WARNING] DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) !=
 current) with fsfreeze (4.19.25-rt16)

On 2019-03-26 10:34:21 [+0100], Juri Lelli wrote:
> Hi,
Hi,

…
>  # for I in `seq 10`; do fsfreeze -f ./testmount; sleep 1; fsfreeze -u ./testmount; done
> 
>  ------------[ cut here ]------------
>  DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current)
>  WARNING: CPU: 10 PID: 1226 at kernel/locking/rtmutex-debug.c:145 debug_rt_mutex_unlock+0x9b/0xb0
>  Modules linked in: xfs [...]
>  CPU: 10 PID: 1226 Comm: fsfreeze Not tainted 4.19.25-rt16 #2
>  Hardware name: LENOVO 30B6S2F900/1030, BIOS S01KT61A 09/28/2018
>  RIP: 0010:debug_rt_mutex_unlock+0x9b/0xb0
…
>   __rt_mutex_unlock+0x45/0x80
>   percpu_up_write+0x4b/0x60
>   thaw_super_locked+0xdb/0x110
…
> AFAIU, this is a legit warning, since
> 
>  fsfreeze -f ./testmount grabs rt_mutexes embedded into
>  sb->s_writers.rw_sem[SB_FREEZE_LEVELS] (rt-rwsem) as part of executing
>  sb_wait_write() (for each FREEZE_LEVEL) in freeze_super().
> 
>  We then return to userspace.
> 
>  fsfreeze -u ./testmount unlocks the rt_mutexes while doing
>  sb_freeze_unlock() in thaw_super_locked(). This is a different process
>  w.r.t. the one that did the freeze above.
> 
> I noticed that a very similar problem was fixed (for !rt rwsem) by
> 5a817641f68a ("locking/percpu-rwsem: Annotate rwsem ownership transfer
> by setting RWSEM_OWNER_UNKNOWN"). However, RT has of course to deal with
> PI, so I wonder if there is an easy fix for this problem.
> 
> Suggestions?

So we leave to userland with an acquired rtmutex. And lockdep doesn't
complain because lockdep_sb_freeze_release() /
lockdep_sb_freeze_acquire() informs that everything is okay.
I have no idea, PeterZ? The rwsem is not ownerless afaik.

> Thanks,
> 
> - Juri

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ