Received: by 10.192.165.148 with SMTP id m20csp4150997imm; Mon, 30 Apr 2018 12:43:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqE5TxypY1W0HkmBz6hN0GsOH1gzyDR2+vwCXj6dF4uFEqdhfjyskngIl0T+4Ay6rhHuy8i X-Received: by 2002:a17:902:8d81:: with SMTP id v1-v6mr13161536plo.383.1525117425585; Mon, 30 Apr 2018 12:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525117425; cv=none; d=google.com; s=arc-20160816; b=ZKMwfGQ+moUogzysE8ghUBHPZP0lZvqigjLCtp9YvS5CcbIVk/zzTNkCcvK5Rcz+Ip F7EcudokOnbsgCBnZnqAIccKA0azStCG5UAdeDPOY7/USjuyvOSxmwyhWLBn9uyKkzcr MA6d0rrbT5BZBr96Ld3CMMXzLA4pDES5b/fFqgRenPZ4OJSELY6ClQSoc/8MW+PH16aw FzGL9qTUx07o3RkfR7VuojMB+FK0647dGFO3zivq1VFyZy8vffqmlz5afLDvSGk1/J/a /CXW+EGfB/N428tqTwRUGhboc25/WyXNQ+2/sCeFR2qs/zP1mDNnURrQoRTiInCB6ctV ZgtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=rpfhf9yuIx8HQMhkLoh71FBcX0/QS4hmUReXCNT846w=; b=Wa36qsjdkDvpOyJtTyC3zfON7JyH7ZTQPWp9GuEjxN2E2vuBbB4zwo5PeFi1yjOn0B ck4WfXU1svhzy9LzbNUGW92vqvu2sdj3fMU48c0/vHuW3UpmSrAEd4jajIYmOqHeMvP9 jpZs08rtmb2isFl3zi1+Qahx19iukOkV30pbA2FYgyb5ArtNfqdfzDm5LqGtkswfkDxO y42cWpvAPuE0zCmDYFqnnw9IFIj9wrLgo4B8C95zzxJPj0XJ2kRjYmnu/lg1RiHRFbLy WqY8QmVws6t64ngfMArvf66OQ8q9zbFQ8NjaGjUSt9pN/TFGVrm6obO8f7pmj1upy6Si ohpA== 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 h10si8018046pfh.278.2018.04.30.12.43.31; Mon, 30 Apr 2018 12:43:45 -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 S1756490AbeD3TmN (ORCPT + 99 others); Mon, 30 Apr 2018 15:42:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:36258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756311AbeD3T23 (ORCPT ); Mon, 30 Apr 2018 15:28:29 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6CEC122DC1; Mon, 30 Apr 2018 19:28:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CEC122DC1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve French , Ronnie Sahlberg Subject: [PATCH 4.16 067/113] SMB311: Fix reconnect Date: Mon, 30 Apr 2018 12:24:38 -0700 Message-Id: <20180430184018.050342778@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steve French commit 0d5ec281c0175d10f8d9be4d4a9c5fb37767ed00 upstream. The preauth hash was not being recalculated properly on reconnect of SMB3.11 dialect mounts (which caused access denied repeatedly on auto-reconnect). Fixes: 8bd68c6e47ab ("CIFS: implement v3.11 preauth integrity") Signed-off-by: Steve French CC: Stable Reviewed-by: Ronnie Sahlberg Signed-off-by: Greg Kroah-Hartman --- fs/cifs/transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -753,7 +753,7 @@ cifs_send_recv(const unsigned int xid, s goto out; #ifdef CONFIG_CIFS_SMB311 - if (ses->status == CifsNew) + if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) smb311_update_preauth_hash(ses, rqst->rq_iov+1, rqst->rq_nvec-1); #endif @@ -797,7 +797,7 @@ cifs_send_recv(const unsigned int xid, s *resp_buf_type = CIFS_SMALL_BUFFER; #ifdef CONFIG_CIFS_SMB311 - if (ses->status == CifsNew) { + if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) { struct kvec iov = { .iov_base = buf + 4, .iov_len = get_rfc1002_length(buf)