From owner-svn-src-all@freebsd.org Thu Aug 16 19:18:25 2018 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 14A691073AB7 for ; Thu, 16 Aug 2018 19:18:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (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 941C7748D8 for ; Thu, 16 Aug 2018 19:18:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id n18-v6so4793127ioa.9 for ; Thu, 16 Aug 2018 12:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=/Io/AE8ac9YGAGnEvOdoTrqZ68PP0uSUqehATenl3cA=; b=aEcfKe92ZCbECgK0Ah6CFZ+CT9UbJ26I7KFKgPnPCq3AbpZ03rBf0f2Fimhcgt7BiC SIk8A2db62YkW2FwOPi65y/r1jcCrgghgavCUe1F9yex7c0Yqos+4xHC7Jj7bX1bdIWh g3uO7GJ3Xi8gWy8A1avG1BwWDizUIZ/FgUpnkcypQqDY+0AAvr3y7W0wWg6Hw18vCvVK FSrQflf/RaoWBUH1lctwNiyhMLnb9lN8UQCALB2iTDrbAoQIGSLWRbFCNH53nGXBZ/0U l1t1P0jvP7EwKXO3lpwHlsePg6lOz+huzLh6+qJ8f+Y0bc2r/P8+CTJgdHDl/hBI9/3l v1SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=/Io/AE8ac9YGAGnEvOdoTrqZ68PP0uSUqehATenl3cA=; b=mD/V4H2eGS8CU26fp4O23SXVDlkx2NtJgUUlDOnmDboxY3Mkg3Df5S0LsRxR1jxlfb 1RKBgWNCBe6j+Pzt9y9NzrMiZMjo4kbl/YGBh8ks7h5OCX9RZhsBFmwlKJuAyckCyCCA MMAn36YqFiMYjqOsHrSlms265p3RO6yr0eN4QpmuM6q9NHoAPNnhPclkHUpiFT8yTtAo KUAinsSp2mXqcMfHc281Lof6osXZ1CEDy3JytcSqnE0tLMPJ3/jIV+Pp8HE2Hmekgk+Z 5t/z56HevkCYwh4GIcpTE1/OrQpXGmCfkGBtedf8aIoti8fxBTfD9PnYAGabfOD7kB8m EL3w== X-Gm-Message-State: AOUpUlHMM6aNob+m4LfajnDK1VBSvu6xST2iVQkF3OvvGSjFuN8974fR QS+sstaGHPTfJSFBsoJG1BJdJ0srF4oKyjHBcQPilw== X-Google-Smtp-Source: AA+uWPwx1F7gvdT+UTykIal0MNj9vPx3KYQ4laSIyhkygRwCI7dJKX7vUeI2l2gSorIaChH9k6exVeplRYBHocl//pM= X-Received: by 2002:a6b:d004:: with SMTP id x4-v6mr26394356ioa.299.1534447103913; Thu, 16 Aug 2018 12:18:23 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 12:18:23 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180816170650.GX97145@funkthat.com> References: <201808160631.w7G6VsS8064579@repo.freebsd.org> <20180816170650.GX97145@funkthat.com> From: Warner Losh Date: Thu, 16 Aug 2018 13:18:23 -0600 X-Google-Sender-Auth: FMwZPbUhUFcAP-Cpyu3j4bCH8vM Message-ID: Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve To: John-Mark Gurney , Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 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: Thu, 16 Aug 2018 19:18:25 -0000 On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney wrote: > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 +0000: > > Author: araujo > > Date: Thu Aug 16 06:31:54 2018 > > New Revision: 337887 > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > Log: > > Add a comment explaining how the PSN works and why there is no need for > > a null terminator. Also mark CID 1394825 as intentional. > > > > Reported by: Coverity > > CID: 1394825 > > MFC after: 1 week > > Sponsored by: iXsystems Inc. > > > > Modified: > > head/usr.sbin/bhyve/pci_nvme.c > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > ============================================================ > ================== > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > (r337886) > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > (r337887) > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, > char *o > > [...] > > > memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn > )); > > strncpy(sc->ctrldata.sn, config, > > sizeof(sc->ctrldata.sn)); > > This memset is unneeded, as strncpy will write NUL bytes to fill out > the buffer: > If src is less than len characters long, the remainder of > dst is filled with `\0' characters. > It also looks like the comment was wrong. The newest NVMe standards say these fields should be 7-bit and space-padded. Warner