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, 11 Jan 2017 16:57:32 +0000
From:   Chris Wilson <chris@...is-wilson.co.uk>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org, Waiman Long <Waiman.Long@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        "Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] locking/mutex: Clear mutex-handoff flag on interrupt

On Wed, Jan 11, 2017 at 05:43:02PM +0100, Peter Zijlstra wrote:
> On Mon, Jan 09, 2017 at 11:52:03AM +0000, Chris Wilson wrote:
> > If we abort the mutex_lock() due to an interrupt, or other error from
> 
> s/interrupt/signal/, right?

Yes. EINTR is ingrained.
 
> > ww_mutex, we need to relinquish the handoff flag if we applied it.
> > Otherwise, we may cause missed wakeups as the current owner may try to
> > handoff to a new thread that is not expecting the handoff and so sleep
> > thinking the lock is already claimed (and since the owner unlocked there
> > may never be a new wakeup).
> 
> Isn't that the exact same scenario as Nicolai fixed here:
> 
>   http://lkml.kernel.org/r/1482346000-9927-3-git-send-email-nhaehnle@gmail.com
> 
> Did you, like Nicolai, find this by inspection, or can you reproduce?

Looks like it should be. It takes about 20 minutes of running a stress
test, but it is very reliably hit on the current kernel.

> FWIW, I have the below patch that should also solve this problem afaict.

Thanks, I shall see if makes my machines happy.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