diff options
| author | Aaron LI <aly@aaronly.me> | 2023-11-11 13:13:08 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2023-11-19 19:29:35 +0000 |
| commit | 16c65f7ae15e6ca8b36fc546e038c59270c87ccc (patch) | |
| tree | 907b03707406a776c657e38b3ba23664eeb2ad21 | |
| parent | e23e0e3c9cbf1ca79e1029c89b19c88a28c18e9f (diff) | |
| download | src-16c65f7ae15e6ca8b36fc546e038c59270c87ccc.tar.gz src-16c65f7ae15e6ca8b36fc546e038c59270c87ccc.zip | |
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)
| -rw-r--r-- | sys/dev/wg/if_wg.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |
