mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
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: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
parent
ab069d5fdc
commit
ae44f9c286
1 changed files with 2 additions and 0 deletions
|
@ -215,6 +215,8 @@ static int iomap_read_inline_data(struct inode *inode, struct page *page,
|
|||
if (PageUptodate(page))
|
||||
return PAGE_SIZE - poff;
|
||||
|
||||
if (WARN_ON_ONCE(size > PAGE_SIZE - poff))
|
||||
return -EIO;
|
||||
if (WARN_ON_ONCE(size > PAGE_SIZE -
|
||||
offset_in_page(iomap->inline_data)))
|
||||
return -EIO;
|
||||
|
|
Loading…
Reference in a new issue