From owner-svn-src-head@freebsd.org Sat May 26 19:44:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37934EF40F9; Sat, 26 May 2018 19:44:46 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id C235E7E9C9; Sat, 26 May 2018 19:44:45 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from hammy.vangyzen.net (173-28-118-115.client.mchsi.com [173.28.118.115]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 46A455646B; Sat, 26 May 2018 14:44:38 -0500 (CDT) Subject: Re: svn commit: r334104 - in head/sys: netinet sys To: Gleb Smirnoff , Mateusz Guzik Cc: "Jonathan T. Looney" , Matthew Macy , John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805231700.w4NH05hs047395@repo.freebsd.org> <2281830.zrSQodBeDb@ralph.baldwin.cx> <20180524044746.GX71675@FreeBSD.org> From: Eric van Gyzen Message-ID: <954ca6de-43dd-af9a-2ab1-2786473de611@vangyzen.net> Date: Sat, 26 May 2018 14:44:31 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180524044746.GX71675@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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, 26 May 2018 19:44:46 -0000 On 05/23/2018 23:47, Gleb Smirnoff wrote: > On Thu, May 24, 2018 at 06:44:20AM +0200, Mateusz Guzik wrote: > M> I fundamentally disagree with this part. > M> > M> If a known value of a given field is needed for assertion purposes, you > M> can add (possibly conditional) code setting this specific value. It > M> probably should not be zero if it can be helped. > M> > M> Conditional zeroing of the *whole* struct depending on invariants will > M> *hide* uninitialized memory read bugs - production kernel will have > M> whatever it happens to find, while *debug* kernel will guarantee to > M> have all the values zeroed. In fact the flag actively combats redzoning. > M> if the resulting allocation is zeroed, poisoning is actively neutered. > M> But only if debug is enabled. > M> > M> That said, I find the change harmful. > > +1 on fundamentally disagree with M_ZERO_INVARIANTS. It makes the > INVARIANTS-enabled kernels to crash _later_ than production kernels, > since instead of uma_junk it places clean zeroes. Matt, Mateusz and Gleb raise very good points. This operates contrary to the whole idea of INVARIANTS. Please revisit this. Eric