Re: [PATCH v3 2/2] tty: Allow TIOCSTI to be disabled

From: Kees Cook
Date: Tue Dec 27 2022 - 22:33:12 EST


On December 27, 2022 3:40:00 PM PST, Samuel Thibault <samuel.thibault@xxxxxxxxxxxx> wrote:
>Hello,
>
>Kees Cook, le sam. 22 oct. 2022 11:29:49 -0700, a ecrit:
>> TIOCSTI continues its long history of being used in privilege escalation
>> attacks[1]. Prior attempts to provide a mechanism to disable this have
>> devolved into discussions around creating full-blown LSMs to provide
>> arbitrary ioctl filtering, which is hugely over-engineered -- only
>> TIOCSTI is being used this way. 3 years ago OpenBSD entirely removed
>> TIOCSTI[2], Android has had it filtered for longer[3], and the tools that
>> had historically used TIOCSTI either do not need it, are not commonly
>> built with it, or have had its use removed.
>
>No. The Brltty screen reader entirely relies on TIOCSTI to be able to
>support input from various Braille devices. Please make sure to keep
>TIOCSTI enabled by default, otherwise some people would just completely
>lose their usual way of simply typing on Linux.

Yup, it remains default enabled:

> [...]
>> +config LEGACY_TIOCSTI
>> + bool "Allow legacy TIOCSTI usage"
>> + default y
>> + help
>> + Historically the kernel has allowed TIOCSTI, which will push
>> + characters into a controlling TTY. This continues to be used
>> + as a malicious privilege escalation mechanism, and provides no
>> + meaningful real-world utility any more.
>
>Yes it does.

Can you send a patch to adjust this language?

Also, what does FreeBSD use for screen readers?

-Kees


--
Kees Cook