From patchwork Thu Mar 22 05:12:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srivatsa S. Bhat" X-Patchwork-Id: 10300873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 72B44600CC for ; Thu, 22 Mar 2018 05:12:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62EA128B5A for ; Thu, 22 Mar 2018 05:12:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56E7528BC7; Thu, 22 Mar 2018 05:12:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9C3128B5A for ; Thu, 22 Mar 2018 05:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbeCVFMS (ORCPT ); Thu, 22 Mar 2018 01:12:18 -0400 Received: from outgoing-stata.csail.mit.edu ([128.30.2.210]:47031 "EHLO outgoing-stata.csail.mit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751948AbeCVFMQ (ORCPT ); Thu, 22 Mar 2018 01:12:16 -0400 Received: from c-71-231-194-96.hsd1.wa.comcast.net ([71.231.194.96] helo=srivatsab-a01.vmware.com) by outgoing-stata.csail.mit.edu with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1eysWI-000RuZ-Kn; Thu, 22 Mar 2018 01:12:10 -0400 Subject: Re: [PATCH 4.13 28/43] SMB3: Validate negotiate request must always be signed To: Steve French , Greg Kroah-Hartman Cc: Thomas Backlund , =?UTF-8?Q?Aur=c3=a9lien_Aptel?= , LKML , Stable , Ronnie Sahlberg , Pavel Shilovskiy , CIFS References: <28ffc363-5140-5685-d288-6e3dc07c6369@csail.mit.edu> <20180227085428.GA16879@kroah.com> <20180227124050.GB31888@kroah.com> <6bca5a97-f581-86b8-12ad-77147619d519@csail.mit.edu> <309db6c4-7e21-bfbe-44d4-eb41f5516d5e@csail.mit.edu> <20180313092133.GA13325@kroah.com> <20180316133241.GC11397@kroah.com> From: "Srivatsa S. Bhat" Message-ID: <6745f869-e249-a891-8d76-79f2830dd57f@csail.mit.edu> Date: Wed, 21 Mar 2018 22:12:01 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 3/21/18 7:02 PM, Steve French wrote: > Found a patch which solves the dependency issue. In my testing (on > 4.9, with Windows 2016, and also to Samba) as Pavel suggested this > appears to fix the problem, but I will let Srivatsa confirm that it > also fixes it for him. The two attached patches for 4.9 should work. > Indeed, those two patches fix the problem for me on 4.9. Thanks a lot Steve, Pavel and Aurelien for all your efforts in fixing this! I was also interested in getting this fixed on 4.4, so I modified the patches to apply on 4.4.88 and verified that they fix the mount failure. I have attached my patches for 4.4 with this mail. Steve, Pavel, could you kindly double-check the second patch for 4.4, especially around the keygen_exit error path? Thank you very much! Regards, Srivatsa VMware Photon OS From a01a7dfb60e2d5421a487a7b81fd8a1bf72d96d4 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 11 Mar 2018 20:00:27 -0700 Subject: [PATCH 1/2] SMB3: Validate negotiate request must always be signed commit 4587eee04e2ac7ac3ac9fa2bc164fb6e548f99cd upstream. According to MS-SMB2 3.2.55 validate_negotiate request must always be signed. Some Windows can fail the request if you send it unsigned See kernel bugzilla bug 197311 [ Fixed up for kernel version 4.4 ] CC: Stable Acked-by: Ronnie Sahlberg Signed-off-by: Steve French Signed-off-by: Srivatsa S. Bhat --- fs/cifs/smb2pdu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 84614a5..6dae5b8 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1558,6 +1558,9 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, } else iov[0].iov_len = get_rfc1002_length(req) + 4; + /* validate negotiate request must be signed - see MS-SMB2 3.2.5.5 */ + if (opcode == FSCTL_VALIDATE_NEGOTIATE_INFO) + req->hdr.Flags |= SMB2_FLAGS_SIGNED; rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0); rsp = (struct smb2_ioctl_rsp *)iov[0].iov_base;