projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab069d5
)
iomap: Add another assertion to inline data handling
author
Matthew Wilcox (Oracle)
<willy@infradead.org>
Thu, 5 Aug 2021 03:07:34 +0000
(20:07 -0700)
committer
Darrick J. Wong
<djwong@kernel.org>
Thu, 5 Aug 2021 17:30:33 +0000
(10:30 -0700)
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>
fs/iomap/buffered-io.c
patch
|
blob
|
history
diff --git
a/fs/iomap/buffered-io.c
b/fs/iomap/buffered-io.c
index
8ee0211
..
586d9d0
100644
(file)
--- a/
fs/iomap/buffered-io.c
+++ b/
fs/iomap/buffered-io.c
@@
-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;