From nobody Thu Oct 31 14:01:52 2024 X-Original-To: dev-commits-src-branches@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 4XfQf91vTyz5bldJ; Thu, 31 Oct 2024 14:01:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQf90zlDz42Cw; Thu, 31 Oct 2024 14:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383313; 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=LrdMZ8y+6jobTm9mPdymTfF0XSSPk7Z7ZBm5m/zzu3w=; b=SuKlOsWE3yG123bRE97AZZGCrA2sGbwTa/QME3w+HvbOaqFyWmzJpBcezqQATNc+LrI3tK vTUgvFXqQiy1A3G3EUZeqgot32vfu+9bJKLOMCGCJWsHYaw375xBVjmhotgDpo2fx7MaeA g9oAqWR6DI1FLQwEbZ1TlliK6nrCKMYRNE+EVJfd92su5zu/rLxasdik+rG5kKFN3DJvED Mec7TuCSYQAZWOvD/yR+pcz+CZZZHZdtDGJjFNf/RSfHR5uIcryXRGho5wNUn5JtMH0vsP W+8J68SpLryN6adccyXl7Q3EeAGMgln9hPVomeDkyeruamntmi2oDFmQth0AKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383313; 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=LrdMZ8y+6jobTm9mPdymTfF0XSSPk7Z7ZBm5m/zzu3w=; b=ZyivYml6EJW5qlbDXuYmyMBtfrAWrsNDg4cnRh2MLdxX3Wp2K2jKktxeHafd8n4YA3rv3Z cYqGdRF0Ty3i5vE9TDLVqUs3Ux0JGdYo/z83qzRw/dnLDElTtgNE+aE9IymWoJV/TEdegw FX3kTO/uZIUO28ZHX0bWkgBBmRkIYPuOTFtGc+v0DJPJEOqwr0Rf62SqxB3NKUBGA4Z9b1 O9BHyCwLxbBti5c2tc/4wzhobjzHk86n/m2yfPeQtCdgBUBWB4usfUVmGH6104AwoTpkDu UjSgCXM1nmwanw6Fw4Pz/Vzf2JfxLJNshA6qCipZSYo+1jrsf1ZnZ8AnmvzIqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383313; a=rsa-sha256; cv=none; b=GLgtL/udzn0HX7ltm+0l+cuflawy9ygszTJPpoIA7JBB0jZJ8ZovuEWh371ewP1lTQLmdY UxY6MEbedTqOD3KT+p7RBSb6CnzOjZs5EjOTfrYLOyfUUcKqEPV7ZDYXj7Hsb0tDBvsM7b nztO8jdRGyzVa8j1DwQFZwatEMnkQ0/jqFKE3klFWL0WZ3b0pAmCCNH5YsArwR6DgIvU+j odmaq0O4w+t461BshODQTL1PppLW9boLWIjRZiDiRMfdkB0A8SMgM/eNWKY0UqdWIwbA8n 9gqayvOoFAD2VRk0ULtF1R3NDLbf5LNL9PW2ocP2xdOOwj3LNCOwZzllqoKQHg== 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 4XfQf90bjhzfdB; Thu, 31 Oct 2024 14:01:53 +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 49VE1q3O044443; Thu, 31 Oct 2024 14:01:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE1qMo044440; Thu, 31 Oct 2024 14:01:52 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:01:52 GMT Message-Id: <202410311401.49VE1qMo044440@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: bbb73d8941d4 - stable/14 - sctp: check locking requirements List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: bbb73d8941d4ccbbf8b97677556f6485a8e3845b Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bbb73d8941d4ccbbf8b97677556f6485a8e3845b commit bbb73d8941d4ccbbf8b97677556f6485a8e3845b Author: Michael Tuexen AuthorDate: 2024-10-10 13:50:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:40:21 +0000 sctp: check locking requirements Actually assert the locking instead of describing it in a comment. No functional change intended. (cherry picked from commit 4466a97e83fd9484cb22dd2867b6972f6b185e8b) --- sys/netinet/sctp_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index f89865456274..a0f323043d9b 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -378,13 +378,13 @@ out: /*- * Add an ifa to an ifn. * Register the interface as necessary. - * NOTE: ADDR write lock MUST be held. */ static void sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) { int ifa_af; + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_INSERT_HEAD(&sctp_ifnp->ifalist, sctp_ifap, next_ifa); sctp_ifap->ifn_p = sctp_ifnp; atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); @@ -415,11 +415,11 @@ sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) * Remove an ifa from its ifn. * If no more addresses exist, remove the ifn too. Otherwise, re-register * the interface based on the remaining address families left. - * NOTE: ADDR write lock MUST be held. */ static void sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap) { + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_REMOVE(sctp_ifap, next_ifa); if (sctp_ifap->ifn_p) { /* update address counts */