linux/fs/ceph
Yan, Zheng 1487a688d8 ceph: properly zero data pages for file holes.
A bug is found in striped_read() of fs/ceph/file.c. striped_read() calls
ceph_zero_pape_vector_range().  The first argument, page_align + read + ret,
passed to ceph_zero_pape_vector_range() is wrong.

When a file has holes, this wrong parameter may cause memory corruption
either in kernal space or user space. Kernel space memory may be corrupted in
the case of non direct IO; user space memory may be corrupted in the case of
direct IO. In the latter case, the application doing direct IO may crash due
to memory corruption, as we have experienced.

The correct value should be initial_align + read + ret, where intial_align =
o_direct ? buf_align : io_align.  Compared with page_align, the current page
offest, initial_align is the initial page offest, which should be used to
calculate the page and offset in ceph_zero_pape_vector_range().

Reported-by: caifeng zhu <zhucaifeng@unissoft-nj.com>
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-02-19 13:31:38 +03:00
..
acl.c ceph: acl: Remove unused function 2015-02-19 13:31:38 +03:00
addr.c ceph: use %zu for len in ceph_fill_inline_data() 2015-01-08 20:36:56 +03:00
cache.c ceph: fscache: Wait for completion of object initialization 2014-04-03 10:33:53 +08:00
cache.h ceph: fscache: add an interface to synchronize object store limit 2014-04-03 10:33:53 +08:00
caps.c ceph: handle SESSION_FORCE_RO message 2015-02-19 13:31:37 +03:00
ceph_frag.c
debugfs.c assorted conversions to %p[dD] 2014-11-19 13:01:20 -05:00
dir.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2014-12-17 16:03:12 -08:00
export.c ceph: ceph_get_parent() can be static 2014-06-06 09:29:50 +08:00
file.c ceph: properly zero data pages for file holes. 2015-02-19 13:31:38 +03:00
inode.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2014-12-17 16:03:12 -08:00
ioctl.c ceph: fix divide-by-zero in __validate_layout() 2014-10-14 12:57:05 -07:00
ioctl.h
Kconfig ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
locks.c ceph: fix file lock interruption 2014-12-17 20:09:49 +03:00
Makefile ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
mds_client.c ceph: handle SESSION_FORCE_RO message 2015-02-19 13:31:37 +03:00
mds_client.h ceph: handle SESSION_FORCE_RO message 2015-02-19 13:31:37 +03:00
mdsmap.c fs/ceph: replace pr_warning by pr_warn 2014-06-06 16:08:06 -07:00
snap.c ceph: flush inline version 2014-12-17 20:09:53 +03:00
strings.c ceph: add get_name() NFS export callback 2014-04-03 10:33:53 +08:00
super.c ceph: support inline data feature 2014-12-17 20:09:53 +03:00
super.h ceph: flush inline version 2014-12-17 20:09:53 +03:00
xattr.c ceph: fix setting empty extended attribute 2014-12-17 20:18:49 +03:00