splice: Apply generic position and size checks to each write
authorBen Hutchings <ben@decadent.org.uk>
Thu, 29 Jan 2015 02:50:33 +0000 (02:50 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2015 08:33:57 +0000 (10:33 +0200)
commit13d32f27d15c5c53254ed88e3d2042c34de1bfaa
treedc362ef39261386323f5e7b0ec2cc158a25049ec
parent1ca630d975c5abb422ef7969494cacd91a1c125a
splice: Apply generic position and size checks to each write

commit 894c6350eaad7e613ae267504014a456e00a3e2a from the 3.2-stable branch.

We need to check the position and size of file writes against various
limits, using generic_write_check().  This was not being done for
the splice write path.  It was fixed upstream by commit 8d0207652cbe
("->splice_write() via ->write_iter()") but we can't apply that.

CVE-2014-7822

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[Ben fixed it in 3.2 stable, i ported it to 3.10 stable]
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ocfs2/file.c
fs/splice.c