From owner-freebsd-net@FreeBSD.ORG Sat Sep 12 20:20:03 2009 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0C2D1065679 for ; Sat, 12 Sep 2009 20:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 76E278FC12 for ; Sat, 12 Sep 2009 20:20:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8CKK3Kb009807 for ; Sat, 12 Sep 2009 20:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8CKK3nO009806; Sat, 12 Sep 2009 20:20:03 GMT (envelope-from gnats) Date: Sat, 12 Sep 2009 20:20:03 GMT Message-Id: <200909122020.n8CKK3nO009806@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/137164: commit references a PR X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2009 20:20:03 -0000 The following reply was made to PR kern/137164; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/137164: commit references a PR Date: Sat, 12 Sep 2009 20:18:37 +0000 (UTC) Author: bms Date: Sat Sep 12 20:18:23 2009 New Revision: 197135 URL: http://svn.freebsd.org/changeset/base/197135 Log: Don't allow joins w/o source on an existing group. This is almost always pilot error. We don't need to check for group filter UNDEFINED state at t1, because we only ever allocate filters with their groups, so we unconditionally reject such calls with EINVAL. Trying to change the active filter mode w/o going through IP_MSFILTER is also disallowed. Deals with the case described in PR 137164 upfront, cumulative with the fix in svn rev 197132 which only calls imo_match_source() if the source address family was not unspecified. PR: 137164 MFC after: 5 days Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sat Sep 12 20:03:45 2009 (r197134) +++ head/sys/netinet/in_mcast.c Sat Sep 12 20:18:23 2009 (r197135) @@ -1982,15 +1982,18 @@ inp_join_group(struct inpcb *inp, struct } } else { /* - * MCAST_JOIN_GROUP on an existing inclusive - * membership is an error; if you want to change - * filter mode, you must use the userland API - * setsourcefilter(). + * MCAST_JOIN_GROUP alone, on any existing membership, + * is rejected, to stop the same inpcb tying up + * multiple refs to the in_multi. + * On an existing inclusive membership, this is also + * an error; if you want to change filter mode, + * you must use the userland API setsourcefilter(). + * XXX We don't reject this for imf in UNDEFINED + * state at t1, because allocation of a filter + * is atomic with allocation of a membership. */ - if (imf->imf_st[1] == MCAST_INCLUDE) { - error = EINVAL; - goto out_inp_locked; - } + error = EINVAL; + goto out_inp_locked; } } @@ -2025,6 +2028,9 @@ inp_join_group(struct inpcb *inp, struct * membership of the group. The in_multi may not have * been allocated yet if this is a new membership, however, * the in_mfilter slot will be allocated and must be initialized. + * + * Note: Grafting of exclusive mode filters doesn't happen + * in this path. */ if (ssa->ss.ss_family != AF_UNSPEC) { /* Membership starts in IN mode */ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"