From owner-svn-src-all@freebsd.org Fri Feb 1 00:40:26 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 3A85F14BDD88; Fri, 1 Feb 2019 00:40:26 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8980283F63; Fri, 1 Feb 2019 00:40:25 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x131.google.com with SMTP id v5so3766340lfe.7; Thu, 31 Jan 2019 16:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=fNF+DrL6yGsX3CO+9pcKrSCdgo3SRvSSt70DXn49aa4=; b=Nii+0MzHge4DkdofNQJF3CwKAt/aMxlenXoU5FU9udHni2MEfZsGUPUF1beuFiLRl4 8Ce59B2yoGzY0jx8UCqQ14LCzV4w0JnUs6DrVpI6W0l+O/iiGqjq2ABk7iNAlPshu1iy XwpalUID65r2B4MijxUyQOQae5lu0qsxVqbx//SveqRgIzK/MubLCcabvTZopBKXafYC Sh21StF+/YEpQvb4AoLYqnbU+OURIBrWnDotiWV8k8W9QZKNKOYCyv8AGHKHQql6ZZIG uUlr6fH5hKSVbn4KkRZ3sDvbS93PyBywf7f6Ou2CJFuoBG1iUGfHFCYqmz1ZY8ix34LP 9RUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=fNF+DrL6yGsX3CO+9pcKrSCdgo3SRvSSt70DXn49aa4=; b=S7bx/j9hZgyvmr05Y3e7hSafcaaaui7EotadrX5IIUOSWflBG0Fuo8wmJATgrHrud0 ZSUnQqW4w0bJce+t6Np3ESFNgwMEEzACbJrJ+GRaSDHcASuCgNNpAbeiSzzXNoT7p8f9 a4JlFzE53ryNx95KS5XlB9juREyWVLtJTaBZKX3QqmsS6xfYIH4WES8Huz92tEJ3tZIs tnRgC/K9JrdVDpOjJZQDfCB69bVJMR5MIYJ/9/T5KvvL3qxj6qDsMvL4pejKwR786U9i f/159bbEjE/W1z7lMsO9mqBs086vXt98mACjj4Mea3pc6dkOOBAXf/WaV9UGRosPfwKf 4XhA== X-Gm-Message-State: AHQUAuawxy0ewDM3pCczoAQIbGL6QQMS5Cd3o93zhxx7qRUj9+puYRds dbAHbxBz2QcSGIehiYErAoP7QOXbvtWrSbWfeJE= X-Google-Smtp-Source: AHgI3IavqAnZ51UaYZRhmYzR5Vb+MAbAuOEsfpWpXXZQoQJLelcK/uXd9cKKsXbsL8DPzXp0A2XEfWYaiXGcW2Qc0O0= X-Received: by 2002:ac2:53b7:: with SMTP id j23mr2344420lfh.109.1548981623894; Thu, 31 Jan 2019 16:40:23 -0800 (PST) MIME-Version: 1.0 References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> In-Reply-To: Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Fri, 1 Feb 2019 08:40:11 +0800 Message-ID: Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve To: Warner Losh Cc: Konstantin Belousov , Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 8980283F63 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 00:40:26 -0000 Em sex, 1 de fev de 2019 =C3=A0s 08:36, Warner Losh escrev= eu: > > > 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. Best, > > Warner > > > >> > Obtained from: Project ACRN >> > MFC after: 2 weeks >> > >> > Modified: >> > head/usr.sbin/bhyve/bhyverun.c >> > head/usr.sbin/bhyve/smbiostbl.c >> > head/usr.sbin/bhyve/usb_mouse.c >> > >> > Modified: head/usr.sbin/bhyve/bhyverun.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:21:18 2019 >> (r343633) >> > +++ head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:32:19 2019 >> (r343634) >> > @@ -233,8 +233,8 @@ usage(int code) >> > " -W: force virtio to use single-vector MSI\n" >> > " -x: local apic is in x2APIC mode\n" >> > " -Y: disable MPtable generation\n", >> > - progname, (int)strlen(progname), "", >> (int)strlen(progname), "", >> > - (int)strlen(progname), ""); >> > + progname, (int)strnlen(progname, PATH_MAX), "", >> (int)strnlen(progname, PATH_MAX), "", >> > + (int)strnlen(progname, PATH_MAX), ""); >> > >> > exit(code); >> > } >> > >> > Modified: head/usr.sbin/bhyve/smbiostbl.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:21:18 2019 >> (r343633) >> > +++ head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:32:19 2019 >> (r343634) >> > @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure >> *te >> > int len; >> > >> > string =3D template_strings[i]; >> > - len =3D strlen(string) + 1; >> > + len =3D strnlen(string, SMBIOS_MAX_LENGTH) + 1; >> > memcpy(curaddr, string, len); >> > curaddr +=3D len; >> > } >> > @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure >> *temp >> > return (-1); >> > >> > MD5Init(&mdctx); >> > - MD5Update(&mdctx, vmname, strlen(vmname)); >> > + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX)); >> > MD5Update(&mdctx, hostname, sizeof(hostname)); >> > MD5Final(digest, &mdctx); >> > >> > >> > Modified: head/usr.sbin/bhyve/usb_mouse.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:21:18 2019 >> (r343633) >> > +++ head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:32:19 2019 >> (r343634) >> > @@ -70,6 +70,7 @@ enum { >> > UMSTR_MAX >> > }; >> > >> > +#define UMOUSE_DESC_MAX_LEN 32 >> > static const char *umouse_desc_strings[] =3D { >> > "\x04\x09", >> > "BHYVE", >> > @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer >> *xfer >> > goto done; >> > } >> > >> > - slen =3D 2 + strlen(str) * 2; >> > + slen =3D 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) *= 2; >> > udata[0] =3D slen; >> > udata[1] =3D UDESC_STRING; >> > >> >> --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_)