HomeFreeBSD

kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes

Description

kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes

Before this change, we would canonicalize any partial input if the new
local mode is not ICANON, but that's about it. If we were switching
from -ICANON -> ICANON, or if VEOF/VEOL changes, then our internal canon
accounting would be wrong.

The main consequence of this is that in ICANON mode, we would
potentially hang a read(2) longer if the new VEOF/VEOL appears later in
the buffer, and FIONREAD would be similarly wrong as a result.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43456

Details

Provenance
kevansAuthored on Jan 16 2024, 2:55 AM
Reviewer
kib
Differential Revision
D43456: kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes
Parents
rGd51dac5f1370: kern: tty: fix EOF handling for canonical reads
Branches
Unknown
Tags
Unknown