Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Jul 2014 16:19:24 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-standards@FreeBSD.org
Subject:   [Bug 191586] FreeBSD doesn't validate negative edgecases in bind(2)/connect(2)/listen(2) like POSIX requires
Message-ID:  <bug-191586-15-waCm3esgrK@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-191586-15@https.bugs.freebsd.org/bugzilla/>
References:  <bug-191586-15@https.bugs.freebsd.org/bugzilla/>

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

Kevin Lo <kevlo@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Triage                |In Discussion
                 CC|                            |kevlo@FreeBSD.org

--- Comment #3 from Kevin Lo <kevlo@FreeBSD.org> ---
(In reply to Terry Lambert from comment #2)
> Some valid statements, some invalid.  You would have to configure the VSX4
> tests correctly to expect the results that you'd get, but some of these are
> optional implement, while still being conformant.
> 
> For the interfaces in question, the relevant documents are:
> http://pubs.opengroup.org/onlinepubs/009695399/functions/bind.html
> http://pubs.opengroup.org/onlinepubs/009695399/functions/connect.html
> http://pubs.opengroup.org/onlinepubs/009695399/functions/listen.html
> 
> 
> Comments are by API:
> 
> bind(2):
> 
> The EAFNOSUPPORT is non-optional; however, the test code is bogus, in that
> it has to specify an existing address family, such as AF_INET, rather than a
> potentially loaded/pluggable address family.  Because this is a negative
> assertion test, it needs to hit on something that's actually guaranteed to
> be there, such as AF_INET r AF_UNIX.

[snip]

Here's the diff that enables check family for bind(2), ok?

Index: sys/netinet/in_pcb.c
===================================================================
--- sys/netinet/in_pcb.c        (revision 268261)
+++ sys/netinet/in_pcb.c        (working copy)
@@ -528,14 +528,11 @@ in_pcbbind_setup(struct inpcb *inp, struct sockadd
                sin = (struct sockaddr_in *)nam;
                if (nam->sa_len != sizeof (*sin))
                        return (EINVAL);
-#ifdef notdef
                /*
-                * We should check the family, but old programs
-                * incorrectly fail to initialize it.
+                * Family check.
                 */
                if (sin->sin_family != AF_INET)
                        return (EAFNOSUPPORT);
-#endif
                error = prison_local_ip4(cred, &sin->sin_addr);
                if (error)
                        return (error);

-- 
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-191586-15-waCm3esgrK>