From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F0FF1C29 for ; Wed, 23 Nov 2022 09:35:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EDCFC433D6; Wed, 23 Nov 2022 09:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669196137; bh=6pClluBkmmB4aO4dR4XKqZqRJpy3bFqplyJWaqjgZw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F1R9hwFIgR3UG/jE7K0IsmUoyANE2h4gJvAbrBJH6YrM2FmHzUYKJov+WsqnCzrmz O/WjTd8IdfbKn6R123N1rpn3rvBNkzxEwGVvqUBhcUq4zQyuNu7WC0FWfO/QsqRdmg BDjqauU7QBDdRR7cb5U9oY+DIIeXkni4JKc7htT8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Anastasia Belova , Steve French , Sasha Levin Subject: [PATCH 5.15 099/181] cifs: add check for returning value of SMB2_close_init Date: Wed, 23 Nov 2022 09:51:02 +0100 Message-Id: <20221123084606.615537670@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084602.707860461@linuxfoundation.org> References: <20221123084602.707860461@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anastasia Belova [ Upstream commit d520de6cb42e88a1d008b54f935caf9fc05951da ] If the returning value of SMB2_close_init is an error-value, exit the function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 352d96f3acc6 ("cifs: multichannel: move channel selection above transport layer") Signed-off-by: Anastasia Belova Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/smb2ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 2d31860d56e9..30b2efafa2de 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1371,6 +1371,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, rqst[2].rq_nvec = 1; rc = SMB2_close_init(tcon, server, &rqst[2], COMPOUND_FID, COMPOUND_FID, false); + if (rc) + goto sea_exit; smb2_set_related(&rqst[2]); rc = compound_send_recv(xid, ses, server, -- 2.35.1