[linux-cifs-client] Re: [PATCH] cifs: sanity check version in spnego upcall response

Steve French smfrench at gmail.com
Tue Aug 26 00:40:53 GMT 2008


I have checked in a check to do this into cifs-2.6.git - Let me know
if it looks ok.

See

http://git.kernel.org/?p=linux/kernel/git/sfrench/cifs-2.6.git;a=commitdiff;h=6ce5eecb9cd3ac97b952c50309b87c31488a45e9

On Fri, Aug 22, 2008 at 7:03 AM, Jeff Layton <jlayton at redhat.com> wrote:
> Currently, we don't check the version in the SPNEGO upcall response
> even though one is provided. Do so and bail out with -EKEYREJECTED
> if the check fails.
>
> Signed-off-by: Jeff Layton <jlayton at redhat.com>
> ---
>  fs/cifs/sess.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
> index 3188e4d..4cd2343 100644
> --- a/fs/cifs/sess.c
> +++ b/fs/cifs/sess.c
> @@ -516,6 +516,13 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
>                }
>
>                msg = spnego_key->payload.data;
> +               /* sanity check version */
> +               if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) {
> +                       cERROR(1, ("Bad upcall version: expected %d, got %d",
> +                               CIFS_SPNEGO_UPCALL_VERSION, msg->version));
> +                       rc = -EKEYREJECTED;
> +                       goto ssetup_exit;
> +               }
>                /* bail out if key is too long */
>                if (msg->sesskey_len >
>                    sizeof(ses->server->mac_signing_key.data.krb5)) {
> --
> 1.5.5.1
>
>



-- 
Thanks,

Steve


More information about the linux-cifs-client mailing list