summaryrefslogtreecommitdiff
path: root/fs/btrfs/xattr.c
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2017-04-07 13:11:10 -0700
committerDavid Sterba <dsterba@suse.com>2017-04-11 18:49:29 +0200
commit97bf5a5589aa3a59c60aa775fc12ec0483fc5002 (patch)
tree1881d08a5d87094eee395288473860f36d2c14c2 /fs/btrfs/xattr.c
parent2e949b0a5592664f8b3eb3e2e48213f514892561 (diff)
Btrfs: fix segmentation fault when doing dio read
Commit 2dabb3248453 ("Btrfs: Direct I/O read: Work on sectorsized blocks") introduced this bug during iterating bio pages in dio read's endio hook, and it could end up with segment fault of the dio reading task. So the reason is 'if (nr_sectors--)', and it makes the code assume that there is one more block in the same page, so page offset is increased and the bio which is created to repair the bad block then has an incorrect bvec.bv_offset, and a later access of the page content would throw a segmentation fault. This also adds ASSERT to check page offset against page size. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/xattr.c')
0 files changed, 0 insertions, 0 deletions