<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Intel Clear";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">HGST approves these changes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:90%"><b><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">Tom Freeman</span></b><b><span style="font-family:"Arial",sans-serif;color:#1F497D"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height:90%"><b><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">Software Engineer, Device Manager and Driver Development</span></b><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:90%"><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">HGST, a Western Digital company</span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:90%"><a href="mailto:thomas.freeman@hgst.com"><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#0563C1">thomas.freeman@hgst.com</span></a><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:90%"><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">507-322-2311<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:90%"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:90%"><span style="font-size:11.0pt;line-height:90%;font-family:"Calibri",sans-serif;color:#1F497D"><img border="0" width="172" height="56" id="_x0000_i1026" src="cid:image001.png@01D0F547.8B4BACE0" alt="HGST_Logo_email"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<span style="font-size:8.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">3605 Hwy 52 N 
</span><span style="color:#1F497D"><br>
</span><span style="font-size:8.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">Rochester, MN 55901</span><span style="color:#1F497D"><br>
</span><a href="https://hgst.jiveon.com/external-link.jspa?url=http://www.hgst.com/" target="_blank"><span style="font-size:8.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#0563C1">www.hgst.com</span></a><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Iuliu Rus [mailto:iuliur@google.com]
<br>
<b>Sent:</b> Tuesday, September 15, 2015 12:08 PM<br>
<b>To:</b> Thomas Freeman <thomas.freeman@hgst.com><br>
<b>Cc:</b> Robles, Raymond C <raymond.c.robles@intel.com>; nvmewin@lists.openfabrics.org; uliur@google.com<br>
<b>Subject:</b> Re: [nvmewin] FW: NVME fuzz test fixes<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks for the great feedback. Fixed all and attached the new zip (same password). I also reran the tests, but for 3) the Microsoft fuzz test seems to have no
 coverage. It keeps asking for sense data with aloc length of 0 (like 100 times). I artificially tested this by modifying the allocLength variable in kernel debugger.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Sep 14, 2015 at 1:41 PM, Thomas Freeman <<a href="mailto:thomas.freeman@hgst.com" target="_blank">thomas.freeman@hgst.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Iuliu,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The changes look good.
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I have just a few comments.</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">1.</span><span style="font-size:7.0pt;color:#1F497D">      
</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> nvmeSnti.C/Line 1157 –</span>
<b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">memset(pResponseBuffer, 0, allocLength);</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">  This was added to the comment, but it’s not clear
 why. I suspect it is an accidental addition. If so, this should be removed.</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">2.</span><span style="font-size:7.0pt;color:#1F497D">      
</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">nvmeSnti.c/Line 1519 – Since the Lun value is actually written to the second byte of the entry, the comparison should be:</span><o:p></o:p></p>
<p><b><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">if (lunIdDataOffset + SINGLE_LVL_LUN_OFFSET >= allocLength</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">)</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">As an example, test with a buffer size of 0x11. Without this change, the driver will actually write the byte after the allocated buffer. 
</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">3.</span><span style="font-size:7.0pt;color:#1F497D">      
</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">nvmeSnti.c/Line 2652 & 2669. Your change handles the case where there is no data buffer. But, it does not handle the case where the buffer is smaller than sizeof(DESCRIPTOR_FORMAT_SENSE_DATA).
 With a small buffer allocation, these writes would access beyond the allocated buffer</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">                                   
