From owner-svn-src-all@freebsd.org Fri Feb 1 01:21:21 2019 Return-Path: Delivered-To: svn-src-all@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 B39BE14BED3D; Fri, 1 Feb 2019 01:21:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52C5885549; Fri, 1 Feb 2019 01:21:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x111LBah006107 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 1 Feb 2019 03:21:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x111LBah006107 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x111LBWp006106; Fri, 1 Feb 2019 03:21:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 1 Feb 2019 03:21:11 +0200 From: Konstantin Belousov To: araujo@freebsd.org Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve Message-ID: <20190201012111.GB24863@kib.kiev.ua> References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> <20190201010117.GA24863@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 01:21:21 -0000 On Fri, Feb 01, 2019 at 09:05:37AM +0800, Marcelo Araujo wrote: > Em sex, 1 de fev de 2019 às 09:01, Konstantin Belousov > escreveu: > > > On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote: > > > Em sex, 1 de fev de 2019 às 08:36, Warner Losh > > escreveu: > > > > > > > > > > > > > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov > > > wrote: > > > > > > > >> On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: > > > >> > Author: araujo > > > >> > Date: Thu Jan 31 23:32:19 2019 > > > >> > New Revision: 343634 > > > >> > URL: https://svnweb.freebsd.org/changeset/base/343634 > > > >> > > > > >> > Log: > > > >> > Mostly a cosmetic change to replace strlen with strnlen. > > > >> This is not cosmetic, and more, for instance the usage() part of the > > > >> change > > > >> does not make any sense to me. > > > >> > > > > > > > > I specifically objected as well and was blown off. What gives? > > > > > > > > > > I have asked you feedback and got none! I will revert the usage() changes > > > later then. > > > > I noted the usage() chunk because it is the first one in the commit and > > I stopped after I see the obvious issues with it, not because it is the > > only wrong part. > > > > Are you implying that all the patch is wrong? > I have no problem to revert it at all if you give me the right reason, it > was basically a port from another project that also uses bhyve. By default, all uses of strncmp() and strncpy() are bugs. Your commit message have no explanation what the change fixes/improves. So I looked at the second chunk, for smbios_generic_initializer(). It also seems to be wrong. If template_string[i] length is greater than SMBIOS_MAX_LENGTH, then the copied string is not nul-terminated. If its length is less than the constant, then what is the point ? I also looked at the third chunk, smbios_type1_initializer(). I cannot understand the reasoning behind it, at all. Only usb_mouse.c is left, I do not expect anything good from it.