Received: by 10.223.164.221 with SMTP id h29csp1084944wrb; Wed, 1 Nov 2017 10:10:21 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T7zm+y0UaIyEtMS/MHApBWQ4ehF5OsZJM+18f1lxpUvW9+Rmdvr5hJ/Q+tEwsrtyVjslh5 X-Received: by 10.99.4.75 with SMTP id 72mr536211pge.400.1509556221512; Wed, 01 Nov 2017 10:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509556221; cv=none; d=google.com; s=arc-20160816; b=AJbaCZZ7oHd4/3O/m/NfmEuJ/jUGa1/gpjux6wFVfgiuTP0pMGVa8v1UV7CIVJZ76x j2z+33TeKaN82EEexg9EnTJMSOV1SYKkuFUwVxv6MTMTD3k/oaRQkO5u+Sup2nZf2wqt lSHh+1yWOqMzQxaZDwja693yRfUhsc4raSGGD7HarsCXblDJBf+XvMYXmzl1y7yv4+2F u31wJr7UIcLOEWPtIRj1abr1EBkTMYG/QutLBdKVo8+JLk6PDjfK+gOpFKkAIpuI9T5Y /TZl0rW/ELp/5H0AD87oBKAAkKx96pmhs7yKCE+5TKDuT/Jj41vWm8LYvtsIcgvNraIv VaBQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=0B8oWQTfr+8H4LAjaAplgAiHgQbFq3IL6x3PHKTrsSo=; b=mrNeJ7mRZL3VEBZ0phH6PMNbFqkKCfI9tLQKcWtO2DE/L6rOP/yImGK6qI5iTgvpFg zvB2oVkylSYo6V7tS/tgeUnXZn5a+YdRsq6w6sRm6xOKNptisu2NYuJi+pQauiQ13VuO kkaUb4eaR4bbcSLL8yjO36UVfDt5q8DRfrpg3FuDQqrAJ0jWFq+/+eq1QmrRmht1gxHg Dy1KSQQcWnfHKVR54/8MUfDuyUop44RbLlPFF2KEFgVJZDCbxnTSb+WCvFjxr3QOxtdm zDLNW9cwy32fLMvATu0Sq8SypEpWJOPhxynRLKdaQ78XZB806A5f88dngLyF2HvJ2nM0 H1Yg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2si131518pls.461.2017.11.01.10.10.07; Wed, 01 Nov 2017 10:10:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752363AbdKARJ0 (ORCPT + 99 others); Wed, 1 Nov 2017 13:09:26 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:60230 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751402AbdKARJZ (ORCPT ); Wed, 1 Nov 2017 13:09:25 -0400 Received: from alans-desktop (82-70-14-226.dsl.in-addr.zen.co.uk [82.70.14.226]) by fuzix.org (8.15.2/8.15.2) with ESMTP id vA1H987V031076; Wed, 1 Nov 2017 17:09:08 GMT Date: Wed, 1 Nov 2017 17:09:08 +0000 From: Alan Cox To: Tejun Heo Cc: Greg Kroah-Hartman , Jiri Slaby , Linus Torvalds , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [BUG] tty: Userland can create hung tasks Message-ID: <20171101170908.6ad08580@alans-desktop> In-Reply-To: <20171101020651.GK3252168@devbig577.frc2.facebook.com> References: <20171101020651.GK3252168@devbig577.frc2.facebook.com> Organization: is over-rated X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Oct 2017 19:06:51 -0700 Tejun Heo wrote: > Hello, > > tty hangup code doesn't mark the console as being HUPed for, e.g., > /dev/console and that can put the session leader trying to > disassociate from the controlling terminal in an indefinite D sleep. > > Looking at the code, I have no idea why some tty devices are never > marked being hung up. It *looks* intentional and dates back to the > git origin but I couldn't find any clue. The following patch is a > workaround which fixes the observed problem but definitely isn't the > proper fix. Two reasons 1. It broke the serial consoles because they would hang up and close down the hardware. With tty_port that *should* be fixable properly for any cases remaining. 2. The console layer was (and still is) completely broken and doens't refcount properly. So if you turn on console hangups it breaks (as indeed does freeing consoles and half a dozen other things). Sadly it seems that nobody cares about the console. Alan From 1582827644895169780@xxx Wed Nov 01 02:07:52 +0000 2017 X-GM-THRID: 1582827644895169780 X-Gmail-Labels: Inbox,Category Forums