Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp169689imm; Tue, 28 Aug 2018 19:25:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbKbmsH1QFG2pikvx32cAOx4AO6yVX64HQMBg+zoCSTKnRNagruxFA4xMoFvktBQJC+GvtF X-Received: by 2002:a17:902:a24:: with SMTP id 33-v6mr3898603plo.293.1535509524584; Tue, 28 Aug 2018 19:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535509524; cv=none; d=google.com; s=arc-20160816; b=uKS1MEcXlWLzSGmAld1B2YGU2/6BYv9WK7nLrZO/k1P19vxI6lIjlzP2WsThofImRP U28ZbdUw2r3UGUqvs1DNYiPcfVHtqr110hdkCZdf11gB2CD/N5sKcVymKV8144PsJvd1 vL1cOxg4pymuJKyy5cBIjJ7oq6zLGyT8zPcMHpcw0s5fFTA8z9Um4fmGDwq2XkafcK8u RmxP2W2JAFyLbRVtX2Izfh6T+EUhFy33g2Ot7rQ89KgFsjryHtdbUJLe6MbxoYcnkS/1 MvTZ4EeP8fAQn7HDFhMairK+ABd9aSWllSwVJgJ3YIPp2hjxY0JhxaUByBK90KFW9/vG iaRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=9lT82Va3OFQGc4TMQuT/0EsfvOn0U4QTm1pkVepw5e0=; b=FVtUjEr+Z32K4CTa4pqzAO776IEvwjBIybLrVbqkVOObqeD6Qnt4DhnVhU5OGH1ete 0Bmf+GIRyFg5vaBujuiwro6rIpiyWZZYRMHHjUDwop/WhNldTOY/XroWTVWG+RPipsbO j6CgacAxNYrpWgLRVyj+Yh+7QvDPq+ylYb9rAeSfw/ebcELamWVJn+U5e8RZmp3pY/vK nD044sh+nIe2ksOKgvN5YOEdlXKN+QyQ22xAtPaHTxECyNbBGDgDj9HOsV89uDPhfHOw 9NbGzjYUUICitnqN13CWtez6JZWDJrDQvQvcFNL7QzQUmszav43Bk0SKfx2/8t38pJli Bafg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=ibxkO2Oe; 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=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h185-v6si2568547pfc.172.2018.08.28.19.25.08; Tue, 28 Aug 2018 19:25:24 -0700 (PDT) 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; dkim=pass header.i=@arista.com header.s=googlenew header.b=ibxkO2Oe; 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=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727204AbeH2GS1 (ORCPT + 99 others); Wed, 29 Aug 2018 02:18:27 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:42965 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbeH2GS1 (ORCPT ); Wed, 29 Aug 2018 02:18:27 -0400 Received: by mail-ed1-f66.google.com with SMTP id l5so139441edw.9 for ; Tue, 28 Aug 2018 19:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9lT82Va3OFQGc4TMQuT/0EsfvOn0U4QTm1pkVepw5e0=; b=ibxkO2OeiGfl5FnQ8R+MdJ0WZSPo7yJh2RAWWuzBtz8dieHoMgU1v8sJH8XTVtQBWg 75lPUpw4ybvGBBV0l9XTBoG3NinZfXdJ5gFBecrd1KV/qhboKuqM7RJh0i4QPR2G5o7V +SU0q3TE6KcYATjZN5jb3OmNbAOV2GEl3msOK0Fj4Bn5Yx2NAkIVDRT1r2oUpvupuWrI DYj3NqJk5Nr6yPCecWJ2CKxdrGLo8dm7H26F/gyz52OQ29g4ih/qf6McANf2wPBNOmsA ftUcrc8DMtL8Bv6aQOirgvz/UhcTqFLJxVfDuV8z8kjY1BjExv+4rLXMvpzO1B/fyt8r 0FTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9lT82Va3OFQGc4TMQuT/0EsfvOn0U4QTm1pkVepw5e0=; b=oxHgN+KH0EyIqY8OMfxJfW+YjtSdhLotobr6Xpa2BxpLcKCSOf7NOXMaqadXaUIKd4 Tjg450wasMk1xINEON/gGKTMzd2UzMo7HqeBlh3LnBos36Wmo5PQHWkz763Hy2U4PEfF nGdNc7kYM0zCZbXUnGZcZ87FsK89ynmCyQ78c3FWrC5pqWPSKcZC6Th99/SgPAG2NmxP ajlrsmxdIJRD3RKsZ2eRP3WHjS9eOOP4irGjqjXPbULNuDy53KEdfyV0hMy/eGhe7edb hbeqqgCxyZK8kBdXufvby+w9XBpKXVjCzgxHXDLPE1+a/cCN5e3sVHdsUp753DJj8y8F nuDw== X-Gm-Message-State: APzg51Dcs049vAqFfVy7mTRFZTd2xxPvwdH90wAeoj3R3yD2SiaQAQ+4 o4G4ikdBUmCIFfGIulBu5fdC6TewxBc= X-Received: by 2002:a50:c05a:: with SMTP id u26-v6mr5077430edd.107.1535509435005; Tue, 28 Aug 2018 19:23:55 -0700 (PDT) Received: from dhcp.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id f26-v6sm1236367edb.28.2018.08.28.19.23.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Aug 2018 19:23:54 -0700 (PDT) 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 , =?UTF-8?q?Pasi=20K=C3=A4rkk=C3=A4inen?= , Peter Hurley , Sergey Senozhatsky , Tan Xiaojun , Greg Kroah-Hartman , Jiri Slaby , stable@vger.kernel.org Subject: [PATCH 0/4] tty: Hold write ldisc sem in tty_reopen() Date: Wed, 29 Aug 2018 03:23:49 +0100 Message-Id: <20180829022353.23568-1-dima@arista.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Two fixes for potential and real issues. Looks 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. I couldn't verify that holding write lock fixes the issue as we've hit it only once and I've failed in reproducing it. But searching in lkml, Cc'ing here people who probably had the same crash (and in hope someone of them could give tested-by): Cc: Daniel Axtens Cc: Dmitry Vyukov Cc: Michael Neuling Cc: Mikulas Patocka Cc: Pasi Kärkkäinen Cc: Peter Hurley Cc: Sergey Senozhatsky Cc: Tan Xiaojun (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: Lock tty pair in tty_init_dev() tty/lockdep: Add ldisc_sem asserts drivers/tty/tty_io.c | 21 +++++++++++++++------ drivers/tty/tty_ldisc.c | 12 ++++++++---- include/linux/tty.h | 4 ++++ 3 files changed, 27 insertions(+), 10 deletions(-) -- 2.13.6