Page MenuHomeFreeBSD

kern: tty: refactor TIOCSTI privilege checks slightly
ClosedPublic

Authored by kevans on May 24 2025, 12:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 1, 5:46 AM
Unknown Object (File)
Thu, Nov 27, 9:20 AM
Unknown Object (File)
Oct 27 2025, 2:52 PM
Unknown Object (File)
Oct 21 2025, 6:11 AM
Unknown Object (File)
Oct 17 2025, 3:51 AM
Unknown Object (File)
Oct 9 2025, 8:01 PM
Unknown Object (File)
Oct 9 2025, 1:23 PM
Unknown Object (File)
Oct 8 2025, 6:59 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 64401
Build 61285: arc lint + arc unit

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.