Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2701987imu; Mon, 19 Nov 2018 04:54:24 -0800 (PST) X-Google-Smtp-Source: AJdET5dyfuSQoSebdFVXphquY10e5p/R66gXg23siPBkL04HfO5hU3s5D8RNw8M+G6QCsDZFhcGa X-Received: by 2002:a62:6d07:: with SMTP id i7-v6mr23643974pfc.146.1542632064750; Mon, 19 Nov 2018 04:54:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542632064; cv=none; d=google.com; s=arc-20160816; b=0k1CJfePSpo2K1zsisTP/fehB4LxP72O8oaooiWREPb+iG2VZFNNyo8BKNDKJS2L96 HUFibCfh2r6Ci36TOo6xlSwwJFB9CEHbAAFNKDwmfXBFAi/dN87qUNNaMWw6f3cSnnLg fTN6tgjPRE+BFWdq46C8+FJXwCqwNfEEwaM0tqvTQfXRGe9eS8tApdpZNITc7TOZX9B5 Kam4zNbOQNRwqME/p7wbAv5yQnCGGUaSs/RqNPsad7lisZLkTCX3qUx0ut92jRMbKvYZ o/rPTHy9Lf7uYokGzh/bckoGyp7DjPkYkFwoo0wB4BCWKc3si1ksgqp+XK+rw/NmoVe/ 1Xwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Xup80kf13he37ZWLsrNLix3v5PdlNSD+jtiul24iakA=; b=MFu9mlj2w6Uc70pmACMWmXOvVc8qnNlITiHKU8k60/FRKW4YpGAuZ03FYzfNz4ixRX P0QjiB+oobW67HHaxhAsOTOTRiKBbSzGPg2EDx9h502TQmBhp7oicARnLc4hfEmSeAMr 3RSO1tDAdYvY1AxrvbLxRV7No8DYYU15YTUQBg1xX9gNFeoeBQN7LhvRm3uoUHWDWTAe fkytEHDqi789CJfGzAasvtPQwc4rkJ6P8dIBZF1zt3GCY+jyOdfvhtOQj2QMaz1BUZny 2IfrRF1ZQRhzN1hx8D0718X8iW3W+YU3q68YC4pWQIQl6pxJ7KOtQE9J0L9nmvVADXKG tp1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si37864233pgq.36.2018.11.19.04.54.09; Mon, 19 Nov 2018 04:54:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728922AbeKSXPr (ORCPT + 99 others); Mon, 19 Nov 2018 18:15:47 -0500 Received: from emh01.mail.saunalahti.fi ([62.142.5.107]:58402 "EHLO emh01.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728831AbeKSXPq (ORCPT ); Mon, 19 Nov 2018 18:15:46 -0500 Received: from ydin.reaktio.net (reaktio.net [85.76.255.15]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 53B20200A7; Mon, 19 Nov 2018 14:52:08 +0200 (EET) Received: by ydin.reaktio.net (Postfix, from userid 1001) id D343436C0F8; Mon, 19 Nov 2018 14:52:08 +0200 (EET) Date: Mon, 19 Nov 2018 14:52:08 +0200 From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= To: Mikulas Patocka Cc: linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com>, Dmitry Safonov , Daniel Axtens , Dmitry Vyukov , Mark Rutland , Michael Neuling , Nathan March , Peter Hurley , Peter Zijlstra , "Rong, Chen" , Sergey Senozhatsky , Tan Xiaojun , Tetsuo Handa , Greg Kroah-Hartman , Jiri Slaby , stable@vger.kernel.org, Jiri Slaby , syzbot+3aa9784721dfb90e984d@syzkaller.appspotmail.com Subject: Re: [PATCHv6 0/7] tty: Hold write ldisc sem in tty_reopen() Message-ID: <20181119125208.GC15229@reaktio.net> References: <20181101002452.5483-1-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181101002452.5483-1-dima@arista.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Mikulas, Any chance you could re-test these v6 patches? It seems you're able to relatively easily trigger the bug on your (pa-risc) environment.. I'd be good to have this series finally acked/merged! Thanks a lot, -- Pasi On Thu, Nov 01, 2018 at 12:24:45AM +0000, Dmitry Safonov wrote: > Hi all, > > Here are fixes that worth to have in the @stable, as they were hit by > different people, including Arista on v4.9 stable. > > And for linux-next - adding lockdep asserts for line discipline changing > code, verifying that write ldisc sem will be held forthwith. > > Mikulas, can you add your tested-by on this patches set again, please? > I tried to reproduce reboot issue on qemu-hppa and even built > cross-compiler for pa-risc.. but was unlucky in reproducing. > > Thanks, > Dima > > Changes since v5: > - Better commit tags > - Hopefully fixed issue with reboot on pa-risc with Debian 5 > > Changes since v4: > - back to lock ldisc with (5*HZ) timeout in tty_reopen() > (LKP report link: lkml.kernel.org/r/<1536940609.3185.29.camel@arista.com>) > - reordered 3/7 with 2/7 for LKP robot > > Changes since v3: > - Added tested-by Mark Rutland (thanks!) > - Dropped patch with smp_wmb() - wrong idea > - lockdep_assert_held() should be actually lockdep_assert_held_exclusive() > - Described why tty_ldisc_open() can be called without ldisc_sem held > for pty slave end (o_tty). > - Added Peter's patch for dropping self-made lockdep annotations > - Fix for a reader(s) of ldisc semaphore waiting for an active reader(s) > > Changes since v2: > - Added reviewed-by tags > - Hopefully, fixed reported by 0-day issue. > - Added optional fix for wait_readers decrement > > Changes since v1: > - Added tested-by/reported-by tags > - Dropped 3/4 (locking tty pair for lockdep sake), > Because of that - not adding lockdep_assert_held() in tty_ldisc_open() > - Added 4/4 cleanup to inc tty->count only on success of > tty_ldisc_reinit() > - lock ldisc without (5*HZ) timeout in tty_reopen() > > v1 link: lkml.kernel.org/r/<20180829022353.23568-1-dima@arista.com> > v2 link: lkml.kernel.org/r/<20180903165257.29227-1-dima@arista.com> > v3 link: lkml.kernel.org/r/<20180911014821.26286-1-dima@arista.com> > v4 link: lkml.kernel.org/r/<20180912001702.18522-1-dima@arista.com> > > Cc: Daniel Axtens > Cc: Dmitry Vyukov > Cc: Mark Rutland > Cc: Michael Neuling > Cc: Mikulas Patocka > Cc: Nathan March > Cc: Pasi K?rkk?inen > Cc: Peter Hurley > Cc: Peter Zijlstra > Cc: "Rong, Chen" > Cc: Sergey Senozhatsky > Cc: Tan Xiaojun > Cc: Tetsuo Handa > (please, ignore if I Cc'ed you mistakenly) > > Dmitry Safonov (6): > tty/ldsem: Wake up readers after timed out down_write() > tty: Hold tty_ldisc_lock() during tty_reopen() > tty: Don't block on IO when ldisc change is pending > tty: Simplify tty->count math in tty_reopen() > tty/ldsem: Add lockdep asserts for ldisc_sem > tty/ldsem: Decrement wait_readers on timeouted down_read() > > Peter Zijlstra (1): > tty/ldsem: Convert to regular lockdep annotations > > drivers/tty/n_hdlc.c | 4 +-- > drivers/tty/n_r3964.c | 2 +- > drivers/tty/n_tty.c | 8 +++--- > drivers/tty/tty_io.c | 14 ++++++---- > drivers/tty/tty_ldisc.c | 16 +++++++++++ > drivers/tty/tty_ldsem.c | 62 +++++++++++++++++------------------------ > include/linux/tty.h | 7 +++++ > 7 files changed, 63 insertions(+), 50 deletions(-) > > -- > 2.19.1 >