Skip to content

Commit 181724f

Browse files
Ekaterina Esinasmfrench
authored andcommitted
cifs: fix check of rc in function generate_smb3signingkey
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: d70e9fa ("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>
1 parent ff31ba1 commit 181724f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

fs/smb/client/smb2transport.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ generate_smb3signingkey(struct cifs_ses *ses,
458458
ptriplet->encryption.context,
459459
ses->smb3encryptionkey,
460460
SMB3_ENC_DEC_KEY_SIZE);
461+
if (rc)
462+
return rc;
461463
rc = generate_key(ses, ptriplet->decryption.label,
462464
ptriplet->decryption.context,
463465
ses->smb3decryptionkey,
@@ -466,9 +468,6 @@ generate_smb3signingkey(struct cifs_ses *ses,
466468
return rc;
467469
}
468470

469-
if (rc)
470-
return rc;
471-
472471
#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
473472
cifs_dbg(VFS, "%s: dumping generated AES session keys\n", __func__);
474473
/*

0 commit comments

Comments
 (0)