HomeFreeBSD

cap_dns, cap_net: fix host and service buffer handling

Description

cap_dns, cap_net: fix host and service buffer handling

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 (an internal run at Dell)
Reviewed by: oshogbo, emaste
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D39347

Details

Provenance
vangyzenAuthored on Mar 30 2023, 10:54 PM
Reviewer
oshogbo
Differential Revision
D39347: cap_dns, cap_net: fix host and service buffer handling
Parents
rG27f35b7dd418: libdtrace: Do not set SHF_ALLOC on SUNW_dof relocation sections
Branches
Unknown
Tags
Unknown