Date: Sun, 14 Jun 2026 20:09:49 +0000 From: Ed Maste <emaste@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: b5cb2739b8b5 - stable/14 - tty: Add sysctl knob to globally disable TIOCSTI Message-ID: <6a2f0a8d.31b57.1a58da80@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b5cb2739b8b5d92e435693f290d0b30bd989460a commit b5cb2739b8b5d92e435693f290d0b30bd989460a Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2026-05-25 13:59:40 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2026-06-14 20:09:31 +0000 tty: Add sysctl knob to globally disable TIOCSTI Reviewed by: markj PR: 293485 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57233 (cherry picked from commit c289291a6736c01dd68fb8459ec3801859b0a59a) (cherry picked from commit c94b8eee5bcb5f9d116cce9c831933115cfeeb19) (cherry picked from commit 16532b220c9cbd9fb0365a80a23cc435003e9986) --- sys/kern/tty.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 508fa10fdd62..3bacbde3d1b0 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -102,6 +102,10 @@ static int tty_drainwait = 5 * 60; SYSCTL_INT(_kern, OID_AUTO, tty_drainwait, CTLFLAG_RWTUN, &tty_drainwait, 0, "Default output drain timeout in seconds"); +static bool tty_tiocsti = true; +SYSCTL_BOOL(_security_bsd, OID_AUTO, allow_tiocsti, CTLFLAG_RWTUN, + &tty_tiocsti, 0, "Allow TIOCSTI ioctl"); + /* * Set TTY buffer sizes. */ @@ -1650,6 +1654,10 @@ tty_set_winsize(struct tty *tp, const struct winsize *wsz) static int tty_sti_check(struct tty *tp, int fflag, struct thread *td) { + /* Check for global disable. */ + if (!tty_tiocsti) + return (EPERM); + /* Root can bypass all of our constraints. */ if (priv_check(td, PRIV_TTY_STI) == 0) return (0);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a2f0a8d.31b57.1a58da80>
