From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Allison Subject: Re: [PATCH][CIFS] Workaround MacOS server problem with SMB2.1 write response Date: Thu, 14 Aug 2014 13:44:24 -0700 Message-ID: <20140814204424.GE325@samba2> References: <20140814153015.030657f7@tlielax.poochiereds.net> <20140814193519.GB325@samba2> <20140814164014.36023859@tlielax.poochiereds.net> Reply-To: Jeremy Allison Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Steve French , Jeremy Allison , "linux-cifs@vger.kernel.org" , linux-fsdevel , samba-technical To: Jeff Layton Return-path: Received: from fn.samba.org ([216.83.154.106]:36632 "EHLO mail.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046AbaHNUo3 (ORCPT ); Thu, 14 Aug 2014 16:44:29 -0400 Content-Disposition: inline In-Reply-To: <20140814164014.36023859@tlielax.poochiereds.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Aug 14, 2014 at 04:40:14PM -0400, Jeff Layton wrote: > > Failing here won't change the buffer allocation. That buffer has > already been allocated, and the receive is complete at this point. So > any "damage" has already been done. Yep. You've got to have read the data to know it's too much ! > So, I just don't get why you'd bother with an arbitrary limit at all. > The error checking is _simpler_ if you don't bother with this limit. Or > am I missing something here? Nope. The server has to deal with the same problem as well. We just accept what the client sends inside the NetBIOS length limit, and ignore anything after the "useful" data within the packet. Doesn't matter *what* is in the extra bits, code data, whatever. We don't look at it. Steve, what is the problem with just ignoring the extra data ? If it offends you - log a warning message is the rfc1001 length is too long and ignore it.