Page MenuHomeFreeBSD

tcp, udp: improve input validation in bind()
ClosedPublic

Authored by tuexen on Aug 5 2021, 11:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 8, 2:12 PM
Unknown Object (File)
Sat, Feb 7, 6:29 PM
Unknown Object (File)
Tue, Feb 3, 1:24 PM
Unknown Object (File)
Sat, Jan 31, 1:44 AM
Unknown Object (File)
Jan 8 2026, 5:20 PM
Unknown Object (File)
Jan 6 2026, 5:15 AM
Unknown Object (File)
Dec 20 2025, 8:45 AM
Unknown Object (File)
Dec 15 2025, 6:09 AM

Diff Detail

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

Event Timeline

tuexen added reviewers: rscheff, rrs.
This revision is now accepted and ready to land.Aug 5 2021, 11:08 AM

Thank you.

sys/netinet/tcp_usrreq.c
329

I would just check nam->sa_len != sizeof(*sinp) since we perform that exact check again below. This is ok though.

tuexen added inline comments.
sys/netinet/tcp_usrreq.c
329

I was considering that or even just do the check for sa_len before the check for sa_family. I decided to do it this way to report EINVAL if sa_len is not correct as often as possible.

This revision was automatically updated to reflect the committed changes.
tuexen marked an inline comment as done.