Skip to content

Commit 6f9b028

Browse files
peterhurleygregkh
authored andcommitted
n_tty: Reset lnext if canonical mode changes
lnext escapes the next input character as a literal, and must be reset when canonical mode changes (to avoid misinterpreting a special character as a literal if canonical mode is changed back again). lnext is specifically not reset on a buffer flush so as to avoid misinterpreting the next input character as a special character. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6d76bd2 commit 6f9b028

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/tty/n_tty.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,7 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
15741574
bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
15751575
ldata->canon_head = ldata->read_tail;
15761576
ldata->erasing = 0;
1577+
ldata->lnext = 0;
15771578
}
15781579

15791580
if (canon_change && !L_ICANON(tty) && read_cnt(ldata))

0 commit comments

Comments
 (0)