mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
Allow only IPv4 addresses in sendto() for TCP on AF_INET sockets.
This problem was found by looking at syzkaller reproducers for some other problems. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24831
This commit is contained in:
parent
777b88d60f
commit
e240ce42bf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361081
|
@ -1037,6 +1037,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
|
|||
error = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if ((inp->inp_vflag & INP_IPV6PROTO) == 0) {
|
||||
if (m != NULL)
|
||||
m_freem(m);
|
||||
error = EAFNOSUPPORT;
|
||||
goto out;
|
||||
}
|
||||
if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
|
||||
if (m)
|
||||
m_freem(m);
|
||||
|
|
Loading…
Reference in a new issue