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, Jul 3, 9:45 PM
Unknown Object (File)
Thu, Jul 3, 8:55 AM
Unknown Object (File)
Wed, Jul 2, 6:43 AM
Unknown Object (File)
Tue, Jul 1, 6:12 AM
Unknown Object (File)
Mon, Jun 23, 11:57 PM
Unknown Object (File)
Sun, Jun 22, 2:53 PM
Unknown Object (File)
Fri, Jun 20, 6:13 AM
Unknown Object (File)
Fri, Jun 13, 4:01 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

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.