[Bug 214542] sysctl_ifmalisti: missing IF_ADDR_RUNLOCK if rtsock_msg_buffer returns error

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Nov 15 17:53:13 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214542

            Bug ID: 214542
           Summary: sysctl_ifmalisti: missing IF_ADDR_RUNLOCK if
                    rtsock_msg_buffer returns error
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: tony.cai1982 at gmail.com

diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index ca89002..47777c3 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1798,8 +1798,10 @@ sysctl_ifmalist(int af, struct walkarg *w)
                            (ifma->ifma_addr->sa_family != AF_LINK) ?
                            ifma->ifma_lladdr : NULL;
                        error = rtsock_msg_buffer(RTM_NEWMADDR, &info, w,
&len);
-                       if (error != 0)
+                       if (error != 0) {
+                               IF_ADDR_RUNLOCK(ifp);
                                goto done;
+                       }
                        if (w->w_req && w->w_tmem) {
                                struct ifma_msghdr *ifmam;

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


More information about the freebsd-bugs mailing list