From patchwork Sat Jul 8 21:32:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovskiy X-Patchwork-Id: 9831541 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 EF7D9602A0 for ; Sat, 8 Jul 2017 21:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D00C927D29 for ; Sat, 8 Jul 2017 21:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEF2127FAD; Sat, 8 Jul 2017 21:32:18 +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 87A2727D29 for ; Sat, 8 Jul 2017 21:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbdGHVcM (ORCPT ); Sat, 8 Jul 2017 17:32:12 -0400 Received: from mail-cys01nam02on0095.outbound.protection.outlook.com ([104.47.37.95]:49568 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750952AbdGHVcL (ORCPT ); Sat, 8 Jul 2017 17:32:11 -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=ARAKwkV2kE2zEWsGSiUMz7kVJdKdBJoAIZUdyGDOfN0=; b=F6aegwClbzDnADCfzY3HAjkl2MHxMfPi1XWXmDtU2fNtR04bFB8WUug9XeJN3ADk/bVJXSM6gdW3awN4vb8vkbKpbYyNgAlj+7bz1NNUpnsbDccovmQBJyXaZvVQY4uOWAOsPnCGD+Bzy+PX0oI+TzB+kzbVLqtUxQQ+vtrY5bk= 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:5::63b) by BN6PR21MB0129.namprd21.prod.outlook.com (10.173.199.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.3; Sat, 8 Jul 2017 21:32:07 +0000 From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Steve French , piastryyy@gmail.com Subject: [PATCH] CIFS: Reconnect expired SMB sessions Date: Sat, 8 Jul 2017 14:32:00 -0700 Message-Id: <1499549520-113585-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:5::63b] X-ClientProxiedBy: BN6PR21CA0006.namprd21.prod.outlook.com (10.173.197.16) To BN6PR21MB0129.namprd21.prod.outlook.com (10.173.199.143) X-MS-Office365-Filtering-Correlation-Id: 424061b3-f832-4171-57e2-08d4c648c919 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN6PR21MB0129; X-Microsoft-Exchange-Diagnostics: 1; BN6PR21MB0129; 3:bzs4yo4a9zm9FRvcb9ErLAcrqWumo8sHe00Y0Otc7qs9ZHIrLthEXqwZ334CCt0PJSVXbNzgdlCba+4gt7Vx4Yfma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O3MBJm89MfoxWeVkeaFvBpO10Ro4MZK66LVlMbTqFNLqlvBhbKYSeTgZlC9O1QJldhJos5F2Z1/a5JDh4yCR7++5SEJ0o+vY2h6DNpAv1M6k8bXQYJaFp3pZAdDU1b2ycm6/y4HmKqUStiRY2tSfLBBCizy1VXpGMJX6B4feMwpXhhcdQT4/ezQT965AseF3BrfsD4SKqKP4B0WlV8ZW0VFcgLBSX9JDmkpdsu2wkr6VQ3GWOsBDZSnNW5xMByc7kBMcneYX/dc8Was1Qysa0c9kzRsMog+OHDmRsL+pOBUx09K49407vjzHQNbHUfgJMN7dBI7Ze9SRywLw== X-Microsoft-Exchange-Diagnostics: 1; BN6PR21MB0129; 20:xI3muIJCxRnAQbaWzr5tZiN+YE4+JepPj2+7qXJlfCpHyQdNbk9CB7bbjCIEH69jJ+dbTSQt6zEGiT/ki3oqGjv5QMh/64GAOyXpfZGakHabtN7IyDSW/9KMMdZ/NOmK4yhuoXnGkJ8MGLFcLEjeUaoQi40o0sZrmc7DIu4SLAJtAV1Gtia8YAxh0LeXXVaf+Z5VpzgzCw/WWm+LexKhls9tuW64d2wWSQ7FUq0JQ9mgu8Z/Uj9WLdItjFrPtcnbiz2GxkrGAOtTWSEEMmS0bf46AMqKzgLl4ULezvDdjMfQCSUkn38w0kD0Hc5z7VaWYLn3y23XJKdakY0tDskAEl3LbVlBlA+JZ0+OZhMv4221Uc/+6f/Xf0DwQlqjYeKSvVl+gde5wCXcB4fkJFqwdkezZx6IuMhHwuHU23KMvKal/2DedI8bb7UHe7jRzYxJ0o1xjP89ifjrE7Wj0rsRN0BxnB+D/qk50Tn/qZqYbxRBiHAlxy+UV4FjRJYUzMsg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(236129657087228)(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(2017060910075)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR21MB0129; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR21MB0129; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR21MB0129; 4:r0of2hzG2VLCd3I+Nc8Qq/cloBYY4Xpp2IG6nIx/Rb?= =?us-ascii?Q?TbyUuN16Btc/lf+3mxw+4nobcpn3KafsB5MmZW75xDfrhAEqvaPVQwaBDuMW?= =?us-ascii?Q?BN7mYpuPRWubJd5nBcbMQzOplqjdfYm1KhOuj38cGeD9Xn2+a6XZeWYfAeqo?= =?us-ascii?Q?DyTN6AhHyukaVFaxw7Uiw1rNZQNrn86er6ZXcak9x9llyogojlWs4VbURgoe?= =?us-ascii?Q?4eKE+TvJWWXQYO7gGhWRFjRGjOiTvv/EoDX9/2Z8f0CKMK9cPGHkaAHJqAqi?= =?us-ascii?Q?XAi6+xOo5zhMc2ORcAdS6oCLn+hXSPPJiWJZYn8z1TgIl9rgzWZSfu8MOMxu?= =?us-ascii?Q?HMhNLlgpvjeQjhBwd/57k0FwCrf7NHriubrrQnxpNv4x8nTyOiCpQ5HhbM71?= =?us-ascii?Q?nEpUSk6Pt8LPgzoyGN8GDFWmHhLymZ7N1JJXDSlB0cHtKa2fFh2AyKlMWN9C?= =?us-ascii?Q?kjMyCF6lzJCKDUxMqSwStowzAj5jPTN7l3YjJIgWyB7EZmW2zAMrOQRF0QXG?= =?us-ascii?Q?MQITc+2r3XnxYkEBeIl9wuuPNlVSanXIVCZ877YkOjUpX47RRGnZRht43IyR?= =?us-ascii?Q?m3x/GCLdIr2VTFveArErqFylq9yQGDC9XUowQ3i4Fv3/plhZ80cIjIX0KQ9U?= =?us-ascii?Q?YaeYKOQ+2q2U5yZ3Yhr/0KjPPcxu3+hI9CbB31Z7jHmqQzVxPBkcH48oAf96?= =?us-ascii?Q?RQd00iA7SvU/S5tjMbE5oCoqocA86Fp/du/ElEIgFoHK/6NLuounVtZM7UPs?= =?us-ascii?Q?mb32gxIujNLlOBrVqmn+e/SlGeGSujI0KqOu/knMA6mMgcBAX5qdXsf/OyYa?= =?us-ascii?Q?GRwZ9PI9e1iOC46dKSYz3jOmAGHyT5Fl1tQZxbgtXJr5F2evQw2ukh60PoI+?= =?us-ascii?Q?f5i/Il11kVqnmSHeLcP5qU0TCWpZYJ7C4El0q2geOZhmp3J8EED4+u8GXSOY?= =?us-ascii?Q?8792ZIzUn1JsPrLayFvgwUxpyYvYyWohGpsReei1YjL3V51UJUsbqCKFy4fv?= =?us-ascii?Q?XStRMnjq4QI3XSJu4HWSCW5635MWOTHKLp+GON16J71cGUnTS/mnUgg9z5kB?= =?us-ascii?Q?ymqlhFWK1tiHKmsVaufwYom6CIDzTUQKZInEvuMuIyYmWRUp145fP+gdlAPv?= =?us-ascii?Q?isgdgKLVbAdn/YWmqa+2nDRJX4Og8qk1G5f2DfsShV0rhLHZP8l/ER+Due7F?= =?us-ascii?Q?sifo7AwKbbPNjZLrWCGK6qR9Sj9KXxL6JvodFLSQmPBo++qs74ImGsQYSJy7?= =?us-ascii?Q?fT3yJ6EWB2mCQqO/6Z2R5Qui/A/YtCeK9eqYWdNOqi+kyqx2PNDCEOr33Wzi?= =?us-ascii?Q?Xg0V7HNtTJURH8ctxMmGg=3D?= X-Forefront-PRVS: 0362BF9FDB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(7370300001)(6009001)(39860400002)(39840400002)(39450400003)(39400400002)(39850400002)(39410400002)(69234005)(10090500001)(47776003)(5005710100001)(50226002)(2906002)(7736002)(50986999)(50466002)(48376002)(7350300001)(25786009)(4326008)(86362001)(575784001)(5660300001)(6116002)(8676002)(42186005)(5003940100001)(189998001)(6916009)(110136004)(36756003)(38730400002)(81166006)(10290500003)(2351001)(305945005)(33646002)(6666003)(478600001)(2361001)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR21MB0129; H:ubuntu-vm.corp.microsoft.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR21MB0129; 23:JUg9Tef9xZ8hMEb4ljkY2FP/4D34LSrN0VdBMSz0z?= =?us-ascii?Q?vtXgHGLkKUYn5ewT87PI9PIxd7oIK6h4gS23GhYh8ke7n2rvT3ISWbyVr36k?= =?us-ascii?Q?HkN6XHzxblrKZRxX6NrSL++IyG65XIVTb0Ag48wpFe8nSQ+c8sNMPY2ipiS/?= =?us-ascii?Q?FCMgizMLT6c75zeRp+8nKVu4KyVDCU/21feJA3AnX9XpZ3bWPh9zBGk7q7bo?= =?us-ascii?Q?hXPflssJ3yLrvyzVwKBIxuCSSAaCU1z9695q050hpZVEbPjI8YPrUwwlMq+p?= =?us-ascii?Q?pD29sJl+5CS7RAfN69sVD+jiFyQ4hmL3tXroCTWWWPQiVlmk0pbuHf3haAg2?= =?us-ascii?Q?8BBnbWu2EEpkFFUE94TpqGvPUP7psC8NehzHOUYg5b+LgnMtXq1Tiqob/HwA?= =?us-ascii?Q?5f8v7zCqf1x4U6TKlCjw04p1Pe5AwSJm6dw+AeWx9AEfT1N3BvgPRfUhOsyG?= =?us-ascii?Q?fKowJxQu+3YLg6gmiXmO6etONDeRmQQ7P/rXhCN5T+4HROaHGMIdAJPoOxGT?= =?us-ascii?Q?OxmrhQ2a2zw2lVnuALA5FymFYixiV8GjrVqfMHSKv0p2CebI2iOpJo24cT0l?= =?us-ascii?Q?CEHXOJ9E1rDk7Z1zxkdLMSp7akhgvv4YNOFAABYCTV1DkJmkJknDa0+LlXC4?= =?us-ascii?Q?XWDNXj5seeZ5c8WhlZxyFoit3XL7+UfIN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z3YYKdQf/B/jANdmTqNWznqqT9Vrmmx23O396ffU748gBhvlB2THexp++XBbN6So1yqevJp/ZX3IDYmlEJ0Gp+l3WIFSXZjlg5eF9amTY3dsd5+3FwovTWGXfCpEKS6zN7HbojCVkbutrb504u7cCWoNOJNjKnVaxLi2HZUF2viCfGP/5U9FEe5xHyOc91Tk1sw0vEbKqwAeRG89HjvFsnDcZuIuOFkNTfWb4sgjBqiKEJdJvnl8qGaRlD1Fc8F2eA6ovd3Jwv42dyJssnrjybXc2whn9SWrv5mtychMfumrgD0; 24:uCljyXmqo1hnsv1EzCmjnDI9axRZ8CARWThYEGtykkVGLNodWY3QpcYrHN0TgWlzBFfoph7222IF/epfOuqOWNY6Vt2FraF5RBIJ2c7KzJY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR21MB0129; 7:ThpwaDKM9pr5Q94osPX4VlGDUGXkBsQv+GRUnrXOrPBf7VYnnmVBbpy5nPZcVhwXTqS2fYC2PXJU14qYFXQ/skfsTDdyyzAATZIGgcvUMjcjqZlN904Yxw5589ij9nRxH9ivYgfriN+AjJlKL1ZzfdTGSxMAJVfq4QmGivx292xAc7pdUxb0m/hG84oqIGqywIJBWH8svwKzA9DPOC4SEDp4qs57go7GuQx+MHHOgE6CPteeFd2vN/sNbXXULx8Tew++1h0zMRkpKnSRUkpDZz/kdszhTFcUtu35rzYwhYJEwQFPSRTHjvecEFO8s/0/JvOel7QW4kZ/+v7nUjjsSTJMwF1Dz9HBkOrSZsLUV1dgdF9ogVcT40AGQLyb4/L6un5U8hUXvQYkkwwM0EOQZ5p1go51ojT38fuz6bBYEji93W20qM2ogye7PHjXSXm6EZplzjDrt6TSif1CB5K7VI8235MLWVpoB8bSuMijIYlzbmuOb3LLmUlYFWQHbbliNxz1w5wznjW8NIIYD2gxulqNJbT8UqtSqYodOLceL+j/JWaD2uu432IfWqwXbK3BspaXF68cVPa3l1/dHjxSC/5IL1ZiLhuWb7s/xPDieNjQC2OBpjn0tlqoxfAIHzLGRPvbgun35MTb3ymMPsGb7J38E1joEn/RdDLWvG4SFBgQ1QJHBtXAccGNUomzHJg3tAXcl3OEC3UIdO9/SRSp+v9qJjza4Q2IPQTa7rC3snldrpeGjKOXYtR98nwpV+agNfkpc9yvCQnOwSOHegSFif5Pix7L/VtqPhOZm7Q1e74= X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2017 21:32:07.6158 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0129 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 According to the MS-SMB2 spec (3.2.5.1.6) once the client receives STATUS_NETWORK_SESSION_EXPIRED error code from a server it should reconnect the current SMB session. Currently the client doesn't do that. This can result in subsequent client requests failing by the server. The patch adds an additional logic to the demultiplex thread to identify expired sessions and reconnect them. Cc: Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsglob.h | 2 ++ fs/cifs/cifssmb.c | 7 +++++++ fs/cifs/connect.c | 7 +++++++ fs/cifs/smb2ops.c | 23 +++++++++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index bcc7d9a..fb48251 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -367,6 +367,8 @@ struct smb_version_operations { unsigned int (*calc_smb_size)(void *); /* check for STATUS_PENDING and process it in a positive case */ bool (*is_status_pending)(char *, struct TCP_Server_Info *, int); + /* check for STATUS_NETWORK_SESSION_EXPIRED */ + bool (*is_session_expired)(char *); /* send oplock break response */ int (*oplock_response)(struct cifs_tcon *, struct cifs_fid *, struct cifsInodeInfo *); diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index fbb0d4c..72a53bd 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -1460,6 +1460,13 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) return length; server->total_read += length; + if (server->ops->is_session_expired && + server->ops->is_session_expired(buf)) { + cifs_reconnect(server); + wake_up(&server->response_q); + return -1; + } + if (server->ops->is_status_pending && server->ops->is_status_pending(buf, server, 0)) { cifs_discard_remaining_data(server); diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 9365c0c..c59d77f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -812,6 +812,13 @@ cifs_handle_standard(struct TCP_Server_Info *server, struct mid_q_entry *mid) cifs_dump_mem("Bad SMB: ", buf, min_t(unsigned int, server->total_read, 48)); + if (server->ops->is_session_expired && + server->ops->is_session_expired(buf)) { + cifs_reconnect(server); + wake_up(&server->response_q); + return -1; + } + if (server->ops->is_status_pending && server->ops->is_status_pending(buf, server, length)) return -1; diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index ccbb397..0866dda 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1036,6 +1036,18 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length) return true; } +static bool +smb2_is_session_expired(char *buf) +{ + struct smb2_sync_hdr *shdr = get_sync_hdr(buf); + + if (shdr->Status != STATUS_NETWORK_SESSION_EXPIRED) + return false; + + cifs_dbg(FYI, "Session expired\n"); + return true; +} + static int smb2_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid, struct cifsInodeInfo *cinode) @@ -2160,6 +2172,13 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid, return -ENOTSUPP; } + if (server->ops->is_session_expired && + server->ops->is_session_expired(buf)) { + cifs_reconnect(server); + wake_up(&server->response_q); + return -1; + } + if (server->ops->is_status_pending && server->ops->is_status_pending(buf, server, 0)) return -1; @@ -2477,6 +2496,7 @@ struct smb_version_operations smb20_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock, @@ -2565,6 +2585,7 @@ struct smb_version_operations smb21_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock, @@ -2655,6 +2676,7 @@ struct smb_version_operations smb30_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock, @@ -2755,6 +2777,7 @@ struct smb_version_operations smb311_operations = { .close_dir = smb2_close_dir, .calc_smb_size = smb2_calc_size, .is_status_pending = smb2_is_status_pending, + .is_session_expired = smb2_is_session_expired, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, .mand_lock = smb2_mand_lock,