[Bug 230498] Fatal trap 12: page fault while in kernel mode in sysctl_dumpentry from sysctl NET_RT_DUMP

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Nov 22 00:22:53 UTC 2018


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

--- Comment #13 from ian at niw.com.au ---
I did make a pretty naive fix for this shortly after reporting it as the system
in question was crashing several times a day. Since applying this I have has no
further issues with it. It does mean the application querying gets back some
null pointers, but its likely better the application exits (if it does not
check for NULL pointers) than the entire system crashing ?

Index: rtsock.c
===================================================================
--- rtsock.c    (revision 339318)
+++ rtsock.c    (working copy)
@@ -1556,8 +1556,10 @@
            rt_mask(rt), &ss);
        info.rti_info[RTAX_GENMASK] = 0;
        if (rt->rt_ifp) {
-               info.rti_info[RTAX_IFP] = rt->rt_ifp->if_addr->ifa_addr;
-               info.rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr;
+               if (rt->rt_ifp->if_addr)
+                       info.rti_info[RTAX_IFP] =
rt->rt_ifp->if_addr->ifa_addr;
+               if (rt->rt_ifa)
+                       info.rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr;
                if (rt->rt_ifp->if_flags & IFF_POINTOPOINT)
                        info.rti_info[RTAX_BRD] = rt->rt_ifa->ifa_dstaddr;
        }

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


More information about the freebsd-net mailing list