Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2017 10:40:53 -0800
From:      Cy Schubert <Cy.Schubert@komquats.com>
To:        Cy Schubert <Cy.Schubert@komquats.com>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r313943 - head/sbin/mdconfig
Message-ID:  <201702191840.v1JIerbs037421@slippy.cwsent.com>
In-Reply-To: Message from Edward Tomasz Napierala <trasz@FreeBSD.org> of "Sun, 19 Feb 2017 18:02:07 %2B0000." <20170219180207.GA6808@brick>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20170219180207.GA6808@brick>, Edward Tomasz Napierala writes:
> On 0219T0819, Cy Schubert wrote:
> > In message <201702191608.v1JG8wAN068829@repo.freebsd.org>, Edward Tomasz 
> > Napier
> > ala writes:
> > > Author: trasz
> > > Date: Sun Feb 19 16:08:58 2017
> > > New Revision: 313943
> > > URL: https://svnweb.freebsd.org/changeset/base/313943
> > > 
> > > Log:
> > >   Make mdconfig(8) not segfault when the kernel returns garbage data.
> > >   
> > >   MFC after:	2 weeks
> > >   Sponsored by:	DARPA, AFRL
> > > 
> > > Modified:
> > >   head/sbin/mdconfig/mdconfig.c
> > > 
> > > Modified: head/sbin/mdconfig/mdconfig.c
> > > =========================================================================
> ====
> > > =
> > > --- head/sbin/mdconfig/mdconfig.c	Sun Feb 19 14:53:59 2017	(r31394
> > > 2)
> > > +++ head/sbin/mdconfig/mdconfig.c	Sun Feb 19 16:08:58 2017	(r31394
> > > 3)
> > > @@ -452,8 +452,8 @@ md_list(const char *units, int opt, cons
> > >  			}
> > >  			gc = &pp->lg_config;
> > >  			type = geom_config_get(gc, "type");
> > > -			if (strcmp(type, "vnode") == 0 ||
> > > -			    strcmp(type, "preload") == 0) {
> > > +			if (type != NULL && (strcmp(type, "vnode") == 0 ||
> > > +			    strcmp(type, "preload") == 0)) {
> > >  				file = geom_config_get(gc, "file");
> > >  				if (fflag != NULL &&
> > >  				    strcmp(fflag, file) != 0)
> > > 
> > > 
> > 
> > I wonder why the kernel is returning garbage data?
> 
> Because of a bug.  I hadn't tracked that down yet, though, and while
> kernel should be trusted, some additional error checking won't hurt.

Agreed.


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702191840.v1JIerbs037421>