]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: add check for returning value of SMB2_set_info_init
authorAnastasia Belova <abelova@astralinux.ru>
Wed, 16 Nov 2022 14:10:27 +0000 (17:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:42:16 +0000 (17:42 +0100)
[ Upstream commit 690e4be0671244129420409b502253a67a082b21 ]

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: 25da97c6a58f ("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>
fs/cifs/smb2ops.c

index 6039b0cdfe04e1129845ab238f5ec7956a49742b..d67676545a4215553f5328cf667d383173517466 100644 (file)
@@ -1216,6 +1216,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]);