From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 19:34:12 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 953ED7CA; Sat, 13 Jun 2015 19:34:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 5F38530E; Sat, 13 Jun 2015 19:34:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t5DJYCQE085435; Sat, 13 Jun 2015 19:34:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 097E29530; Sat, 13 Jun 2015 19:34:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id R5P0pUjOgt9b; Sat, 13 Jun 2015 19:34:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5F914951F Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r284345 - in head: . bin/cat bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/expr bin/freebsd-version bin/getfacl bin/hostname bi... From: Bryan Drewery X-Mailer: iPhone Mail (12F70) In-Reply-To: <201506131920.t5DJKwMH033508@svn.freebsd.org> Date: Sat, 13 Jun 2015 15:34:03 -0400 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <16F9D7DF-A3D6-4675-9789-4F5AE1E3F940@FreeBSD.org> References: <201506131920.t5DJKwMH033508@svn.freebsd.org> To: "Simon J. Gerraty" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2015 19:34:12 -0000 > On Jun 13, 2015, at 15:20, Simon J. Gerraty wrote: > > Author: sjg > Date: Sat Jun 13 19:20:56 2015 > New Revision: 284345 > URL: https://svnweb.freebsd.org/changeset/base/284345 > > Log: > Add META_MODE support. Thanks!! Is anything remaining from the projects/bmake branch? From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 19:39:22 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B86F0AAB; Sat, 13 Jun 2015 19:39:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) 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 99DF033C; Sat, 13 Jun 2015 19:39:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5DJdMbh043706; Sat, 13 Jun 2015 19:39:22 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5DJdMUs043703; Sat, 13 Jun 2015 19:39:22 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201506131939.t5DJdMUs043703@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 13 Jun 2015 19:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284348 - in head/sys: dev/virtio/network net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2015 19:39:22 -0000 Author: kp Date: Sat Jun 13 19:39:21 2015 New Revision: 284348 URL: https://svnweb.freebsd.org/changeset/base/284348 Log: Fix panic when adding vtnet interfaces to a bridge vtnet interfaces are always in promiscuous mode (at least if the VIRTIO_NET_F_CTRL_RX feature is not negotiated with the host). if_promisc() on a vtnet interface returned ENOTSUP although it has IFF_PROMISC set. This confused the bridge code. Instead we now accept all enable/disable promiscuous commands (and always keep IFF_PROMISC set). There are also two issues with the if_bridge error handling. If if_promisc() fails it uses bridge_delete_member() to clean up. This tries to disable promiscuous mode on the interface. That runs into an assert, because promiscuous mode was never set in the first place. (That's the panic reported in PR 200210.) We can only unset promiscuous mode if the interface actually is promiscuous. This goes against the reference counting done by if_promisc(), but only the first/last if_promic() calls can actually fail, so this is safe. A second issue is a double free of bif. It's already freed by bridge_delete_member(). PR: 200210 Differential Revision: https://reviews.freebsd.org/D2804 Reviewed by: philip (mentor) Modified: head/sys/dev/virtio/network/if_vtnet.c head/sys/net/if_bridge.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sat Jun 13 19:36:32 2015 (r284347) +++ head/sys/dev/virtio/network/if_vtnet.c Sat Jun 13 19:39:21 2015 (r284348) @@ -1080,8 +1080,12 @@ vtnet_ioctl(struct ifnet *ifp, u_long cm (IFF_PROMISC | IFF_ALLMULTI)) { if (sc->vtnet_flags & VTNET_FLAG_CTRL_RX) vtnet_rx_filter(sc); - else - error = ENOTSUP; + else { + ifp->if_flags |= IFF_PROMISC; + if ((ifp->if_flags ^ sc->vtnet_if_flags) + & IFF_ALLMULTI) + error = ENOTSUP; + } } } else vtnet_init_locked(sc); Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Sat Jun 13 19:36:32 2015 (r284347) +++ head/sys/net/if_bridge.c Sat Jun 13 19:39:21 2015 (r284348) @@ -1033,9 +1033,12 @@ bridge_delete_member(struct bridge_softc case IFT_ETHER: case IFT_L2VLAN: /* - * Take the interface out of promiscuous mode. + * Take the interface out of promiscuous mode, but only + * if it was promiscuous in the first place. It might + * not be if we're in the bridge_ioctl_add() error path. */ - (void) ifpromisc(ifs, 0); + if (ifs->if_flags & IFF_PROMISC) + (void) ifpromisc(ifs, 0); break; case IFT_GIF: @@ -1203,10 +1206,8 @@ bridge_ioctl_add(struct bridge_softc *sc break; } - if (error) { + if (error) bridge_delete_member(sc, bif, 0); - free(bif, M_DEVBUF); - } return (error); }