From nobody Mon Jun 15 18:01:52 2026 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 4gfHxs0pNWz6hhLQ for ; Mon, 15 Jun 2026 18: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfHxr524Fz4F9j for ; Mon, 15 Jun 2026 18:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781546512; 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=sgOZrtxOKfhRtWZLNVqTe/jgIeI/sdh0b8KmfFbD6O4=; b=TBGMnR9cPN3GmQRcfT0f98wl0n1oOQIiZMezIcOBP7u8JnL5hM03cJP/pJBsKyfdXNhwyX VQgmuiFiIc672T3d8QnG4IOPG12E8mQYB85ErdJo2vKGxm76EkK/in3STKEbFcGGHaeHYH 7qNlbCAxDODJw5I2HoW2CnBC99xVvnk8ONUC16qqBHvfHdq6BKR21QAXi7cAnXXLloK4bY bpjzJdYWiiOMfITNcj3CfW/UEIk77hGNuZba7UQvRoTppd3aBDT3oLyedLWJG6d0auebS7 nKwUbaBHE8/fswQ7f1w5qfRTsivpyYEa2qV880nGCckMP+lkuVP19VbN4Ep8pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781546512; a=rsa-sha256; cv=none; b=sorxWw2RxHE/Q8FVLrxHxLOhL2CIbg5jRNAFQJKwDjkSeRZ3a3leer/RvKfOVzAt62aoZq MdWZ12Hdp4uYA6CEElEFZhnYYn5mPo7d5jPn1PrqSWr8ohzUTuEq5cE/70qWgU3B8TLFhf t0AXImmoom2DsT8jmDJXrQon8ZB/rmfe0emFJOcK4DO4JzoZjq2UkNBdGKekyaXpCDnlm8 cq2U8kGppJqfAto1iKupK51F/NOxqnwMhhYxjEwo8ylTQo1HeAifGMOahcUfm4jaeomKn8 kpHsUui+3lw2jeMMQ+0+JpYpAIV2Gk+otJ49zC9lGulxhdfFwMMYA3yVfEOvew== 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=1781546512; 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=sgOZrtxOKfhRtWZLNVqTe/jgIeI/sdh0b8KmfFbD6O4=; b=RuiEyYNzH4dyLJ7xzOyaq9Iq2d2CzvQk8afvcoedv9C8Brn3mOa2gy/+BaNQzloIXnkOob WVdn/45e9N6oP/9QcdyPMFtHIeBe3Wgz/3p63HjMLTCs1nBp19oJh8L0wyfRX+276Nzs+f VEJzEXAoFTV3C0cBXBH8/ESS29hqQYELgtu31in0M1vMo3i22g3bY3MwmNnWsQPQAqw0im MNRoWpTlRuMRmJtgJjCnYus30lyMpO7GnxEhUQVz9eqdOU3JVpxIC780vglf+5xAI/LBmc ZPayqU0dxcmP7yF5+89EAX7lLOJKdpUjeY/ndworl1LqD2zPhWylGHagsr48AA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfHxr4CF5z15Cc for ; Mon, 15 Jun 2026 18:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ed40 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 18:01:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3cf9ba059b80 - stable/15 - libalias: Serialize updates to the global instance list 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3cf9ba059b80711049f8290333b0fc61e61798b2 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 18:01:52 +0000 Message-Id: <6a303e10.1ed40.2a5dee38@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3cf9ba059b80711049f8290333b0fc61e61798b2 commit 3cf9ba059b80711049f8290333b0fc61e61798b2 Author: Mark Johnston AuthorDate: 2026-06-08 22:46:32 +0000 Commit: Mark Johnston CommitDate: 2026-06-15 16:00:04 +0000 libalias: Serialize updates to the global instance list libalias maintains a global list of all libalias handles. The list was updated without any locking, but nothing prevents updates from running concurrently. MFC after: 1 week (cherry picked from commit 2ff705f32a2033201a8f83f1ade5ddbc0460387d) --- sys/netinet/libalias/alias_db.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index c143d74a2f45..0861743a68dd 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,10 @@ #include "alias_db.h" +#ifdef _KERNEL +static struct mtx list_mtx; +MTX_SYSINIT(libalias_list, &list_mtx, "libalias list lock", MTX_DEF); +#endif static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead); int LibAliasTime; @@ -2190,8 +2195,14 @@ LibAliasInit(struct libalias *la) /* kernel cleans up on module unload */ if (LIST_EMPTY(&instancehead)) atexit(finishoff); +#endif +#ifdef _KERNEL + mtx_lock(&list_mtx); #endif LIST_INSERT_HEAD(&instancehead, la, instancelist); +#ifdef _KERNEL + mtx_unlock(&list_mtx); +#endif #ifdef _KERNEL LibAliasTime = time_uptime; @@ -2259,8 +2270,14 @@ LibAliasUninit(struct libalias *la) UninitPacketAliasLog(la); #ifndef NO_FW_PUNCH UninitPunchFW(la); +#endif +#ifdef _KERNEL + mtx_lock(&list_mtx); #endif LIST_REMOVE(la, instancelist); +#ifdef _KERNEL + mtx_unlock(&list_mtx); +#endif LIBALIAS_UNLOCK(la); LIBALIAS_LOCK_DESTROY(la); free(la);