Page MenuHomeFreeBSD

kern: tty: refactor TIOCSTI privilege checks slightly
ClosedPublic

Authored by kevans on May 24 2025, 12:36 AM.
Tags
None
Referenced Files
F151553095: D50506.id.diff
Thu, Apr 9, 3:59 AM
Unknown Object (File)
Tue, Apr 7, 4:04 AM
Unknown Object (File)
Sun, Mar 29, 3:52 AM
Unknown Object (File)
Sun, Mar 29, 3:52 AM
Unknown Object (File)
Fri, Mar 27, 8:39 AM
Unknown Object (File)
Thu, Mar 26, 9:56 AM
Unknown Object (File)
Sat, Mar 21, 7:10 PM
Unknown Object (File)
Mon, Mar 16, 7:11 AM

Details

Summary

This removes some repetition from it and makes the flow a little more
obvious. Future work may find some way to add more constraints to the
unprivileged path, add a security sysctl to disable it, or perhaps
some combination of the two.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
sys/kern/tty.c
1653

Or just if (priv_check(td, PRIV_TTY_STI) == 0) return (0);.

This revision is now accepted and ready to land.May 24 2025, 1:26 AM
kib added inline comments.
sys/kern/tty.c
1656

This is counter-intuitive BTW.

sys/kern/tty.c
1656

I agree, but I haven't yet spent any time tracking down the current requirements -- I would've expected to need FWRITE instead to alter the tty buffer.