]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: add check for returning value of SMB2_close_init
authorAnastasia Belova <abelova@astralinux.ru>
Tue, 15 Nov 2022 14:27:01 +0000 (17:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:45:47 +0000 (17:45 +0100)
[ 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 <abelova@astralinux.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/smb2ops.c

index 11efd5289ec4338cd21f613a1e2ed65d8a3ebc43..1cc823e960656a0b65ad8b8efaace222a098ce24 100644 (file)
@@ -1266,6 +1266,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,