cifs: fix potential buffer overrun when composing a new options string
authorJeff Layton <jlayton@redhat.com>
Fri, 24 May 2013 11:40:04 +0000 (07:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Jun 2013 19:46:48 +0000 (12:46 -0700)
commit1b968601f5b7e98cf519684589f853768d377144
tree08896c38b57cc9ff348f93723e6c701381675234
parent2b23550e4d01f4c0c1560c899db43e1a63f7ccd0
cifs: fix potential buffer overrun when composing a new options string

commit 166faf21bd14bc5c5295a44874bf7f3930c30b20 upstream.

Consider the case where we have a very short ip= string in the original
mount options, and when we chase a referral we end up with a very long
IPv6 address. Be sure to allow for that possibility when estimating the
size of the string to allocate.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifs_dfs_ref.c