From nobody Fri Aug 30 06:29:38 2024 X-Original-To: dev-commits-src-all@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 4Ww7Xy6QbFz5T9Y5; Fri, 30 Aug 2024 06:29:38 +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 4Ww7Xy5jMKz4F4w; Fri, 30 Aug 2024 06:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999378; 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=8LmUKg7iog7gIXfGuAQEgL/Da/cvpYn/XxmgFFR3HTM=; b=yAz48Q7Y9gOIx7YWOtwXhxFTfM6blTV9ZV1RyiHRWLGTQoocOT+XCOqJB4T4+2zNxTBD55 K7fAv6wBo+XAHRltgtrSfbiD4xP0PcZ5MxlsG1pUc57AM0JMmTurwYpMbdW7G2bDFdShLH NmCLfhNZpakHJGeCm7DZVJ3mptA1jvkGsrPRfLdZ/LuSw36epgQMca69pRoUDWPe10Ov0g kd83oQ0PWp6KZNlVdVJL34kNAa91MHhtFLdTAJUimPXAAr8P1rNINTvjQjizXNVZavypsf 4jlK/X81qHfO4E5/9LsADRY59SM/9sBzGnRNKXcxtUaWD269ox1HAldU/x0Wmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999378; a=rsa-sha256; cv=none; b=Qa4gbE1sxSaLvsb/RIBSMrTT/67qYQAhhHC2wIIuNAm+YxGgRKMrIkMt3Jdjh9YCmidK+h 9BAuiSDuOtGjVGOOEfcvc8aJUrQGeBXJOHcSYyCs9ZyiXFLMgjVgaf0yxzeR5g0DjIwKtd DN0dAOAVwc5FpU7l4lyqPdfdxMLaABFffp9Tv9Ev+zBZO1FZ0avEzPg7Ugkgqfuo1sdnCb G63TVbJdBdLfDozG2vC046Zvr+tQRYPfbmL3zDYIfI3TBWcaW7x3rqp6FAkfxQE416vEBj XpAy6R2BAI+muVzs/AJ5LeV/+dRRHIzU2LELdX2MJtony8s4Lns5dQ7GLuOaWw== 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=1724999378; 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=8LmUKg7iog7gIXfGuAQEgL/Da/cvpYn/XxmgFFR3HTM=; b=mUaXRX16fpfIyZ9NGGW4b1KiGCTdmCW2828aoVWDMzSweRYcpbuDhJEahyqT9jmAZ3EL6J F6FgL0e0MmS0Pjx3cf+HNcGf1Anx/01x2g8HK92DAL8uwGeuXl4PzWM7lGhHX2blQZambO p3R/An2St4ZRgQgshfDcr6pW/AumVb4Zf1x31VjLWJIj+vlcxa5vlHc9Fg1RLHNFvHqmfn CNEKJ9FwCoxl/z7Vj8KOIPiA0zcLaEEq+u49YRLdd/OcIEYjvJNY324W11swtdybDvS23k jeaHWOjYkLybjmIVfW2FOtrBg2HkRRYcDsT6yHyIU2KoE+DZb2833cVwaOxp3w== 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 4Ww7Xy5JRhzpwZ; Fri, 30 Aug 2024 06:29:38 +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 47U6Tcj0041683; Fri, 30 Aug 2024 06:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6TcZd041680; Fri, 30 Aug 2024 06:29:38 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:29:38 GMT Message-Id: <202408300629.47U6TcZd041680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 118ab70d5789 - stable/14 - tcp: fix list iteration in tcp_lro_flush_active() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 118ab70d578934236251368c894973a4159ac514 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=118ab70d578934236251368c894973a4159ac514 commit 118ab70d578934236251368c894973a4159ac514 Author: Michael Tuexen AuthorDate: 2024-08-20 22:07:37 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:29:03 +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 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46383 (cherry picked from commit 64443828bbe7c571db8d8731758ec8c4b8364c86) --- 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 921d28f82517..2811cf25a052 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -599,7 +599,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 @@ -611,7 +611,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);