</span><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">pSenseData->ErrorCode                    = FIXED_SENSE_DATA;</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">            pSenseData->SenseKey                     = SCSI_SENSE_NO_SENSE;</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">            pSenseData->AdditionalSenseLength        = FIXED_SENSE_DATA_ADD_LENGTH;</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">            pSenseData->AdditionalSenseCode          = SCSI_ADSENSE_NO_SENSE;</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">            pSenseData->AdditionalSenseCodeQualifier = 0;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Regards,</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<b><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">Tom Freeman</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<b><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">Software Engineer, Device Manager and Driver Development</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">HGST, a Western Digital company</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<a href="mailto:thomas.freeman@hgst.com" target="_blank"><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#0563C1">thomas.freeman@hgst.com</span></a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<a href="tel:507-322-2311" target="_blank"><span style="font-size:10.0pt;line-height:90%;font-family:"Arial",sans-serif">507-322-2311</span></a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<span style="font-size:11.0pt;line-height:90%;font-family:"Calibri",sans-serif;color:#1F497D"><img border="0" width="172" height="56" id="Picture_x0020_1" src="cid:image001.png@01D0F547.8B4BACE0" alt="HGST_Logo_email"></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:90%">
<span style="font-size:8.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">3605 Hwy 52 N 
</span><span style="color:#1F497D"><br>
</span><span style="font-size:8.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#1F497D">Rochester, MN 55901</span><span style="color:#1F497D"><br>
</span><a href="https://hgst.jiveon.com/external-link.jspa?url=http://www.hgst.com/" target="_blank"><span style="font-size:8.0pt;line-height:90%;font-family:"Arial",sans-serif;color:#0563C1">www.hgst.com</span></a><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><a href="mailto:nvmewin-bounces@lists.openfabrics.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">nvmewin-bounces@lists.openfabrics.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> [mailto:</span><a href="mailto:nvmewin-bounces@lists.openfabrics.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">nvmewin-bounces@lists.openfabrics.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<b>On Behalf Of </b>Robles, Raymond C<br>
<b>Sent:</b> Friday, September 11, 2015 3:29 PM<br>
<b>To:</b> </span><a href="mailto:nvmewin@lists.openfabrics.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">nvmewin@lists.openfabrics.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<b>Subject:</b> [nvmewin] FW: NVME fuzz test fixes</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Intel Clear",serif;color:#002060">All,
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Intel Clear",serif;color:#002060"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Intel Clear",serif;color:#002060">Here is the original patch from Google (Iuliu) for the WHCK fuzz tests.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Intel Clear",serif;color:#002060"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Intel Clear",serif;color:#002060">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Intel Clear",serif;color:#002060">Ray</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a name="14fcd97962ab5f28__MailEndCompose"></a><span style="font-size:10.0pt;font-family:"Intel Clear",serif;color:#002060"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><a href="mailto:nvmewin-bounces@lists.openfabrics.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">nvmewin-bounces@lists.openfabrics.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> [</span><a href="mailto:nvmewin-bounces@lists.openfabrics.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:nvmewin-bounces@lists.openfabrics.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<b>On Behalf Of </b>Iuliu Rus<br>
<b>Sent:</b> Monday, August 03, 2015 1:37 PM<br>
<b>To:</b> </span><a href="mailto:nvmewin@lists.openfabrics.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">nvmewin@lists.openfabrics.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<b>Subject:</b> [nvmewin] NVME fuzz test fixes</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello,<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I have attached the fixes we (Google) did for the several crashes / corruptions exposed by the Windows HCK fuzztest.exe.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">We have tested this on qemu/ Server 2012 R2.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The password on the zip is "nvme" :)<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><strong><span style="font-size:10.0pt;font-family:"Arial",sans-serif">HGST E-mail Confidentiality Notice & Disclaimer:</span></strong><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
This e-mail and any files transmitted with it may contain confidential or legally privileged information of HGST and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure,
 copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited.  If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
nvmewin mailing list<br>
<a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br>
<a href="http://lists.openfabrics.org/mailman/listinfo/nvmewin" target="_blank">http://lists.openfabrics.org/mailman/listinfo/nvmewin</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><strong>HGST E-mail
Confidentiality Notice & Disclaimer:</strong><br>This e-mail and any files transmitted with it may contain confidential
or legally privileged information of HGST and are intended solely for the use
of the individual or entity to which they are addressed. If you are not the
intended recipient, any disclosure, copying, distribution or any action taken
or omitted to be taken in reliance on it, is prohibited.  If you have received this e-mail in error,
please notify the sender immediately and delete the e-mail in its entirety from
your system.<o:p></o:p></span></p></body>
</html>