cifs: ignore everything in SPNEGO blob after mechTypes
authorJeff Layton <jlayton@redhat.com>
Mon, 11 Mar 2013 13:52:19 +0000 (09:52 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 27 Mar 2013 02:41:21 +0000 (02:41 +0000)
commitbbb8c22360473df0d982181a0cf69780ad2b10d1
treea6dbcc5f418950ff0564caf3e7f5f8cfca110b60
parentb1576b45181be7a74005e00d372033e3e2747a3d
cifs: ignore everything in SPNEGO blob after mechTypes

commit f853c616883a8de966873a1dab283f1369e275a1 upstream.

We've had several reports of people attempting to mount Windows 8 shares
and getting failures with a return code of -EINVAL. The default sec=
mode changed recently to sec=ntlmssp. With that, we expect and parse a
SPNEGO blob from the server in the NEGOTIATE reply.

The current decode_negTokenInit function first parses all of the
mechTypes and then tries to parse the rest of the negTokenInit reply.
The parser however currently expects a mechListMIC or nothing to follow the
mechTypes, but Windows 8 puts a mechToken field there instead to carry
some info for the new NegoEx stuff.

In practice, we don't do anything with the fields after the mechTypes
anyway so I don't see any real benefit in continuing to parse them.
This patch just has the kernel ignore the fields after the mechTypes.
We'll probably need to reinstate some of this if we ever want to support
NegoEx.

Reported-by: Jason Burgess <jason@jacknife2.dns2go.com>
Reported-by: Yan Li <elliot.li.tech@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/asn1.c