From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753956AbcCZTGx (ORCPT ); Sat, 26 Mar 2016 15:06:53 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:36386 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753339AbcCZTGu (ORCPT ); Sat, 26 Mar 2016 15:06:50 -0400 Subject: Re: [PATCH v2 09/10] tty: Consolidate noctty checks in tty_open() To: Richard Weinberger References: <1448677557-16420-1-git-send-email-peter@hurleysoftware.com> <1452402833-8652-1-git-send-email-peter@hurleysoftware.com> <1452402833-8652-10-git-send-email-peter@hurleysoftware.com> Cc: Greg Kroah-Hartman , Jiri Slaby , LKML , "user-mode-linux-devel@lists.sourceforge.net" , Linus Torvalds , One Thousand Gnomes From: Peter Hurley Message-ID: <56F6DDC7.6060609@hurleysoftware.com> Date: Sat, 26 Mar 2016 12:06:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Richard, On 03/26/2016 10:58 AM, Richard Weinberger wrote: > On Sun, Jan 10, 2016 at 6:13 AM, Peter Hurley wrote: >> Evaluate the conditions which prevent this tty being the controlling >> terminal in one place, just before setting the controlling terminal. >> >> Signed-off-by: Peter Hurley >> --- >> drivers/tty/tty_io.c | 17 ++++++++--------- >> 1 file changed, 8 insertions(+), 9 deletions(-) > > Peter, > > This commit breaks existing userspace. > I noticed that on UserModeLinux with Debian Squeeze as userspace, getty does not > give me a controlling tty upon login. > It does not seem to happen on newer distros. But still this needs > further investigation. > > Please me know what debug information you need. Sorry about that; I hadn't considered the implications of UML console. Can you test the blob below? Regards, Peter Hurley --- >% --- diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 608beb6..a361c61 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2158,7 +2157,9 @@ retry_open: read_lock(&tasklist_lock); spin_lock_irq(¤t->sighand->siglock); noctty = (filp->f_flags & O_NOCTTY) || +#ifdef CONFIG_VT device == MKDEV(TTY_MAJOR, 0) || +#endif device == MKDEV(TTYAUX_MAJOR, 1) || (tty->driver->type == TTY_DRIVER_TYPE_PTY && tty->driver->subtype == PTY_TYPE_MASTER);