From nobody Sun Nov 19 19:30:16 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 4SYLMD5XJJz51DRr; Sun, 19 Nov 2023 19:30:16 +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 4SYLMD4vbXz4Y6Q; Sun, 19 Nov 2023 19:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700422216; 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=Cv1dyFZdMv5+O8IsaMhrnbFikyfEyTYzgv7439CT17U=; b=mcFQ9be76UdgZ+6Rb5y9vRWeKBBohgTwRYtZjSVh5IrREoZJZNyTd1mNuhEoYrJ7FcxoOH CarTG1FLC+N7I5gVrHMNib7liOmxiMAsjl+6ZzxdktB0X0GE8nCfc9DCraWtc2hXNoinwG swtZm9qxKqS9hAsonndLJvAEBuKXe69nIn+/NAqC8wAVJO0iNM+4vHQUf5wp9KpexzKS2k CAgc4vC7FsnoP9zs54LYE029G9zvdfyiErT6h309DrEVWxx+aUdu/vKXjBXkbB+CYlmoGd h8iDWEFxpBAsx1Sz9K0zOC5mu1BALFWad/TdMGhvTbKJ0gv8L4BePWbZLdGwQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700422216; 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=Cv1dyFZdMv5+O8IsaMhrnbFikyfEyTYzgv7439CT17U=; b=tFuApgpcZrxEDYlIUcl4rjcSa9T+5Vvugwa10uW6Wmgj3y2aOyYM0Dse8GTABvSBTDSToT /KDgEKM5QhBz2F+oLB43Vtk/Sa45/SD0MEx7anRtyNVFAzLouCBzdKQwRoS6cejvvR2Ef5 W8Gwo4MiiMa7bLaF5tdx3qzMcbqWZRjnCKaHlQqfvyVRyesMUehhXSDWPe/zmUR8M35H93 udwID94qp3tN1pvhzD6IUPosxew7OYFF7G3fzRDwBFlQB6y4ZsEXgz5PykTPlGFJyhug7O bJg8YOq3JCq3ZAyIfFzCSA2JE+t25QYfr83hZoOe6qpwUrYrbY5P7hT2yzMZoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700422216; a=rsa-sha256; cv=none; b=c18ZcdB0Ut3Dy6lUDLHQMSgdt7eNB6q671OH+EJ84hsJC2Vv/lM22cgB3d1Ux6X1ulvqgz nfg48S30UEpu6mo6DrPtDz+u0oC0LuuMiRBh7gAshZ7JfJk1MNf55e8S5NyqubyDuuGTaG ibblrm/ffw2G3P3pEEqxaN+j9TLy+tpEQR5QjaQhy+b7AoqQKzFEHAvadJ0Yfe0FMYAAV7 OgwwJkdSNI2/bMUNAJRCUsPBIk1PaH8sK5GZ40xCHm4V3dUa8D+0K6+WFW08ojaMZX5MTw Nei5YGXHBtR3o/PrnFf4F5JLPqUkgmRP4A+CN//GMIonA2SOvhor00yaLuBtKA== 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 4SYLMD3tbFz6n3; Sun, 19 Nov 2023 19:30:16 +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 3AJJUGQX026381; Sun, 19 Nov 2023 19:30:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AJJUGBo026372; Sun, 19 Nov 2023 19:30:16 GMT (envelope-from git) Date: Sun, 19 Nov 2023 19:30:16 GMT Message-Id: <202311191930.3AJJUGBo026372@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: 9ed67f1307f4 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 9ed67f1307f40b3173ea3b3889c6323f9ef4a58f Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ed67f1307f40b3173ea3b3889c6323f9ef4a58f commit 9ed67f1307f40b3173ea3b3889c6323f9ef4a58f Author: Aaron LI AuthorDate: 2023-11-11 13:13:08 +0000 Commit: Kristof Provost CommitDate: 2023-11-18 09:46:21 +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 4a21afe82eb5..0ea40b763416 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -562,7 +562,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;