Commit ae44f9c2 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Darrick J. Wong

iomap: Add another assertion to inline data handling

Check that the file tail does not cross a page boundary.  Requested by
Andreas.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent ab069d5f
...@@ -215,6 +215,8 @@ static int iomap_read_inline_data(struct inode *inode, struct page *page, ...@@ -215,6 +215,8 @@ static int iomap_read_inline_data(struct inode *inode, struct page *page,
if (PageUptodate(page)) if (PageUptodate(page))
return PAGE_SIZE - poff; return PAGE_SIZE - poff;
if (WARN_ON_ONCE(size > PAGE_SIZE - poff))
return -EIO;
if (WARN_ON_ONCE(size > PAGE_SIZE - if (WARN_ON_ONCE(size > PAGE_SIZE -
offset_in_page(iomap->inline_data))) offset_in_page(iomap->inline_data)))
return -EIO; return -EIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment