summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnastasia Belova <abelova@astralinux.ru>2022-11-16 17:10:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-25 19:45:48 +0300
commit5fc19c83132042b6c6a35cd66be4fdf61711760d (patch)
tree07f11f4f185840cdd5b3e54a693e69ee25872eb5
parent0aeb0de528eccc2b7ff487390a68d2a2bb1083ba (diff)
downloadlinux-5fc19c83132042b6c6a35cd66be4fdf61711760d.tar.xz
cifs: add check for returning value of SMB2_set_info_init
[ 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 <abelova@astralinux.ru> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/cifs/smb2ops.c2
1 files changed, 2 insertions, 0 deletions
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]);