]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cifs: extend the buffer length enought for sprintf() using
authorChen Gang <gang.chen@asianux.com>
Fri, 19 Jul 2013 01:01:36 +0000 (09:01 +0800)
committerSteve French <smfrench@gmail.com>
Fri, 19 Jul 2013 16:17:06 +0000 (11:17 -0500)
commit9a85e69beb4d04d7685f9432a7c8c6343e59d4e2
treebdd589700f0b85b2988a43b11b535ae8fb3fb018
parentecb2cf1a6b63825a258ff4fe0d7f3070fbe4676b
cifs: extend the buffer length enought for sprintf() using

For cifs_set_cifscreds() in "fs/cifs/connect.c", 'desc' buffer length
is 'CIFSCREDS_DESC_SIZE' (56 is less than 256), and 'ses->domainName'
length may be "255 + '\0'".

The related sprintf() may cause memory overflow, so need extend related
buffer enough to hold all things.

It is also necessary to be sure of 'ses->domainName' must be less than
256, and define the related macro instead of hard code number '256'.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/cifsencrypt.c
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/sess.c