Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2472596pxj; Mon, 10 May 2021 03:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwms2oKJzra6C/TxG6hyhS08mCM4k/GUmtXQSBcFex3jym1n91Ufn4H5oYQ/bIeQPHJ27bB X-Received: by 2002:a92:cd85:: with SMTP id r5mr20970928ilb.169.1620644259444; Mon, 10 May 2021 03:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644259; cv=none; d=google.com; s=arc-20160816; b=Zod26bMZIpVuKDV1hVthp6IdZS+vPNSYZrL5S4Z0vi5/xFvIYloTQ9xxYDifv2hKrq qyy8svQxyZkni3WAl0AhT9reYdtlKRe96+9tSye7/4YGgqZ37KGQ1neF5zMKekqIRa8S U6CZ1GZ4bU95RFiTk2u/T++vNOA8EcimwqAcTbR2cHu91+x1kGnTJSxgvLogpwBwKbNa i6kQJrdRHSDPc6oR1x22geV+WQQVNnl6vC4To1jMzNWiAsAcgYiFOMwKKaIcR7zz18zL icXiFQh+ZQuW5wHeQxSIxw0TNZBEf5EhvbxtdKiMg9XuIC+4l+BllM5z6S+5pTuDwBWP qRxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+Qs/Qrg0t4NY0b1ZK4ZVJNqxbuJOHr8zyuZYLaE+4X4=; b=rX2UqGypgKkk6MV9x+w+gtcbah5Egt8t/U01837dQoLsfQ7/KQVk0iYSZPTUWcgat6 r92SYhEV9xUF+O+DU4NKVgryjl2R//k1nrKJ10AyoljP0sbaM55Fg5HIFWd+u/jbTFMT jXoAkBRNbPAbZBKGiYv6UhG95s7O3cVR8HMWpDIsuD9M6kqzx314u2y674SsdyaBOpOF rNUDzAp5rcsxX7VG/iJo8J4JJ2Z6NyEZWCVDcVxhcyPHOKoPUz9ZYl4AfDxxZiL6wDMT 9QzDkOdlDUeaMs7W/qW3P62uckOz+T7Sj8OflOTBuDjcTsVAq5WdJKgPS/dTSuVpz3pk 81Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yIXDI0Cj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i21si20871684iov.29.2021.05.10.03.57.27; Mon, 10 May 2021 03:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yIXDI0Cj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbhEJKxa (ORCPT + 99 others); Mon, 10 May 2021 06:53:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:49358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232349AbhEJKm1 (ORCPT ); Mon, 10 May 2021 06:42:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E56D56197D; Mon, 10 May 2021 10:32:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642761; bh=Xm9u71iL/5rShfjc7BImNks/MhSQ5+eQU7mJ4bEIrik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yIXDI0CjEblaaP45wi8jqbk8bG5xeLpsllKTg1o+RP/CpKLijWYmaWmWZoirUP2QQ Dpej3e+/XlbOjoR0qZIcsT/usB9U/+VswdPb1yLyJmi1bJq7xQMvHLMIym0xmRkGJP twhlPIx1iAt5HTcDjxAKpEEPiL37L1eKx3OyCZMw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Aurich , Steve French Subject: [PATCH 5.10 039/299] cifs: Return correct error code from smb2_get_enc_key Date: Mon, 10 May 2021 12:17:16 +0200 Message-Id: <20210510102006.142070740@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Aurich commit 83728cbf366e334301091d5b808add468ab46b27 upstream. Avoid a warning if the error percolates back up: [440700.376476] CIFS VFS: \\otters.example.com crypt_message: Could not get encryption key [440700.386947] ------------[ cut here ]------------ [440700.386948] err = 1 [440700.386977] WARNING: CPU: 11 PID: 2733 at /build/linux-hwe-5.4-p6lk6L/linux-hwe-5.4-5.4.0/lib/errseq.c:74 errseq_set+0x5c/0x70 ... [440700.397304] CPU: 11 PID: 2733 Comm: tar Tainted: G OE 5.4.0-70-generic #78~18.04.1-Ubuntu ... [440700.397334] Call Trace: [440700.397346] __filemap_set_wb_err+0x1a/0x70 [440700.397419] cifs_writepages+0x9c7/0xb30 [cifs] [440700.397426] do_writepages+0x4b/0xe0 [440700.397444] __filemap_fdatawrite_range+0xcb/0x100 [440700.397455] filemap_write_and_wait+0x42/0xa0 [440700.397486] cifs_setattr+0x68b/0xf30 [cifs] [440700.397493] notify_change+0x358/0x4a0 [440700.397500] utimes_common+0xe9/0x1c0 [440700.397510] do_utimes+0xc5/0x150 [440700.397520] __x64_sys_utimensat+0x88/0xd0 Fixes: 61cfac6f267d ("CIFS: Fix possible use after free in demultiplex thread") Signed-off-by: Paul Aurich CC: stable@vger.kernel.org Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -4076,7 +4076,7 @@ smb2_get_enc_key(struct TCP_Server_Info } spin_unlock(&cifs_tcp_ses_lock); - return 1; + return -EAGAIN; } /* * Encrypt or decrypt @rqst message. @rqst[0] has the following format: