From nobody Tue Aug 20 22:11:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpNwM4vdmz5SkQ7; Tue, 20 Aug 2024 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpNwM4SJKz4rNp; Tue, 20 Aug 2024 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724191891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkrn4FmRKo1cMXYenprIr9gbRFzePWO7BIruXLARTLw=; b=xFXJsdQB4eo3UE67oiBEUz84MRaELjnmznnFVVihIi+mGaiQeD1hQsc4Hvm+FpV1AxyMbz rV3VPDHx99YBwhA605WsVFMJlvSPZaueWw0wPRZ3twUv5lZYeyXbg6mwLsT2UA1yNxcYVc oSqBEv077tIqxGscRGAH735JR71VAvdVikb8bZaZyOM3xDKx7z1enyheUOvBBo/GKPvdw1 2LSVmgiyk0fFJBsYfKCs+llLn+F6NeOEmGzPsWBnm+MdQGTG6nW/n3t6JB+yYdKy/CR693 10kdKsqiZYi/tRCvXPPMIWH1doGg+FKF4+yMFEkV53rIdz3y5mPoTFh1tUiFlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724191891; a=rsa-sha256; cv=none; b=kfZ6AALuQrpkFShUdPHkKPrHcDDNCqiGlqxGFwz+vWTmSYiiNbbu/n4aS4BJSb/ylSLRaJ bAHd8htFC1Wp69u219MFlHspN2gMy1YFhvQUZYdqpu7PJ2b4vq69YP4y0SOeOHTvkx9Tq5 gszxz0BqG8fA+e36m65AmzCE7ZwcR34epc1kC0AjN+RsNIbmcmEhF/RV4rC/aY87T2ekZu K5Cm/g+an6v/yLAuTg2RFun4yoxOm1awvE06mzLD53qOEingZr9rhdlIROYL3z/odJzcQO 4mE8D65G3bbP2S6o67umQIyK0wWI+Jb1pDggDToRnNSzQ6gDi/56JGy9IoUT4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724191891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkrn4FmRKo1cMXYenprIr9gbRFzePWO7BIruXLARTLw=; b=Jc9PwnpCwzq7uVUpxsK8PC3FzIDwZ9rCF+1IFbexLyGbk4yXRyefz7grBaAXJW8DiGbTNq 8X80IQtfSfB5tJAzBa7c1d6vzfvU7lHQbShS8KKdvpQtOruMdJ7wpDltOfP4R0zTvf6Wy3 IpctxDuCadbDnTGfM0IujXYl1mlxYhnEzjRubz7dvJr4niy1BtwnPytG8g3sycoDcNlSHO 3ma0gjngH3lVGiwQfPokqFKQOLNRhpiOYPQIOxiJokMpv8r0Azy2KnWds23JF21Rx9bXGY oFg7HgjGi4gzyc95Ynk4gV+ilyM2I8PPkvtjqQCLToc7qYeZwc/BjbaTpyTzbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpNwM44RtzHtm; Tue, 20 Aug 2024 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KMBVZk021614; Tue, 20 Aug 2024 22:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KMBVgh021611; Tue, 20 Aug 2024 22:11:31 GMT (envelope-from git) Date: Tue, 20 Aug 2024 22:11:31 GMT Message-Id: <202408202211.47KMBVgh021611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 64443828bbe7 - main - tcp: fix list iteration in tcp_lro_flush_active() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64443828bbe7c571db8d8731758ec8c4b8364c86 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=64443828bbe7c571db8d8731758ec8c4b8364c86 commit 64443828bbe7c571db8d8731758ec8c4b8364c86 Author: Michael Tuexen AuthorDate: 2024-08-20 22:07:37 +0000 Commit: Michael Tuexen CommitDate: 2024-08-20 22:07:37 +0000 tcp: fix list iteration in tcp_lro_flush_active() Use LIST_FOREACH_SAFE(), since the list element is removed from the list in the loop body, zero out and inserted in the free list. Reviewed by: rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46383 --- sys/netinet/tcp_lro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 2603815f9e61..906e01257a04 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -595,7 +595,7 @@ tcp_lro_rx_done(struct lro_ctrl *lc) static void tcp_lro_flush_active(struct lro_ctrl *lc) { - struct lro_entry *le; + struct lro_entry *le, *le_tmp; /* * Walk through the list of le entries, and @@ -607,7 +607,7 @@ tcp_lro_flush_active(struct lro_ctrl *lc) * is being freed. This is ok it will just get * reallocated again like it was new. */ - LIST_FOREACH(le, &lc->lro_active, next) { + LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { if (le->m_head != NULL) { tcp_lro_active_remove(le); tcp_lro_flush(lc, le);