diff options
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r-- | fs/cifs/sess.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index ed150efbe27c..b537fad3bf50 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -505,7 +505,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, | |||
505 | unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); | 505 | unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); |
506 | } else | 506 | } else |
507 | ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); | 507 | ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); |
508 | } else if (type == Kerberos) { | 508 | } else if (type == Kerberos || type == MSKerberos) { |
509 | #ifdef CONFIG_CIFS_UPCALL | 509 | #ifdef CONFIG_CIFS_UPCALL |
510 | struct cifs_spnego_msg *msg; | 510 | struct cifs_spnego_msg *msg; |
511 | spnego_key = cifs_get_spnego_key(ses); | 511 | spnego_key = cifs_get_spnego_key(ses); |
@@ -516,6 +516,15 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, | |||
516 | } | 516 | } |
517 | 517 | ||
518 | msg = spnego_key->payload.data; | 518 | msg = spnego_key->payload.data; |
519 | /* check version field to make sure that cifs.upcall is | ||
520 | sending us a response in an expected form */ | ||
521 | if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) { | ||
522 | cERROR(1, ("incorrect version of cifs.upcall (expected" | ||
523 | " %d but got %d)", | ||
524 | CIFS_SPNEGO_UPCALL_VERSION, msg->version)); | ||
525 | rc = -EKEYREJECTED; | ||
526 | goto ssetup_exit; | ||
527 | } | ||
519 | /* bail out if key is too long */ | 528 | /* bail out if key is too long */ |
520 | if (msg->sesskey_len > | 529 | if (msg->sesskey_len > |
521 | sizeof(ses->server->mac_signing_key.data.krb5)) { | 530 | sizeof(ses->server->mac_signing_key.data.krb5)) { |