From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Dmitry Safonov To: linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Dmitry Safonov , Daniel Axtens , Dmitry Vyukov , Michael Neuling , Mikulas Patocka , Nathan March , =?UTF-8?q?Pasi=20K=C3=A4rkk=C3=A4inen?= , Peter Hurley , Sergey Senozhatsky , Tan Xiaojun , Tetsuo Handa , Greg Kroah-Hartman , Jiri Slaby , stable@vger.kernel.org, Tetsuo Handa , syzbot+3aa9784721dfb90e984d@syzkaller.appspotmail.com Subject: [PATCHv2 0/4] tty: Hold write ldisc sem in tty_reopen() Date: Mon, 3 Sep 2018 17:52:53 +0100 Message-Id: <20180903165257.29227-1-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: The first two fixes are worth to have in stables as we've hit it 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. 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> Huuge cc list: Cc: Daniel Axtens Cc: Dmitry Vyukov Cc: Michael Neuling Cc: Mikulas Patocka Cc: Nathan March Cc: Pasi Kärkkäinen Cc: Peter Hurley Cc: Sergey Senozhatsky Cc: Tan Xiaojun Cc: Tetsuo Handa (please, ignore if I Cc'ed you mistakenly) Dmitry Safonov (4): tty: Drop tty->count on tty_reopen() failure tty: Hold tty_ldisc_lock() during tty_reopen() tty/lockdep: Add ldisc_sem asserts tty: Simplify tty->count math in tty_reopen() drivers/tty/tty_io.c | 12 ++++++++---- drivers/tty/tty_ldisc.c | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) -- 2.13.6