]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfs: disallow duplicate pages in pgio page vectors
authorWeston Andros Adamson <dros@primarydata.com>
Mon, 15 Sep 2014 18:14:44 +0000 (14:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:41:01 +0000 (13:41 -0700)
commit42e32385b1bf5ebcf54f638220f6c135e775fc73
tree21810f94c89f12728502160c7c9d2e3eb51f2703
parent274a1dc919c8dc46e4517cee0e7e92e746bf16e7
nfs: disallow duplicate pages in pgio page vectors

commit bba5c1887a925a9945d22217d38d58d8b3ba1043 upstream.

Adjacent requests that share the same page are allowed, but should only
use one entry in the page vector. This avoids overruning the page
vector - it is sized based on how many bytes there are, not by
request count.

This fixes issues that manifest as "Redzone overwritten" bugs (the
vector overrun) and hangs waiting on page read / write, as it waits on
the same page more than once.

This also adds bounds checking to the page vector with a graceful failure
(WARN_ON_ONCE and pgio error returned to application).

Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pagelist.c