Page MenuHomeFreeBSD

Fix an out-of-bounds write when a zero-length buffer is passed.
ClosedPublic

Authored by brooks on Apr 12 2017, 10:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 4, 1:55 AM
Unknown Object (File)
Tue, Nov 4, 1:55 AM
Unknown Object (File)
Tue, Nov 4, 1:55 AM
Unknown Object (File)
Mon, Nov 3, 9:22 PM
Unknown Object (File)
Mon, Oct 27, 2:19 AM
Unknown Object (File)
Oct 12 2025, 7:21 PM
Unknown Object (File)
Aug 20 2025, 10:48 AM
Unknown Object (File)
Jul 7 2025, 9:30 PM
Subscribers
None

Details

Summary

Found with ttyname_test and CHERI bounds checking.

Sponsored by: DARPA, AFRL
Obtained from: CheriBSD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I also wonder if we should perform a NULL pointer check, but POSIX doesn't explicitly allow EINVAL.

This revision is now accepted and ready to land.Apr 12 2017, 11:10 PM

I also wonder if we should perform a NULL pointer check, but POSIX doesn't explicitly allow EINVAL.

Bruce would argue that a SIGSEGV is a valid NULL pointer check. That is the failure case for many other APIs in userland (e.g. strlen() and strcpy()).

This revision was automatically updated to reflect the committed changes.