Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2018 17:35:04 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r332183 - stable/11/sys/netinet
Message-ID:  <201804071735.w37HZ42n099025@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat Apr  7 17:35:04 2018
New Revision: 332183
URL: https://svnweb.freebsd.org/changeset/base/332183

Log:
  MFC r323372:
  
  Savely remove a chunk from the control queue.
  This bug was found by Coverity scanning the usrsctp library.

Modified:
  stable/11/sys/netinet/sctp_input.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_input.c
==============================================================================
--- stable/11/sys/netinet/sctp_input.c	Sat Apr  7 17:06:13 2018	(r332182)
+++ stable/11/sys/netinet/sctp_input.c	Sat Apr  7 17:35:04 2018	(r332183)
@@ -3136,14 +3136,14 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct 
 	 * make sure that we have a covered ECNE in the control chunk part.
 	 * If so remove it.
 	 */
-	struct sctp_tmit_chunk *chk;
+	struct sctp_tmit_chunk *chk, *nchk;
 	struct sctp_ecne_chunk *ecne;
 	int override;
 	uint32_t cwr_tsn;
 
 	cwr_tsn = ntohl(cp->tsn);
 	override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE;
-	TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
+	TAILQ_FOREACH_SAFE(chk, &stcb->asoc.control_send_queue, sctp_next, nchk) {
 		if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) {
 			continue;
 		}



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