Patch "cifs: fix check of rc in function generate_smb3signingkey" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cifs: fix check of rc in function generate_smb3signingkey

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cifs-fix-check-of-rc-in-function-generate_smb3signin.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e89c60e81a1c9451791254a50ae5a5532e563af7
Author: Ekaterina Esina <eesina@xxxxxxxxxxxxx>
Date:   Mon Nov 13 19:42:41 2023 +0300

    cifs: fix check of rc in function generate_smb3signingkey
    
    [ Upstream commit 181724fc72486dec2bec8803459be05b5162aaa8 ]
    
    Remove extra check after condition, add check after generating key
    for encryption. The check is needed to return non zero rc before
    rewriting it with generating key for decryption.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxxxxxxxxx>
    Fixes: d70e9fa55884 ("cifs: try opening channels after mounting")
    Signed-off-by: Ekaterina Esina <eesina@xxxxxxxxxxxxx>
    Co-developed-by: Anastasia Belova <abelova@xxxxxxxxxxxxx>
    Signed-off-by: Anastasia Belova <abelova@xxxxxxxxxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c
index 22954a9c7a6c7..69dbd08fd4419 100644
--- a/fs/smb/client/smb2transport.c
+++ b/fs/smb/client/smb2transport.c
@@ -451,6 +451,8 @@ generate_smb3signingkey(struct cifs_ses *ses,
 				  ptriplet->encryption.context,
 				  ses->smb3encryptionkey,
 				  SMB3_ENC_DEC_KEY_SIZE);
+		if (rc)
+			return rc;
 		rc = generate_key(ses, ptriplet->decryption.label,
 				  ptriplet->decryption.context,
 				  ses->smb3decryptionkey,
@@ -459,9 +461,6 @@ generate_smb3signingkey(struct cifs_ses *ses,
 			return rc;
 	}
 
-	if (rc)
-		return rc;
-
 #ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
 	cifs_dbg(VFS, "%s: dumping generated AES session keys\n", __func__);
 	/*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux