Date: Sat, 11 Nov 2023 14:44:24 GMT From: Kristof Provost <kp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: dcc4d2939f78 - main - if_wg: Missing radix unlock can cause deadlock Message-ID: <202311111444.3ABEiOIc086437@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dcc4d2939f789a6d1f272ffeab2068ba2b7525ea commit dcc4d2939f789a6d1f272ffeab2068ba2b7525ea Author: Aaron LI <aly@aaronly.me> AuthorDate: 2023-11-11 13:13:08 +0000 Commit: Kristof Provost <kp@FreeBSD.org> 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202311111444.3ABEiOIc086437>