Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp718094imm; Thu, 13 Sep 2018 06:46:33 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYb5gj4DDEa80Z2YBTdhKxER5V3biQpS+6/Kcv//Q88l881e1mO7BaZc3yRmIZEHccTO2Kj X-Received: by 2002:a62:8d84:: with SMTP id p4-v6mr7598735pfk.251.1536846393728; Thu, 13 Sep 2018 06:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846393; cv=none; d=google.com; s=arc-20160816; b=ajgRlnmxs+a6W9yUa974frmHCmJF2JbaA4mAMp82VnwPLsnwkF/9cBqfdUfvse78tL vX21YeGatCFKKV9V58xDgff3P3ujQF5rgP5D7X5nipBzPMJzwQ0KbZON13H3gU/aryTT pcplyk4WbTz38Mh0pKwzR6FcUCzg9ClqI38jaM96tKeNxX+Oy3fOIZEGx7KoB9pcrC3Q HBOzLUmHC3+MYvZEjxAe+xa6Q7y3xATlfPh8XF2ILfNPqYC8VbDk8Or5OmcJRUBsGQyo /rOzx0nU5b8SKrxcAa8j6+SOIrILpbA7edCOj/oVWb93lljq4kYu3N5t4YA8EeUMokDd fKFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=dcrmuZuDOX60HT7Q/BPj/KqVSN974ep5t+Nf/6zrut8=; b=OXFRso3bVWlZzE4qMyUxJxeY/qcpYuUFPGdyT7qupbPdnA5QX90LU/WF0+aJAzE87l A/V/a7AowaAVGULSCKrOfV5VLXVcdpf6dBsjG1NtJzAIHEfLqIIjm274g4Y1e+ntEhbp slciLTJKUdvW0N/SiWVZCVta/fOqk49dFvb4/o2wCDXhXOiU8A7HcBoxE65RmDzjaNIW DFFJuZgmMlPk4jOILSWlCtaqfwg5CoruC7XNzlrw5ZAiHAjJvVG0XnoFyExtt+c+xl7W eDgqzzCoNsyiNn9uoxt5MT2ySXX7xRS6ZA/RTUP9hUAs48ntFtuiSFKu3iI7s/Z+zruN /RqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37-v6si4200651plq.316.2018.09.13.06.46.18; Thu, 13 Sep 2018 06:46:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729598AbeIMSyS (ORCPT + 99 others); Thu, 13 Sep 2018 14:54:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60600 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728565AbeIMSyR (ORCPT ); Thu, 13 Sep 2018 14:54:17 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C31ECD10; Thu, 13 Sep 2018 13:44:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , Steve French , Sasha Levin Subject: [PATCH 4.14 021/115] cifs: check if SMB2 PDU size has been padded and suppress the warning Date: Thu, 13 Sep 2018 15:30:41 +0200 Message-Id: <20180913131824.855825364@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131823.327472833@linuxfoundation.org> References: <20180913131823.327472833@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ronnie Sahlberg [ Upstream commit e6c47dd0da1e3a484e778046fc10da0b20606a86 ] Some SMB2/3 servers, Win2016 but possibly others too, adds padding not only between PDUs in a compound but also to the final PDU. This padding extends the PDU to a multiple of 8 bytes. Check if the unexpected length looks like this might be the case and avoid triggering the log messages for : "SMB2 server sent bad RFC1001 len %d not %d\n" Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2misc.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -212,6 +212,13 @@ smb2_check_message(char *buf, unsigned i return 0; /* + * Some windows servers (win2016) will pad also the final + * PDU in a compound to 8 bytes. + */ + if (((clc_len + 7) & ~7) == len) + return 0; + + /* * MacOS server pads after SMB2.1 write response with 3 bytes * of junk. Other servers match RFC1001 len to actual * SMB2/SMB3 frame length (header + smb2 response specific data)