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)
Tue, Aug 11, 9:00 PM
Unknown Object (File)
Mon, Aug 10, 7:19 PM
Unknown Object (File)
Mon, Aug 10, 7:19 PM
Unknown Object (File)
Sun, Aug 9, 10:49 AM
Unknown Object (File)
Fri, Aug 7, 2:59 PM
Unknown Object (File)
Jul 13 2026, 1:43 AM
Unknown Object (File)
Jun 9 2026, 1:27 PM
Unknown Object (File)
Jun 8 2026, 9:31 PM

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.