From owner-svn-src-all@FreeBSD.ORG Thu Jul 24 05:57:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B4E7169; Thu, 24 Jul 2014 05:57:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28260274E; Thu, 24 Jul 2014 05:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6O5vYYv030002; Thu, 24 Jul 2014 05:57:34 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6O5vYqo030001; Thu, 24 Jul 2014 05:57:34 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201407240557.s6O5vYqo030001@svn.freebsd.org> From: Kevin Lo Date: Thu, 24 Jul 2014 05:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269044 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2014 05:57:34 -0000 Author: kevlo Date: Thu Jul 24 05:57:33 2014 New Revision: 269044 URL: http://svnweb.freebsd.org/changeset/base/269044 Log: MFC r268601: Make bind(2) and connect(2) return EAFNOSUPPORT for AF_UNIX on wrong address family. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191586 for the original discussion. Reviewed by: terry Modified: stable/10/sys/kern/uipc_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_usrreq.c ============================================================================== --- stable/10/sys/kern/uipc_usrreq.c Thu Jul 24 05:31:57 2014 (r269043) +++ stable/10/sys/kern/uipc_usrreq.c Thu Jul 24 05:57:33 2014 (r269044) @@ -467,6 +467,9 @@ uipc_bindat(int fd, struct socket *so, s cap_rights_t rights; char *buf; + if (nam->sa_family != AF_UNIX) + return (EAFNOSUPPORT); + unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); @@ -1278,6 +1281,9 @@ unp_connectat(int fd, struct socket *so, cap_rights_t rights; int error, len; + if (nam->sa_family != AF_UNIX) + return (EAFNOSUPPORT); + UNP_LINK_WLOCK_ASSERT(); unp = sotounpcb(so);