git: 784692c74019 - main - sctp: improve handling of IPv4 addresses on IPV6 sockets Reported by: syzbot+08fe66e4bfc2777cba95 at syzkaller.appspotmail.com MFC after: 3 days
Michael Tuexen
tuexen at FreeBSD.org
Sat Aug 7 15:30:26 UTC 2021
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=784692c74019fa69b5298fb1693a97f107c56b4b
commit 784692c74019fa69b5298fb1693a97f107c56b4b
Author: Michael Tuexen <tuexen at FreeBSD.org>
AuthorDate: 2021-08-07 15:27:56 +0000
Commit: Michael Tuexen <tuexen at FreeBSD.org>
CommitDate: 2021-08-07 15:27:56 +0000
sctp: improve handling of IPv4 addresses on IPV6 sockets
Reported by: syzbot+08fe66e4bfc2777cba95 at syzkaller.appspotmail.com
MFC after: 3 days
---
sys/netinet6/sctp6_usrreq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index 6f5d639e6367..fcbb566b53d3 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -771,7 +771,8 @@ sctp6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
return (EINVAL);
}
}
- if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
+ if ((addr->sa_family == AF_INET6) &&
+ IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
struct sockaddr_in sin;
/* convert v4-mapped into v4 addr and send */
@@ -909,7 +910,8 @@ sctp6_connect(struct socket *so, struct sockaddr *addr, struct thread *p)
return (EINVAL);
}
}
- if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
+ if ((addr->sa_family == AF_INET6) &&
+ IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
/* convert v4-mapped into v4 addr */
in6_sin6_2_sin(&store.sin, sin6);
addr = &store.sa;
More information about the dev-commits-src-main
mailing list