svn commit: r360337 - head/sys/netinet
Alexander V. Chernikov
melifaro at FreeBSD.org
Sun Apr 26 13:02:43 UTC 2020
Author: melifaro
Date: Sun Apr 26 13:02:42 2020
New Revision: 360337
URL: https://svnweb.freebsd.org/changeset/base/360337
Log:
Fix order of arguments in fib[46]_lookup calls in SCTP.
r360292 introduced the wrong order, resulting in returned
nhops not being referenced, despite the fact that references
were requested. That lead to random GPF after using SCTP sockets.
Special defined macro like IPV[46]_SCOPE_GLOBAL will be introduced
soon to reduce the chance of putting arguments in wrong order.
Reported-by: syzbot+5c813c01096363174684 at syzkaller.appspotmail.com
Modified:
head/sys/netinet/sctp_os_bsd.h
Modified: head/sys/netinet/sctp_os_bsd.h
==============================================================================
--- head/sys/netinet/sctp_os_bsd.h Sun Apr 26 08:38:53 2020 (r360336)
+++ head/sys/netinet/sctp_os_bsd.h Sun Apr 26 13:02:42 2020 (r360337)
@@ -403,9 +403,9 @@ typedef struct route sctp_route_t;
{ \
if ((ro)->ro_nh == NULL) { \
if ((ro)->ro_dst.sa_family == AF_INET) \
- (ro)->ro_nh = fib4_lookup(fibnum, ((struct sockaddr_in *)&(ro)->ro_dst)->sin_addr, NHR_REF, 0, 0); \
+ (ro)->ro_nh = fib4_lookup(fibnum, ((struct sockaddr_in *)&(ro)->ro_dst)->sin_addr, 0, NHR_REF, 0); \
if ((ro)->ro_dst.sa_family == AF_INET6) \
- (ro)->ro_nh = fib6_lookup(fibnum, &((struct sockaddr_in6 *)&(ro)->ro_dst)->sin6_addr, NHR_REF, 0, 0); \
+ (ro)->ro_nh = fib6_lookup(fibnum, &((struct sockaddr_in6 *)&(ro)->ro_dst)->sin6_addr, 0, NHR_REF, 0); \
} \
}
More information about the svn-src-all
mailing list