]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
tty: Fix UML console breakage
authorPeter Hurley <peter@hurleysoftware.com>
Fri, 1 Apr 2016 00:05:30 +0000 (17:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Apr 2016 00:14:14 +0000 (17:14 -0700)
User-Mode Linux supplies an alternate TTY_MAJOR driver for stdio console,
so the noctty check in tty_open() must apply only to VT driver tty0
devnode and not the UML console driver tty0 devnode.

Fixes: 11e1d4aa4da1 ("tty: Consolidate noctty checks in tty_open()")
Reported-by: Richard Weinberger <richard.weinberger@gmail.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c

index 8d26ed79bb4c593a1dabbd4ab76b45be2338e8fc..876878a7704ff99e81314d559269f2cbf25f4a1a 100644 (file)
@@ -2158,7 +2158,7 @@ retry_open:
        read_lock(&tasklist_lock);
        spin_lock_irq(&current->sighand->siglock);
        noctty = (filp->f_flags & O_NOCTTY) ||
-                       device == MKDEV(TTY_MAJOR, 0) ||
+                       (IS_ENABLED(CONFIG_VT) && device == MKDEV(TTY_MAJOR, 0)) ||
                        device == MKDEV(TTYAUX_MAJOR, 1) ||
                        (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
                         tty->driver->subtype == PTY_TYPE_MASTER);