]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cifs: check for bytes_remaining going to zero in CIFS_SessSetup
authorJeff Layton <jlayton@redhat.com>
Wed, 27 Apr 2011 17:25:51 +0000 (13:25 -0400)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:47 +0000 (13:54 -0700)
commit43a36aea9fdbae025023cc500a74d498f380ec87
tree1788e81bdbdb32007489965bc7f5e8b568501e7d
parent9f6340c7bfc445ec0c8c620d79a4cea4a8fe654d
cifs: check for bytes_remaining going to zero in CIFS_SessSetup

commit fcda7f4578bbf9717444ca6da8a421d21489d078 upstream.

It's possible that when we go to decode the string area in the
SESSION_SETUP response, that bytes_remaining will be 0. Decrementing it at
that point will mean that it can go "negative" and wrap. Check for a
bytes_remaining value of 0, and don't try to decode the string area if
that's the case.

Reported-and-Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
fs/cifs/sess.c