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 D386A1C29 for ; Wed, 23 Nov 2022 09:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56384C433D6; Wed, 23 Nov 2022 09:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669195428; bh=DoFKZMRKAuqgSoF+s1dcHcq4/XIMy9PMWgt7RwUJyUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jjVFF9hEuwN4bTZ7Blb1O2r77ZMYHwWza5ISBeVBO1dseAJNPkiiyrpiU2YAxwPhp /Xm8Nf+NtxSk1K73CIGDRGtv3pY43cdhCQIn/atgdDJSFy0ch1NI9SXfqVBkfHLJqV tmKo6qhobHn3tul8PW3dxyicEtFBXTtRByMF9i4g= 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.10 081/149] cifs: add check for returning value of SMB2_set_info_init Date: Wed, 23 Nov 2022 09:51:04 +0100 Message-Id: <20221123084600.892847482@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084557.945845710@linuxfoundation.org> References: <20221123084557.945845710@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 1cc823e96065..72368b656b33 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1256,6 +1256,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