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;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to