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)
Wed, Jan 15, 7:16 PM
Unknown Object (File)
Nov 13 2024, 8:49 PM
Unknown Object (File)
Nov 12 2024, 3:42 AM
Unknown Object (File)
Oct 31 2024, 3:26 PM
Unknown Object (File)
Oct 31 2024, 2:20 AM
Unknown Object (File)
Oct 24 2024, 10:44 AM
Unknown Object (File)
Oct 24 2024, 10:44 AM
Unknown Object (File)
Oct 24 2024, 10:43 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.