[Bug 255495] udp socket inheritance after fork+exec

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Apr 29 17:57:50 UTC 2021


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

            Bug ID: 255495
           Summary: udp socket inheritance after fork+exec
           Product: Base System
           Version: 12.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: net at FreeBSD.org
          Reporter: eugen at freebsd.org
                CC: mav at FreeBSD.org, melifaro at FreeBSD.org

I observe the following unexpected behaviour while running both net/frr7 and
net/mpd5 within same 12.2-STABLE/amd64 system. After boot, it runs just fine:

# sockstat | fgrep frr
frr      staticd    37908 6  dgram  -> /var/run/logpriv
frr      staticd    37908 10 stream -> /var/run/frr/zserv.api
frr      staticd    37908 11 stream /var/run/frr/staticd.vty
frr      ospfd      37903 6  dgram  -> /var/run/logpriv
frr      ospfd      37903 10 stream -> /var/run/frr/zserv.api
frr      ospfd      37903 11 stream /var/run/frr/ospfd.vty
frr      zebra      37898 6  dgram  -> /var/run/logpriv
frr      zebra      37898 18 stream /var/run/frr/zserv.api
frr      zebra      37898 21 stream /var/run/frr/zebra.vty
frr      zebra      37898 23 stream /var/run/frr/zserv.api
frr      zebra      37898 28 stream /var/run/frr/zserv.api

# sockstat | fgrep mpd5 | fgrep udp4
root     mpd5       26675 26 udp4   *:1701                *:*

That is, mpd5 expects incoming L2TP connections at port udp/1701 and frr7
daemon do not use any UDP sockets, as configured.

The mpd5 daemon has ip-down/ip-up scripts that may do "service frr stop" and
"service frr start" in come cases, so frr7 daemons may be started as
grandchildren of mpd5 process. After that, I observe this:

# sockstat | fgrep frr
frr      staticd    40712 6  dgram  -> /var/run/logpriv
frr      staticd    40712 12 stream -> /var/run/frr/zserv.api
frr      staticd    40712 13 stream /var/run/frr/staticd.vty
frr      staticd    40712 26 udp4   *:1701                *:*
frr      ospfd      40707 6  dgram  -> /var/run/logpriv
frr      ospfd      40707 12 stream -> /var/run/frr/zserv.api
frr      ospfd      40707 13 stream /var/run/frr/ospfd.vty
frr      ospfd      40707 26 udp4   *:1701                *:*
frr      zebra      40702 6  dgram  -> /var/run/logpriv
frr      zebra      40702 24 stream /var/run/frr/zserv.api
frr      zebra      40702 25 stream /var/run/frr/zebra.vty
frr      zebra      40702 26 udp4   *:1701                *:*
frr      zebra      40702 30 stream /var/run/frr/zserv.api
frr      zebra      40702 35 stream /var/run/frr/zserv.api

frr daemons somehow inherit udp4/1501 socket and that is bad for local L2TP
service, it is broken now.

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


More information about the freebsd-net mailing list