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)
Thu, Oct 31, 3:26 PM
Unknown Object (File)
Thu, Oct 31, 2:20 AM
Unknown Object (File)
Thu, Oct 24, 10:44 AM
Unknown Object (File)
Thu, Oct 24, 10:44 AM
Unknown Object (File)
Thu, Oct 24, 10:43 AM
Unknown Object (File)
Thu, Oct 24, 10:23 AM
Unknown Object (File)
Wed, Oct 16, 6:02 AM
Unknown Object (File)
Sep 23 2024, 10:30 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.