From owner-svn-src-stable-11@freebsd.org Thu Feb 1 19:04:51 2018 Return-Path: Delivered-To: svn-src-stable-11@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 6B6F0EE5E12; Thu, 1 Feb 2018 19:04:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11EE17E2C1; Thu, 1 Feb 2018 19:04:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CB30110E6; Thu, 1 Feb 2018 19:04:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11J4oxL007290; Thu, 1 Feb 2018 19:04:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11J4ond007289; Thu, 1 Feb 2018 19:04:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802011904.w11J4ond007289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Feb 2018 19:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328700 - stable/11/sys/dev/nvme X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/nvme X-SVN-Commit-Revision: 328700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 19:04:51 -0000 Author: mav Date: Thu Feb 1 19:04:50 2018 New Revision: 328700 URL: https://svnweb.freebsd.org/changeset/base/328700 Log: MFC r324631 (by imp): Explicitly set reserved fields and 'fuse' to 0. This prevents us from acidentally sending bogus values in these fields, which some drives may reject with an error or worse (undefined behavior). This is especially needed for the ndadump routine which allocates the cmd from stack garbage.... Modified: stable/11/sys/dev/nvme/nvme.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nvme/nvme.h ============================================================================== --- stable/11/sys/dev/nvme/nvme.h Thu Feb 1 19:01:06 2018 (r328699) +++ stable/11/sys/dev/nvme/nvme.h Thu Feb 1 19:04:50 2018 (r328700) @@ -1082,7 +1082,11 @@ void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t uint64_t lba, uint32_t count) { cmd->opc = rwcmd; + cmd->fuse = 0; + cmd->rsvd1 = 0; cmd->nsid = nsid; + cmd->rsvd2 = 0; + cmd->rsvd3 = 0; cmd->cdw10 = lba & 0xffffffffu; cmd->cdw11 = lba >> 32; cmd->cdw12 = count-1;