Project

General

Profile

Actions

Bug #10448

closed

wrong parameter passed to ceph_zero_pape_vector_range() in striped_read() of fs/ceph/file.c

Added by caifeng zhu over 9 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
kceph
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Hi, all

A bug is found in striped_read() of fs/ceph/file.c.
striped_read() calls ceph_zero_pape_vector_range() at line 359.
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().

Best Regards!

Actions #1

Updated by Greg Farnum over 9 years ago

  • Project changed from Linux kernel client to CephFS
  • Category set to 53

I don't think rbd uses anything under fs/ceph, so here's a category where Zheng and Sage are more likely to notice it.

Actions #2

Updated by Zheng Yan over 9 years ago

  • Status changed from New to 7

push a fix to the testing branch

Actions #3

Updated by Greg Farnum over 9 years ago

Zheng, we've got a new failing directio test at http://qa-proxy.ceph.com/teuthology/teuthology-2014-12-28_23:08:01-kcephfs-next-testing-basic-multi/682654/, could this be the cause?

Actions #4

Updated by Greg Farnum over 9 years ago

  • Assignee set to Zheng Yan

Zheng?

Actions #5

Updated by Zheng Yan over 9 years ago

the directio failure is caused by the 'reading inline data' changes

Actions #6

Updated by Zheng Yan over 9 years ago

direct io failure is fixed by "ceph: fix reading inline data when i_size > PAGE_SIZE"

Actions #7

Updated by Zheng Yan about 9 years ago

  • Status changed from 7 to Resolved
Actions #8

Updated by Greg Farnum almost 8 years ago

  • Component(FS) kceph added
Actions

Also available in: Atom PDF