From nobody Sat Nov 11 14:44:24 2023 X-Original-To: dev-commits-src-main@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 4SSJP50xPpz513JH; Sat, 11 Nov 2023 14:44:25 +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 4SSJP50NJzz3bZc; Sat, 11 Nov 2023 14:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699713865; 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=vqk6E/iQ/ypJF8BODm/SiVoG247cLFr3qhmGzV6Taso=; b=YQX7i9JL1r4SXc7HMwxP8RVgdwtl3rvCmQID+GvosuIARKURpnKXQ9RkTOkhMWr0YaVcro pGM7pWM86SpF1ZA7hrQjPCUCr2Mrpi/sK9qbFfbXjpyeZBo6675r1JVC4hyA8qEpfXiv6L kr+1cR3t36LFxWo0JLBxnUQX/XY8TdRh6MAComr7b3/EkH5gpIv41wJIvmTNdpKCxjSPaT XokfECQ47LLj9IUAjES/gIe0V5RxN8zv1ZOJQMJEJM6cYpjS3HOGf2VmtEGHZRTSWhHL3y 6YP1858jRpIeCEdeCQaiBVOZtNAztvAlGzYRNoB1Kd0RcanUpzgiYIkk/c5YFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699713865; 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=vqk6E/iQ/ypJF8BODm/SiVoG247cLFr3qhmGzV6Taso=; b=q3bMxnOUEJJmtcot4bFwpDj7gr10YOCozRYv+c/+0ammaOR7sBPmHS8PAjEvGNgK+ygcnC d/NlRqSSzCumlh9uqGbX5/5NXkPAV/JPWplFjFppCcWMPwd4Ei0VND+ev84tBvYWvKAeyC GKKCfYhr0RCeFfFcZ22KTxQbTuTs5T/W10T8hclj1B6yGj6Bb1A6zRtds4Kmw3Fq6Cq2iv eQMq2yTaDVes421ajACD4zF3H6W+wRVmiOxI76i00qW0tsldjh9h648sI18WprVLxjVbWZ Plsisja4H5Hs6ZO+f35covQ+UUSTfVF72gZHACeHvjPLxbr40imaWVuIGCvQPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699713865; a=rsa-sha256; cv=none; b=E/uxuaCu5d70k4sq8w8eHRI4GAH0fogs2BWDyHFRizL1KWZ1cVXl86+b8VwPRu+El70MSY Mz0ckHGJS2yDps5A32V8j5bqbIuwB677YaW+mc+vYBR2OL+x+4TSgjHsXtgQWU30KChelQ ObR2l2+wI5ULqMtBCmndjdIDYt0a2M+9ekpXCMwPL+KAGuLJX6eVgGGwqG78GT+U1TJcU3 rZNhxfW/rq0SWrRz+Kah70jOoqXc0tFXG4euAyDZs4V/4cVjm+b4xttsmmAvGSww/uCZAd Fz7YXMtCEK24+3A4kqRd2P/DCWKyPgfm9T7Be7RtoB4dOLkNjzsWaK9xA8Ehbw== 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 4SSJP46Yg5zl4Q; Sat, 11 Nov 2023 14:44:24 +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 3ABEiOcK086440; Sat, 11 Nov 2023 14:44:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ABEiOIc086437; Sat, 11 Nov 2023 14:44:24 GMT (envelope-from git) Date: Sat, 11 Nov 2023 14:44:24 GMT Message-Id: <202311111444.3ABEiOIc086437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: dcc4d2939f78 - main - if_wg: Missing radix unlock can cause deadlock List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: dcc4d2939f789a6d1f272ffeab2068ba2b7525ea Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dcc4d2939f789a6d1f272ffeab2068ba2b7525ea commit dcc4d2939f789a6d1f272ffeab2068ba2b7525ea Author: Aaron LI AuthorDate: 2023-11-11 13:13:08 +0000 Commit: Kristof Provost CommitDate: 2023-11-11 13:13:08 +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 --- 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;