From owner-freebsd-net@freebsd.org Thu Jul 2 13:34:39 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 775CD9933F6 for ; Thu, 2 Jul 2015 13:34:39 +0000 (UTC) (envelope-from nvass@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 044681E09; Thu, 2 Jul 2015 13:34:39 +0000 (UTC) (envelope-from nvass@gmx.com) Received: from moby.local ([79.107.43.83]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MP1PX-1Z5PiL2hEN-006NfL; Thu, 02 Jul 2015 15:09:50 +0200 Message-ID: <55953806.6070200@gmx.com> Date: Thu, 02 Jul 2015 16:09:26 +0300 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Kristof Provost CC: freebsd-net@FreeBSD.org Subject: Re: [Bug 200210] adding vtnet to bridge results to kernel panic References: <55941147.7040601@gmx.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:zYQWQnMq7Gggb3x+8Z8X6iVBcQWUfwE5t3IklHNc+tpI4kmmfa0 lmF/4yGQZm2Wcrpa6BrAAsV8wEN84HbrKJWAgWQhOD3AJJsDyvDSd4MuGVcAPIE79+roNKs ZvV9fysniJpXGvWwLq6UUgPkVXqi9HgW+JzVv8CjfhzI9nNXuxI3COdTbWnjSXOnPzJyZ/p 1EXdiDycxDrCmLOVh4Q4w== X-UI-Out-Filterresults: notjunk:1;V01:K0:JXaLCf8uVLo=:vlL1TarRH6voWbUg0hPHtZ jsLTh4R9aZ2dZK0/QO54RO60gjoKIxhJuw+LMbIpag6KaFKaUxjLNti357fQIqYwrG5JTLPkL 7ITaIdOCldy7yxLXJr7PaYT9vaHnU9jyDbylbbSMuOFLlBZa5t3CqNifZIDEOcnkkJaWGvvgv kf6Ynz6WUA0CkeTNiO2k2ErknhN1BGtH2JJii5JwZiDN81z7K0ewWHE/CSjUz6Il5RXRS2Wky cV4HlmDlooJu6+pp8k7sc3Sroy1HfxfkzqCtBKweIbKxrsx99uiZZE+QkbYbK3FURNXgXf5t/ FG4tFD7nCJhJkiC9c5Eq3NWHRKVP+iO9/KePfwSWBSd1ZnzEf1uBB8Sa3we7muWmkoa06wTko Oit7QGFGlFQGr/pIo6UEotH4YLUlNPPQ3GqQ2h93+cO6JgHyi7g+UfjE/TRGP0VdXe+m6kpit K00M6aRTvweEM1iS5usOORUcPa98ur/YZgHjNxBPpFNgZIUWOn/i5M4/Rl/jNJcBrMkrrBsOr 3j7dzHl5GfEsEGmRpvXDr73R0s5xZ/1xVi0Ia3isk1NKTL3h6glbal7h+2OZNTo+nps9DLo2M DYKLhs5yr9IYlkAPXIkzg13E/L8kOx6gaFsj0arv3C5Hm4DiIFTyDZdheKd0xZa8f+OZd9td2 bqodnSNLUISEXS+uFQjQEysP6kGz5EUxIUc1up0Cwo5RPRtNbS4LDKJZ/7n2dqLj3DQM= X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 13:34:39 -0000 Thank u! On 07/02/15 00:22, Kristof Provost wrote: > Done in r285016. > > Regards, > Kristof > >> On 01 Jul 2015, at 18:11, Nikos Vassiliadis wrote: >> >> Hi Kristof, >> >> Thanks for fixing this! Could you MFC the fix? >> >> On 06/13/15 22:39, bugzilla-noreply@freebsd.org wrote: >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200210 >>> >>> --- Comment #1 from commit-hook@freebsd.org --- >>> A commit references this bug: >>> >>> Author: kp >>> Date: Sat Jun 13 19:39:22 UTC 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) >>> >>> Changes: >>> head/sys/dev/virtio/network/if_vtnet.c >>> head/sys/net/if_bridge.c >>> >> >