cifs: fix double free on failed kerberos auth
authorPaulo Alcantara <pc@cjr.nz>
Tue, 10 Jan 2023 20:55:20 +0000 (17:55 -0300)
committerSteve French <stfrench@microsoft.com>
Tue, 10 Jan 2023 21:32:03 +0000 (15:32 -0600)
commit39e8db3c860e2678ce5a7d74193925876507c9eb
treefb5cbca42dd71bdfd661772ed4195945b3d610d5
parent2f57e4464cddfceda850ae4224779d11b6eb171f
cifs: fix double free on failed kerberos auth

If session setup failed with kerberos auth, we ended up freeing
cifs_ses::auth_key.response twice in SMB2_auth_kerberos() and
sesInfoFree().

Fix this by zeroing out cifs_ses::auth_key.response after freeing it
in SMB2_auth_kerberos().

Fixes: a4e430c8c8ba ("cifs: replace kfree() with kfree_sensitive() for sensitive data")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c