]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
nfs: Avoid overrun when copying client IP address string
authorBen Hutchings <ben@decadent.org.uk>
Tue, 6 Oct 2009 19:42:18 +0000 (15:42 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:22:59 +0000 (16:22 -0800)
commit55a6efb39afcfe70754a733cdca91b6e1599fb6b
tree19e54fe40bf3b108a110d9d0ba0a08c1e274438d
parentcd45ad45a38aa500f96254ce21890ae7611cef46
nfs: Avoid overrun when copying client IP address string

commit f4373bf9e67e4a653c8854acd7b02dac9714c98a upstream.

As seen in <http://bugs.debian.org/549002>, nfs4_init_client() can
overrun the source string when copying the client IP address from
nfs_parsed_mount_data::client_address to nfs_client::cl_ipaddr.  Since
these are both treated as null-terminated strings elsewhere, the copy
should be done with strlcpy() not memcpy().

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/client.c