splice: Apply generic position and size checks to each write 36/76536/2
authorBen Hutchings <ben@decadent.org.uk>
Thu, 29 Jan 2015 02:50:33 +0000 (02:50 +0000)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 3 Aug 2016 02:34:40 +0000 (19:34 -0700)
commit7ec1da918e216faeb0e807abd1f9596101a727eb
treea83236af77d190829ffeb14033887355fd7b424f
parent2331bbf3776b5294e93b7a646c6591ed8d08b70e
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>
Change-Id: I10f6cd44e0223d515d905ee5f3043b5d22c31057
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
fs/ocfs2/file.c
fs/splice.c