Acked-by me On Tue, 10 Jan 2023 at 08:26, Paulo Alcantara <pc@xxxxxx> wrote: > > Xiaoli Feng <fengxiaoli0714@xxxxxxxxx> writes: > > > Test the latest kernel in the branch for-next of > > git://git.samba.org/sfrench/cifs-2.6.git. Kernel always panic when > > mount cifs with option "-o sec=krb5,multiuser". > > > > Bug 216878 - CIFS: kernel BUG at mm/slub.c:435 > > https://bugzilla.kernel.org/show_bug.cgi?id=216878 > > Thanks for the report. > > I wasn't able to reproduce it but the issue seems related to > sesInfoFree() calling kfree_sensitive() again in > cifs_ses::auth_key.response even though it was kfree_sensitive()'d > earlier in SMB2_auth_kerberos(). > > Does below changes fix your issue? Thanks. > > diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c > index 2c484d47c592..727f16b426be 100644 > --- a/fs/cifs/smb2pdu.c > +++ b/fs/cifs/smb2pdu.c > @@ -1482,8 +1482,11 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data) > out_put_spnego_key: > key_invalidate(spnego_key); > key_put(spnego_key); > - if (rc) > + if (rc) { > kfree_sensitive(ses->auth_key.response); > + ses->auth_key.response = NULL; > + ses->auth_key.len = 0; > + } > out: > sess_data->result = rc; > sess_data->func = NULL;