Page MenuHomeFreeBSD

netinet: Explicitly disallow connections to the unspecified address
ClosedPublic

Authored by markj on Tue, Aug 27, 1:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 12, 2:26 AM
Unknown Object (File)
Wed, Sep 11, 5:44 AM
Unknown Object (File)
Sun, Sep 8, 9:09 AM
Unknown Object (File)
Mon, Sep 2, 12:15 PM
Unknown Object (File)
Fri, Aug 30, 5:28 PM
Unknown Object (File)
Thu, Aug 29, 12:52 AM
Unknown Object (File)
Thu, Aug 29, 12:52 AM
Unknown Object (File)
Wed, Aug 28, 11:50 PM

Details

Summary

If the V_connect_ifaddr_wild sysctl says that we shouldn't infer a
destination address, return an error. Otherwise it's possible for use
of an unspecified foreign address to trigger a subsequent assertion
failure, for example in in_pcblookup_hash_locked().

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Tue, Aug 27, 1:52 PM
This revision is now accepted and ready to land.Tue, Aug 27, 4:02 PM

What if V_connect_inaddr_wild is true but also CK_STAILQ_EMPTY(&V_in_ifaddrhead)?
I guess ENETUNREACH is sensible in that case as well.

What if V_connect_inaddr_wild is true but also CK_STAILQ_EMPTY(&V_in_ifaddrhead)?
I guess ENETUNREACH is sensible in that case as well.

Yes, that was intentional. This is really about ensuring that the unspecified address, which is used as a sentinel in some places, doesn't get propagated further down into the inpcb layer.

zlei added a subscriber: zlei.

Looks good to me.