Page MenuHomeFreeBSD

linux(4): Check fd passed to unlockpt()
ClosedPublic

Authored by dchagin on May 14 2023, 11:18 PM.
Referenced Files
Unknown Object (File)
Sat, Mar 14, 7:50 AM
Unknown Object (File)
Fri, Mar 6, 4:24 PM
Unknown Object (File)
Thu, Mar 5, 10:00 PM
Unknown Object (File)
Tue, Mar 3, 9:08 AM
Unknown Object (File)
Feb 14 2026, 4:36 PM
Unknown Object (File)
Feb 8 2026, 5:33 AM
Unknown Object (File)
Feb 8 2026, 3:19 AM
Unknown Object (File)
Jan 31 2026, 12:24 PM
Subscribers

Details

Summary

In our implementation, grantpt() and unlockpt() don't actually have
any use, because PTY's are created on the fly and already have proper
permissions upon creation.
Atleast check that a proper fd passed to unlockpt(). For grantpt()
Glibc calls TIOCGPTN ioctl which would fail if fd is not a master.

MFC after: 1 week

Diff Detail

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