Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 2023 02:52:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 275001] if_wg: Missing radix unlock can cause deadlock
Message-ID:  <bug-275001-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275001

            Bug ID: 275001
           Summary: if_wg: Missing radix unlock can cause deadlock
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: aly@aaronly.me

In file 'sys/dev/wg/if_wg.c' function 'wg_aip_add()', the error path of
returning ENOMEM when (node =3D=3D NULL) is forgetting to unlock the radix =
tree,
and thus may lead to a deadlock.

Below is the patch, please review.

--- if_wg.c.orig        2023-10-12 09:06:16.983637264 +0800
+++ if_wg.c     2023-10-21 15:29:47.928807521 +0800
@@ -562,7 +562,7 @@
                node =3D root->rnh_lookup(&aip->a_addr, &aip->a_mask, &root=
->rh);
        if (!node) {
                free(aip, M_WG);
-               return (ENOMEM);
+               ret =3D ENOMEM;
        } else if (node !=3D aip->a_nodes) {
                free(aip, M_WG);
                aip =3D (struct wg_aip *)node;

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-275001-227>