From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933145AbcATMIN (ORCPT ); Wed, 20 Jan 2016 07:08:13 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:45866 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932744AbcATMIJ (ORCPT ); Wed, 20 Jan 2016 07:08:09 -0500 Date: Wed, 20 Jan 2016 13:07:52 +0100 From: Peter Zijlstra To: Dmitry Vyukov Cc: One Thousand Gnomes , Ingo Molnar , Greg Kroah-Hartman , Jiri Slaby , LKML , J Freyensee , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin , Eric Dumazet Subject: Re: tty: deadlock between n_tracerouter_receivebuf and flush_to_ldisc Message-ID: <20160120120752.GQ3421@worktop> References: <20160115163300.063c224d@lxorguk.ukuu.org.uk> <20160120114430.GA25010@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2016 at 12:54:55PM +0100, Dmitry Vyukov wrote: > On Wed, Jan 20, 2016 at 12:44 PM, Peter Zijlstra wrote: > > On Wed, Jan 20, 2016 at 10:36:01AM +0100, Dmitry Vyukov wrote: > > > >> +Peter, Ingo, can you please suggest a way to annotate this locking > >> pattern to avoid lockdep false positive? > > > > No, because I haven't a clue what the actual problem is. > > > > The report is fairly clear on how: > > > > routelock > > &port->buf.lock/1 > > &o_tty->termios_rwsem/1 > > &buf->lock > > > > gets established, and shows where we try: > > > > &buf->lock > > routelock > > > > Which gives a circle, ergo deadlock. > > > > Show which link is wrong and why, and I can suggest ways of annotating > > that. > > > Alan provided an explanation calling this "false report": > https://groups.google.com/d/msg/syzkaller/YrV0bzdfa-g/cCVoUf1OFQAJ I read that, I didn't understand it. Which link is wrong and why? > And I don't understand how the following is a deadlock, since there is > no cycle... > > Possible unsafe locking scenario: > CPU0 CPU1 > ---- ---- > lock(&buf->lock); > lock(&o_tty->termios_rwsem/1); > lock(&buf->lock); > lock(routelock); Ignore the stupid picture, it only really works for simple cases.