Date: Sat, 26 May 2018 12:47:07 -0700 From: Matthew Macy <mmacy@freebsd.org> To: Eric van Gyzen <eric@vangyzen.net> Cc: Gleb Smirnoff <glebius@freebsd.org>, Mateusz Guzik <mjguzik@gmail.com>, "Jonathan T. Looney" <jtl@freebsd.org>, John Baldwin <jhb@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334104 - in head/sys: netinet sys Message-ID: <CAPrugNqAUPJJNg6g=aQCUOhA7PbFrSR4eXFDYrUd1WSRYJD8ag@mail.gmail.com> In-Reply-To: <954ca6de-43dd-af9a-2ab1-2786473de611@vangyzen.net> References: <201805231700.w4NH05hs047395@repo.freebsd.org> <2281830.zrSQodBeDb@ralph.baldwin.cx> <CAPrugNo8_h5jnn2Yt250ZH1crwxHhK46QK1vfdyWssYjuuSAqQ@mail.gmail.com> <CADrOrmtmSYtMt4vrqdFHrLqAArBaws8bAeynPa8X_sz7ui86uw@mail.gmail.com> <CAGudoHFi6T3tNCy8NUq=oF6h_4=i0cc3peiD%2BE5-NRYKQZX9Tg@mail.gmail.com> <20180524044746.GX71675@FreeBSD.org> <954ca6de-43dd-af9a-2ab1-2786473de611@vangyzen.net>
next in thread | previous in thread | raw e-mail | index | archive | help
I've re-edited that code twice by request by others. I will amend it again at some point to reflect this viewpoint. On Sat, May 26, 2018 at 12:44 PM, Eric van Gyzen <eric@vangyzen.net> wrote: > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPrugNqAUPJJNg6g=aQCUOhA7PbFrSR4eXFDYrUd1WSRYJD8ag>