Page MenuHomeFreeBSD

cap_dns, cap_net: fix host and service buffer handling
ClosedPublic

Authored by vangyzen on Mar 30 2023, 10:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 27 2024, 1:13 AM
Unknown Object (File)
Sep 23 2024, 4:21 AM
Unknown Object (File)
Sep 19 2024, 6:28 PM
Unknown Object (File)
Sep 19 2024, 2:29 AM
Unknown Object (File)
Sep 18 2024, 10:09 AM
Unknown Object (File)
Sep 8 2024, 4:49 PM
Unknown Object (File)
Sep 8 2024, 7:16 AM
Unknown Object (File)
Aug 15 2024, 12:07 PM

Details

Summary

If a malicious casper process sent a host or service string that was
too long, cap_getnameinfo would overrun the caller's buffer by one byte.

The backends for this function needlessly allocated one extra byte
for these buffers. This was harmless, but could be confusing to readers.

Reported by: Coverity
MFC after: 1 week
Sponsored by: Dell EMC Isilon

Test Plan
$ kyua debug net_test:capnet__getnameinfo_overflow
net_test:capnet__getnameinfo_overflow  ->  passed

Diff Detail

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

Event Timeline

please add the CID to the commit message

(unless this is not from Coverity Scan's FreeBSD report)

This revision is now accepted and ready to land.Apr 4 2023, 6:18 PM

please add the CID to the commit message
(unless this is not from Coverity Scan's FreeBSD report)

It's from an internal run at Dell (Isilon). Oddly enough, I can't find this issue in the public FreeBSD report.

Thanks for the reviews, folks.