sctp: improve input validation of mapped addresses in sctp_connectx()
MFC after: 3 days
This commit is contained in:
parent
b732091a76
commit
112899c6af
@ -6716,15 +6716,15 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr,
|
||||
{
|
||||
struct sockaddr_in6 *sin6;
|
||||
|
||||
incr = (unsigned int)sizeof(struct sockaddr_in6);
|
||||
if (sa->sa_len != incr) {
|
||||
return (EINVAL);
|
||||
}
|
||||
sin6 = (struct sockaddr_in6 *)sa;
|
||||
if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
|
||||
/* Must be non-mapped for connectx */
|
||||
return (EINVAL);
|
||||
}
|
||||
incr = (unsigned int)sizeof(struct sockaddr_in6);
|
||||
if (sa->sa_len != incr) {
|
||||
return (EINVAL);
|
||||
}
|
||||
(*num_v6) += 1;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user