svn commit: r346401 - head/sys/netinet6

Michael Tuexen tuexen at FreeBSD.org
Tue Sep 3 14:07:30 UTC 2019


Author: tuexen
Date: Fri Apr 19 17:21:35 2019
New Revision: 346401
URL: https://svnweb.freebsd.org/changeset/base/346401

Log:
  Avoid a buffer overwrite in rip6_output() when computing the checksum
  as requested by the user via the IPPROTO_IPV6 level socket option
  IPV6_CHECKSUM. The check if there are enough bytes in the packet to
  store the checksum at the requested offset was wrong by 1.
  
  Reviewed by:		bz@
  MFC after:		1 week
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D19967

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Fri Apr 19 17:17:41 2019	(r346400)
+++ head/sys/netinet6/raw_ip6.c	Fri Apr 19 17:21:35 2019	(r346401)
@@ -495,7 +495,7 @@ rip6_output(struct mbuf *m, struct socket *so, ...)
 			off = offsetof(struct icmp6_hdr, icmp6_cksum);
 		else
 			off = in6p->in6p_cksum;
-		if (plen < off + 1) {
+		if (plen < off + 2) {
 			error = EINVAL;
 			goto bad;
 		}




More information about the svn-src-head mailing list