From patchwork Wed Apr 12 20:32:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovskiy X-Patchwork-Id: 9678365 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 24D3B60383 for ; Wed, 12 Apr 2017 20:32:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1689C205FC for ; Wed, 12 Apr 2017 20:32:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B209285CA; Wed, 12 Apr 2017 20:32:22 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 911E7205FC for ; Wed, 12 Apr 2017 20:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755687AbdDLUcU (ORCPT ); Wed, 12 Apr 2017 16:32:20 -0400 Received: from mail-sn1nam01on0116.outbound.protection.outlook.com ([104.47.32.116]:49443 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755651AbdDLUcR (ORCPT ); Wed, 12 Apr 2017 16:32:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5nPX5SGM57lsEZrDs6/iib4fHKnZi52l8jeEtokcq2M=; b=asBu5cIILS4/9mBYty6dtSiLX7e8W/Acy5RE78ENKbKKk/moFj8g/785XeIFHp1RxDfIJ9X7TV9VPGFpEjydWghXCgk8e3tB0iuGtftrsjiTNK4vhN+4ry0stcJ+0wpIiYAVAy13KvsYcIfbUK92vMylY01UUJ3bzJED/CmnC0s= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from ubuntu-vm.corp.microsoft.com (2001:4898:80e8:a::63b) by CY4PR03MB2549.namprd03.prod.outlook.com (10.173.41.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Wed, 12 Apr 2017 20:32:15 +0000 From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Steve French Subject: [PATCH] CIFS: Fix SMB3 mount without specifying a security mechanism Date: Wed, 12 Apr 2017 13:32:07 -0700 Message-Id: <1492029127-4524-1-git-send-email-pshilov@microsoft.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [2001:4898:80e8:a::63b] X-ClientProxiedBy: BN6PR14CA0032.namprd14.prod.outlook.com (10.171.172.146) To CY4PR03MB2549.namprd03.prod.outlook.com (10.173.41.148) X-MS-Office365-Filtering-Correlation-Id: e6aa2d89-91e1-4edb-3b32-08d481e3021e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:CY4PR03MB2549; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2549; 3:ugs97y2rc0ygWV9buonQTl0Tq13BphHdE9aPlGaEOSbCzLj5Xvn9a5H+sD2flGeXxn3PEUjLwB3A7ZeetvY+MO3g8L6xd69uvJCAbHp1BBBDwczC8OIhKV1+tDyFADpOn8u1pz5iqRcW9s4swBCsOe23sC6jdBicwlcn8Ojt3Zfa/VkkEIxE1afWJTweGIa46IMMLN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xY8TSipjp0jvFdIAgeugYv+Zh4qRlAnA9WAvyjJVWZv8rsrTyTVOfzYqK7Px/ZZrufl1+Qfqu5lfgwMNO4Cst/TA0zGFHUKKyrH/p7Udqpo1sKm80SYUUIy2NHINqsweRb4GP+0T7IVj94Hbxe58mPeHzHSXJ1Yj++Y6lM+onkyq5UqyOWTfoIBhfoMaozj+6F96Sr6+1D6FnZAINcEtwkSfo3LP/4M9fsfQQjTR2iIn4a6uo7u/TRBqNkxJ+wXSD8l5Mxy1/ThpwtHH7WeqVee0jpj3bX3Z9GHAu+IQCUpWBptDzjR4jnvwh8E6ZAnejEr7ZBCEqY/SiBYuZHxUIGrucxyWoccoeeIoTQRobIzTCEjOXP3XsRjjQhzY8TXnX+XdYGKBrNcPxfepcdbYhnq5fgnnygo/7gz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(6072148); SRVR:CY4PR03MB2549; BCL:0; PCL:0; RULEID:; SRVR:CY4PR03MB2549; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2549; 4:+7PFhtNH6nUlexoXldnVf3LMXyt9TiNYSCMy6y3FJ9UrmcAQFhKHwLcr/zslsdbMh81qLsvvrXy6Omq1WBKnzOqpJiNbWCY6RgjgkZWpRpj+3Ap2MFPq36Gd6rqhjMy5QJdF31HZk3mrsYmc7UP4DyW3yajP6IX6IbZ6JvYP/H3+1Bje2IAzxAV+qQcD5W9owDlI3nYXIP1BEXYAn8NMKHMPTxIaNnvagKO+lWKyujO3e7R6xQXuah/XgwX8YDsPjVQ6JYmd2MzXf8Nbqjj/xxZy08vZcsMIgQB/Mtl//60BXDLD6V/g3V0vgOtCrgmpIsKKLUndiph/qAGNbMGj+Ei1w+Ib6bY/FIQYXhfKlflzs9GSt9VwIQ795OocHWzgzp5CmFBkpGTybdnDLdj+hkaFoYXmQ0FRQDro5A/mV3M6us699//HqksgQPgKlik5Voe2jZ9hyua1Ah+3KHKBexjlmOv7mVXGP3C5NZGQJ2xkn/K7a67V3J9RNhT3UGSoQH8HBB0qJBUNLfDdCOSLRmLy1siiZr38uJCMYtaYTdbUeNUQkJVRNMWQXSIbHrZ26t51UfJq2LWZYbh/W983SVc2RG86XgtkHw0feVhYo7u0wGoSgQC2JRdazl1FB0ty2rTQizfd0pJWE8UA+Yp9FyHGgoSFMOkVI7moPtmTGeHvfgeMaCgrMYDwUEto5e8aYIFkSC0HgyINT86BsAVfwsUQxthKHtaauw23u9zHeGoHnDqeJRCaLngIHnZeZLP0MKnvTRLJUnDstBZmF/OWQDJgKWrhp+lJLgbkC0FMKM/YO/A+1z20q6KNYt7wxWVl X-Forefront-PRVS: 027578BB13 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39410400002)(39850400002)(39400400002)(39860400002)(39840400002)(69234005)(6486002)(2906002)(4326008)(33646002)(10090500001)(6666003)(5005710100001)(47776003)(10290500002)(25786009)(6116002)(50986999)(305945005)(5003940100001)(48376002)(86612001)(50226002)(2361001)(53936002)(5660300001)(2351001)(8676002)(189998001)(36756003)(15650500001)(81166006)(38730400002)(42186005)(6916009)(50466002)(86362001)(110136004); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR03MB2549; H:ubuntu-vm.corp.microsoft.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2549; 23:D9ZUVmqxdUfm/ihE8eY7Jnlnw1fDJNCun9PPbFbkF?= =?us-ascii?Q?qKCjvW8QHEeYYuDmRGS/8JADCKELbtb0ZuaqV4nGCW6UidfyR9suD9z5cDa3?= =?us-ascii?Q?NF4FtT+uFQIqDdbZEPe9U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I/87KHndW3iPG2d14S5NQ/lI0wMXfWPBSPDE1thpM2BU7Ih3j6S/ByAhKrqiExlv2Gmc6oPDngwCeAbGnjYFCK8gYTyorJWmXIqYK97XJYZgDeOh9eRw06km9ZacvFjRCpCVCMvUaN22YSMXItTN68Vf79ML+zjyObrumtP6JXbYUxeeqFEQKPnzIhJKcS7UySi3xG1EeBYLsZlRlTVExtkeSObKS6FgnaselwVe7DGMeYokfwGIK/rir8vx3w== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2017 20:32:15.3432 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2549 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 Commit ef65aaede23f ("smb2: Enforce sec= mount option") changed the behavior of a mount command to enforce a specified security mechanism during mounting. On another hand according to the spec if SMB3 server doesn't respond with a security context it implies that it supports NTLMSSP. The current code doesn't keep it in mind and fails a mount for such servers if no security mechanism is specified. Fix this by indicating that a server supports NTLMSSP if a security context isn't returned during negotiate phase. This allows the code to use NTLMSSP by default for SMB3 mounts. Signed-off-by: Pavel Shilovsky --- fs/cifs/smb2pdu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 1bd5d30..02da648 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -562,8 +562,10 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) * but for time being this is our only auth choice so doesn't matter. * We just found a server which sets blob length to zero expecting raw. */ - if (blob_length == 0) + if (blob_length == 0) { cifs_dbg(FYI, "missing security blob on negprot\n"); + server->sec_ntlmssp = true; + } rc = cifs_enable_signing(server, ses->sign); if (rc)