From nobody Sun Nov 19 19:30:23 2023 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 4SYLMN2rn3z51DRx; Sun, 19 Nov 2023 19:30:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SYLMN0fQHz4YKW; Sun, 19 Nov 2023 19:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700422224; 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=j5DQtPbIJVemj5aVUguXQ8njWDGac+jNWyAK3akHIyc=; b=nkQDPK3vbFeDXaeRBjcoRJNU9uEX/gaZ7zH0fafkTMVSA25UmBOEn77Xqp68YsJ2tyoI1z E/2+eqA8nCvXfR6jg5XKxgHLeA8alYLukEQs36Hg73V5wjKBDhs2YD8Ib9+2uoHTeFzzKO dSGlVtE3tmO3EJPzqmSywqSgSaHno9qm89wR/1uUwYu3qD07k37By5HGfgj4crXHSA6kuB wFxieBgCgTbVHs0hCGnZ10jTKr+QYrcgDJStNsoZck2oBNx+j2uI8E3aNE0m6KT1OJxYK4 yO1fBNIg+6kUjQBEA7nMAYZgkH5tNrQzbdRxJ5pLlNqCbG6fW3/KPyKXOPj6Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700422224; 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=j5DQtPbIJVemj5aVUguXQ8njWDGac+jNWyAK3akHIyc=; b=xGDjwVjunukCxp8+Ok3gixH91nWp/9zKiyQjpah5X938McGsvCAIbWN8Ymfb/+SkYHadmC lxIVrxPZSHqG68qfODXytkw45OsDXlj0dAxiKmuD343VfnQX9SdqmoLTX6KntIsmcQA2MV 0GCdn9hRiFF3C8+dpqiGigjiGzqZr3886lp12FY2+jnZCYH3MEd47RGBMtUDEFGBAg+fG3 AEoplFjhpB8iu7bxRDWgeRXWvz9+GLa4+dEB1RKGnbj/qIJbnMl7JsdYLydUSnFyUULO5C 8y50uzwprht/+OqDSgRERfYXmVPegNCP6HtSXPQ247MQ+ElV0QzQy7as8DsWsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700422224; a=rsa-sha256; cv=none; b=Mm+ALcT5Kme6A2GMNBpgQSVIDyZ+c2n6a5BzNFeBJTgi1GKbRMJHWMD66I2ssuHpPxdMF0 ZOEKHMg+D8ofW3PSoqAYrIrFOmUmNHoY8nsinkf6J9yobEFlmJ3aCywpH9EdascvDvCh+p 0sATKDcsI5koO2BkJNnvJlne+/PDmjo0enVzBV8G4jT+vVHCOmSXktqwK9ycLQv0xndETo Uf60SdifXx44c1yS0FuI4drWNz9/xS6enGXLcWvMvm2vg54UHi3zv91ty91NK6baluntf3 N8ZXuptC1A0EQs7ITioOW9v73lMjWq7Zh/HAfwQKbOfjMJqzd00hYQRDps4hbg== 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 4SYLMM6smGz6yw; Sun, 19 Nov 2023 19:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AJJUNii027452; Sun, 19 Nov 2023 19:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AJJUNmd027449; Sun, 19 Nov 2023 19:30:23 GMT (envelope-from git) Date: Sun, 19 Nov 2023 19:30:23 GMT Message-Id: <202311191930.3AJJUNmd027449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 16c65f7ae15e - stable/13 - if_wg: Missing radix unlock can cause deadlock 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 16c65f7ae15e6ca8b36fc546e038c59270c87ccc Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=16c65f7ae15e6ca8b36fc546e038c59270c87ccc commit 16c65f7ae15e6ca8b36fc546e038c59270c87ccc Author: Aaron LI AuthorDate: 2023-11-11 13:13:08 +0000 Commit: Kristof Provost CommitDate: 2023-11-19 19:29:35 +0000 if_wg: Missing radix unlock can cause deadlock In function 'wg_aip_add()', the error path of returning ENOMEM when (node == NULL) is forgetting to unlock the radix tree, and thus may lead to a deadlock. PR: 275001 Reviewed by: kp MFC after: 1 week (cherry picked from commit dcc4d2939f789a6d1f272ffeab2068ba2b7525ea) --- sys/dev/wg/if_wg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index e8a258edc4da..6cd5c985a89f 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -566,7 +566,7 @@ wg_aip_add(struct wg_softc *sc, struct wg_peer *peer, sa_family_t af, const void node = root->rnh_lookup(&aip->a_addr, &aip->a_mask, &root->rh); if (!node) { free(aip, M_WG); - return (ENOMEM); + ret = ENOMEM; } else if (node != aip->a_nodes) { free(aip, M_WG); aip = (struct wg_aip *)node;