From nobody Tue Jul 14 14:56:10 2026 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 4h02SC3BQgz6kqV1 for ; Tue, 14 Jul 2026 14:56:11 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h02SC0jqbz3Ltj for ; Tue, 14 Jul 2026 14:56:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784040971; 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=eUWA8V1TdOeM2OPgQyJfbHX7bx+9ZgamRiftPrAS8fY=; b=SwRduyQrPML5XFUDX3cYqgmJoJSRwsebNHmJP+sag/dD8iPAJP9j2cNWsF6RYqrk4vmdiq RWgm0VOPk9a2E1Qvr1GJtoz713kxwqltJts4MjbdM6luQhnRtqjH/vnxPXnbbI1J/Y/wUL GzFvObL3VSkJ4F6aiw2iTSEstIgAGDYfL5vBombVLQLSpRg99wS3F94uy4P2CZSA8tKjL4 8Cg1BK/bGgS4B8yRZwo2yqg+K42QeIzA+Cwe8VE/XLwgAtk7On0TAhy2+zYj4qoa6kkDeO tWt50a3iKMgRgbmrXYpx0UrC3d9dNZwBpgsh+HWPLdzJYdwzV5CDLnlwu4mOvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784040971; a=rsa-sha256; cv=none; b=cwpD3DIzApbYezkfy5+zM2yWJ964qRnl4XZhIDdELTkaEVIJz83m6TpUK9x3mccnBCqD7H N1eh18crKC80D6mFBjxXcz9XG9OCRy2HmUnfkp30kIDHRp89UwizmQ7NkBr13ZXhxsHtdM OO7WUGeCd2um1ZsFFiZft+Lj0P17CVtcbglzdiFjFWmqdNRw+8SsFidY/XcvyLFGSobZ+5 NAMy8kc2gWKKRiZKfBWijS+DBumYFeueh2Q3AvVNJW+jgfOU56sqbIAe6Qww6GhUz/JZ2g S6KJWyeHKzdocLOB7LzvyRtffligsAj1+ry90pe1KCcE+8UznVd5X3G/Qwzlnw== 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=1784040971; 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=eUWA8V1TdOeM2OPgQyJfbHX7bx+9ZgamRiftPrAS8fY=; b=HjHn5Q2A6D/8e/pA3KIPwg6/rTu7EFP4MiPALkZBp2XvM4tg6lSbki6cnlD7wMCbPuxeFP ZuP07P3/9FW/3Vd4sZAviYSDDbUcWzApjcPiasYt5uE8hnqRH4zj4u2HoP4whiL1zZvrs4 QESyR3uE3Z/xzCLfQ1LCp0kJZ2Ap4xunDQa+bjtFh0c2+fZZZZSB3EwWRsJz2Yjfovy/Ep 1tBEz7Q5PQaGUg8aSoqeAA5Oy0Q4WJYv0hAW2XlFwTu2kb379qw6PnoWS0ZL4Pls8YPdHN aUhLK1HaAi9QKJHdLoXD4e2XZIZo0bHAD8ImFFdsNhm+iUKnWyKnREGo38i7tA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h02SB68TNzpn0 for ; Tue, 14 Jul 2026 14:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c7ce by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Jul 2026 14:56:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4b539c58e986 - stable/14 - libalias: Serialize updates to the global instance list 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 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/14 X-Git-Reftype: branch X-Git-Commit: 4b539c58e986ad46d2180abba33796511669124f Auto-Submitted: auto-generated Date: Tue, 14 Jul 2026 14:56:10 +0000 Message-Id: <6a564e0a.3c7ce.348bbdb1@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4b539c58e986ad46d2180abba33796511669124f commit 4b539c58e986ad46d2180abba33796511669124f Author: Mark Johnston AuthorDate: 2026-06-08 22:46:32 +0000 Commit: Mark Johnston CommitDate: 2026-07-14 13:02:07 +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 4bb95549aaaf..365e89138ce6 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #else @@ -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; @@ -2099,8 +2104,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; @@ -2167,8 +2178,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);