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:49:31 +0000 (12:49 -0700)
commitd0436288c2286cc471b03bddf36c04f937b1e752
tree3363e86a5f9b6a24b19139700c3f704cee74ffa0
parenta43adb2a09ec54181238bd00117585c3e6014f56
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