Skip to content

Commit da5a0fc

Browse files
peterhurleygregkh
authored andcommitted
tty: Fix UML console breakage
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: 11e1d4a ("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>
1 parent f55532a commit da5a0fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/tty_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,7 @@ static int tty_open(struct inode *inode, struct file *filp)
21582158
read_lock(&tasklist_lock);
21592159
spin_lock_irq(&current->sighand->siglock);
21602160
noctty = (filp->f_flags & O_NOCTTY) ||
2161-
device == MKDEV(TTY_MAJOR, 0) ||
2161+
(IS_ENABLED(CONFIG_VT) && device == MKDEV(TTY_MAJOR, 0)) ||
21622162
device == MKDEV(TTYAUX_MAJOR, 1) ||
21632163
(tty->driver->type == TTY_DRIVER_TYPE_PTY &&
21642164
tty->driver->subtype == PTY_TYPE_MASTER);

0 commit comments

Comments
 (0)