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 8ACA71C31 for ; Wed, 23 Nov 2022 09:51:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D40DBC433C1; Wed, 23 Nov 2022 09:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669197080; bh=E4hVuPZWYoK9alZX6UY13lYG4+KJEiWEZlyehNLXs8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GOdzBkJ73B6+AXzlJQi6zV6R8Xhvsn7dtQ+6tXFz/tMCmtuu/wgxDPQhuxgaVjuda 9GpDQaPzHptcSFdp/HAKvVswmPibVowinhtxHV1qCx5biqdmlQ/yzel7d/Q2+aViQo 13JTsFFZx47eqT4mBJXMX4J90ffjIWnIAWJDG7NI= 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 6.0 192/314] cifs: add check for returning value of SMB2_set_info_init Date: Wed, 23 Nov 2022 09:50:37 +0100 Message-Id: <20221123084634.253675824@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084625.457073469@linuxfoundation.org> References: <20221123084625.457073469@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 a51e5d293dd1c2e7bf6f7be788466cd9b5d280fb ] If the returning value of SMB2_set_info_init is an error-value, exit the function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 0967e5457954 ("cifs: use a compound for setting an xattr") 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 86a1f282c8b4..b724bf42b540 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1123,6 +1123,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, COMPOUND_FID, current->tgid, FILE_FULL_EA_INFORMATION, SMB2_O_INFO_FILE, 0, data, size); + if (rc) + goto sea_exit; smb2_set_next_command(tcon, &rqst[1]); smb2_set_related(&rqst[1]); -- 2.35.1