Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Apr 2020 13:02:42 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r360337 - head/sys/netinet
Message-ID:  <202004261302.03QD2gDE076186@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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); \
 	} \
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004261302.03QD2gDE076186>