HomeFreeBSD

Add missing sockaddr length and family validation to various protocols

Description

Add missing sockaddr length and family validation to various protocols

Several protocol methods take a sockaddr as input. In some cases the
sockaddr lengths were not being validated, or were validated after some
out-of-bounds accesses could occur. Add requisite checking to various
protocol entry points, and convert some existing checks to assertions
where appropriate.

Reported by: syzkaller+KASAN
Reviewed by: tuexen, melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29519

(cherry picked from commit f161d294b92732df6254a89f393ab24999e122bf)

Details

Provenance
markjAuthored on May 3 2021, 4:51 PM
Reviewer
tuexen
Differential Revision
D29519: Add missing sockaddr length and family validation to various protocols
Parents
rG3eebc6234b00: in6_mcast: Return EADDRINUSE when we've already joined the group
Branches
Unknown
Tags
Unknown