[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cifs-protocol
Subject:    Re: [cifs-protocol] [REG:119070521001876] SMB3 LZ77 decompression issues
From:       Edgar Olougouna via cifs-protocol <cifs-protocol () lists ! samba ! org>
Date:       2019-07-15 14:49:25
Message-ID: DM6PR21MB12090D7081BFF232240CAB2FDBCF0 () DM6PR21MB1209 ! namprd21 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

Metze,

You observation is correct. It should be 4 bytes, instead of 8 bytes. Thanks for \
catching! 37
+
                    If MatchLength == 0
38
+
                        MatchLength = read 4 bytes from InputPosition
39
+
                        InputPosition += 4 bytes



Thanks,

Edgar



-----Original Message-----
From: Stefan Metzmacher <metze@samba.org>
Sent: Monday, July 15, 2019 3:14 AM
To: Edgar Olougouna <edgaro@microsoft.com>; Aurélien Aptel <aaptel@suse.com>; \
                cifs-protocol@lists.samba.org
Cc: support <support@mail.support.microsoft.com>
Subject: Re: [cifs-protocol] [REG:119070521001876] SMB3 LZ77 decompression issues



Hi Edgar,



> Upon review, we noticed there is additional logic to handle values larger than 1 << \
> 16 for the MatchLength. The second change here is that the we subtract 15 from the \
> MatchLength instead of 15 + 7.  See additions on lines 37 to 39. Let us know \
> whether this helps.



> 37

> +

> If MatchLength == 0

> 38

> +

> MatchLength = read 8 bytes from InputPosition

> 39

> +

> InputPosition += 8 bytes



Shouldn't this be 4 bytes instead of 8?



metze


[Attachment #3 (text/html)]

<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)">
<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:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:"\@DengXian";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{mso-style-priority:99;
	mso-style-link:"Plain Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.PlainTextChar
	{mso-style-name:"Plain Text Char";
	mso-style-priority:99;
	mso-style-link:"Plain Text";
	font-family:"Calibri",sans-serif;}
.MsoChpDefault
	{mso-style-type:export-only;
	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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoPlainText">Metze,<o:p></o:p></p>
<p class="MsoPlainText">You observation is correct. It should be 4 bytes, instead of \
8 bytes. Thanks for catching!<o:p></o:p></p> <p class="MsoPlainText"><o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" \
style="width:100.0%;background:white;border-collapse:collapse"> <tbody>
<tr>
<td nowrap="" valign="top" style="border:none;border-left:solid #CCCCCC \
1.0pt;padding:0in 0in 0in 0in"> <p class="MsoNormal" align="right" \
style="text-align:right"><span \
style="font-size:10.0pt;font-family:Consolas;color:#999999">37<o:p></o:p></span></p> \
</td> <td style="padding:0in 6.0pt 0in 0in"></td>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"><span \
style="font-size:10.0pt;font-family:Consolas;color:blue">&#43;</span><span \
style="font-size:10.0pt;font-family:Consolas;color:blue"><o:p></o:p></span></p> </td>
<td style="border:none;border-right:dotted #CCCCCC 1.0pt;padding:0in 3.0pt 0in 0in">
</td>
<td width="93%" valign="top" style="width:93.86%;border:none;border-right:solid \
#CCCCCC 1.0pt;background:#FFFFBB;padding:0in 0in 0in 0in"> <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:Consolas;color:#004800">&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If \
MatchLength </span><span \
style="font-size:10.0pt;font-family:Consolas;color:black;background:#FFE866">==&nbsp;0</span><span \
style="font-size:10.0pt;font-family:Consolas;color:#004800"><o:p></o:p></span></p> \
</td> </tr>
<tr>
<td nowrap="" valign="top" style="border:none;border-left:solid #CCCCCC \
1.0pt;padding:0in 0in 0in 0in"> <p class="MsoNormal" align="right" \
style="text-align:right"><span \
style="font-size:10.0pt;font-family:Consolas;color:#999999">38<o:p></o:p></span></p> \
</td> <td style="padding:0in 6.0pt 0in 0in"></td>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"><span \
style="font-size:10.0pt;font-family:Consolas;color:blue">&#43;</span><span \
style="font-size:10.0pt;font-family:Consolas;color:blue"><o:p></o:p></span></p> </td>
<td style="border:none;border-right:dotted #CCCCCC 1.0pt;padding:0in 3.0pt 0in 0in">
</td>
<td width="93%" valign="top" style="width:93.86%;border:none;border-right:solid \
#CCCCCC 1.0pt;background:#FFFF66;padding:0in 0in 0in 0in"> <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:Consolas;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MatchLength \
= read 4 bytes from InputPosition</span><span \
style="font-size:10.0pt;font-family:Consolas;color:black"><o:p></o:p></span></p> \
</td> </tr>
<tr>
<td nowrap="" valign="top" style="border:none;border-left:solid #CCCCCC \
1.0pt;padding:0in 0in 0in 0in"> <p class="MsoNormal" align="right" \
style="text-align:right"><span \
style="font-size:10.0pt;font-family:Consolas;color:#999999">39<o:p></o:p></span></p> \
</td> <td style="padding:0in 6.0pt 0in 0in"></td>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"><span \
style="font-size:10.0pt;font-family:Consolas;color:blue">&#43;</span><span \
style="font-size:10.0pt;font-family:Consolas;color:blue"><o:p></o:p></span></p> </td>
<td style="border:none;border-right:dotted #CCCCCC 1.0pt;padding:0in 3.0pt 0in 0in">
</td>
<td width="93%" valign="top" style="width:93.86%;border:none;border-right:solid \
#CCCCCC 1.0pt;background:#FFFF66;padding:0in 0in 0in 0in"> <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:Consolas;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InputPosition \
&#43;= 4 bytes</span><span \
style="font-size:10.0pt;font-family:Consolas;color:black"><o:p></o:p></span></p> \
</td> </tr>
</tbody>
</table>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">Thanks,<o:p></o:p></p>
<p class="MsoPlainText">Edgar<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: Stefan Metzmacher &lt;metze@samba.org&gt; <br>
Sent: Monday, July 15, 2019 3:14 AM<br>
To: Edgar Olougouna &lt;edgaro@microsoft.com&gt;; Aurélien Aptel \
                &lt;aaptel@suse.com&gt;; cifs-protocol@lists.samba.org<br>
Cc: support &lt;support@mail.support.microsoft.com&gt;<br>
Subject: Re: [cifs-protocol] [REG:119070521001876] SMB3 LZ77 decompression issues</p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">Hi Edgar,<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt; Upon review, we noticed there is additional logic to \
handle values larger than 1 &lt;&lt; 16 for the MatchLength. The second change here \
is that the we subtract 15 from the MatchLength instead of 15 &#43; 7.&nbsp; See \
additions on lines 37 to 39.  Let us know whether this helps.<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt; 37<o:p></o:p></p>
<p class="MsoPlainText">&gt; &#43;<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
If MatchLength == 0<o:p></o:p></p> <p class="MsoPlainText">&gt; 38<o:p></o:p></p>
<p class="MsoPlainText">&gt; &#43;<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
MatchLength = read 8 bytes from InputPosition<o:p></o:p></p> <p \
class="MsoPlainText">&gt; 39<o:p></o:p></p> <p class="MsoPlainText">&gt; \
&#43;<o:p></o:p></p> <p \
class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
InputPosition &#43;= 8 bytes<o:p></o:p></p> <p \
class="MsoPlainText"><o:p>&nbsp;</o:p></p> <p class="MsoPlainText">Shouldn't this be \
4 bytes instead of 8?<o:p></o:p></p> <p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">metze<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>



_______________________________________________
cifs-protocol mailing list
cifs-protocol@lists.samba.org
https://lists.samba.org/mailman/listinfo/cifs-protocol

--===============5893123309928490964==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic