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@manguebit.com> Fixes: d70e9fa55884 ("cifs: try opening channels after mounting") Signed-off-by: Ekaterina Esina <eesina@astralinux.ru> Co-developed-by: Anastasia Belova <abelova@astralinux.ru> Signed-off-by: Anastasia Belova <abelova@astralinux.ru> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
cd1ae1d301
commit
1ddfbddb2d
1 changed files with 2 additions and 3 deletions
|
@ -433,6 +433,8 @@ generate_smb3signingkey(struct cifs_ses *ses,
|
||||||
ptriplet->encryption.context,
|
ptriplet->encryption.context,
|
||||||
ses->smb3encryptionkey,
|
ses->smb3encryptionkey,
|
||||||
SMB3_ENC_DEC_KEY_SIZE);
|
SMB3_ENC_DEC_KEY_SIZE);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
rc = generate_key(ses, ptriplet->decryption.label,
|
rc = generate_key(ses, ptriplet->decryption.label,
|
||||||
ptriplet->decryption.context,
|
ptriplet->decryption.context,
|
||||||
ses->smb3decryptionkey,
|
ses->smb3decryptionkey,
|
||||||
|
@ -441,9 +443,6 @@ generate_smb3signingkey(struct cifs_ses *ses,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
|
#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
|
||||||
cifs_dbg(VFS, "%s: dumping generated AES session keys\n", __func__);
|
cifs_dbg(VFS, "%s: dumping generated AES session keys\n", __func__);
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue