]> git.karo-electronics.de Git - karo-tx-linux.git/commit
NFSD: memory corruption due to writing beyond the stat array
authorKonstantin Khorenko <khorenko@parallels.com>
Tue, 1 Feb 2011 14:16:29 +0000 (17:16 +0300)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 26 Jun 2011 16:46:40 +0000 (12:46 -0400)
commitceff4319f486f08f35b7eda583227a93e06e2253
tree41db3018a45d2b6c077f5c83cb6ef678e49f6932
parent630aba4aea40201ebeff7a6ccead86b65ec89b0d
NFSD: memory corruption due to writing beyond the stat array

commit 3aa6e0aa8ab3e64bbfba092c64d42fd1d006b124 upstream.

If nfsd fails to find an exported via NFS file in the readahead cache, it
should increment corresponding nfsdstats counter (ra_depth[10]), but due to a
bug it may instead write to ra_depth[11], corrupting the following field.

In a kernel with NFSDv4 compiled in the corruption takes the form of an
increment of a counter of the number of NFSv4 operation 0's received; since
there is no operation 0, this is harmless.

In a kernel with NFSDv4 disabled it corrupts whatever happens to be in the
memory beyond nfsdstats.

Signed-off-by: Konstantin Khorenko <khorenko@openvz.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
fs/nfsd/vfs.c