From owner-svn-src-head@freebsd.org Sun Feb 19 16:20:04 2017 Return-Path: Delivered-To: svn-src-head@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 2E17BCE5F8D; Sun, 19 Feb 2017 16:20:04 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CC0491F74; Sun, 19 Feb 2017 16:20:03 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id fUDRcTOw1sa1kfUDSchBEc; Sun, 19 Feb 2017 09:20:02 -0700 X-Authority-Analysis: v=2.2 cv=W+NIbVek c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n2v9WMKugxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=PNSh0XS_3XU6sIBE0BMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id DA72E3E6; Sun, 19 Feb 2017 08:20:00 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v1JGJxkw013169; Sun, 19 Feb 2017 08:19:59 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201702191619.v1JGJxkw013169@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Edward Tomasz Napierala cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313943 - head/sbin/mdconfig In-Reply-To: Message from Edward Tomasz Napierala of "Sun, 19 Feb 2017 16:08:58 +0000." <201702191608.v1JG8wAN068829@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 19 Feb 2017 08:19:59 -0800 X-CMAE-Envelope: MS4wfHH0JNrKa950rxswXTHwxeXd39cYNifixaUacaD7EZnpRIhCIWn5SbjFykqWP7wlfQJGSD4TEUioE/ZWPfi1YKAPaEJPk6+OA7zqv/Tsjaz7Jw6AFB4r pqx0Da6OWQ5YcNmyXfzK/KUd/sNcqrCZUdwEcEFiePijjcQgzZog3EUAgTYIByxxRzyNmVKxrqwikfbnWzfxNInitmFqG6ka6SJCwRES8O+gpDrVAr8mApRv mdkvGyzkOlKznOtJ1t0pF9JjbF1f/XVzQHECYV+dm3K9aQm+4QFWlSQdiCVGQ+gl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 19 Feb 2017 16:20:04 -0000 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? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.