projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
549738f
)
9P: Cast to loff_t before multiplying
author
Matthew Wilcox (Oracle)
<willy@infradead.org>
Sun, 4 Oct 2020 18:04:22 +0000
(19:04 +0100)
committer
Dominique Martinet
<asmadeus@codewreck.org>
Wed, 7 Oct 2020 21:57:30 +0000
(23:57 +0200)
On 32-bit systems, this multiplication will overflow for files larger
than 4GB.
Link:
http://lkml.kernel.org/r/20201004180428.14494-2-willy@infradead.org
Cc: stable@vger.kernel.org
Fixes:
fb89b45cdfdc
("9P: introduction of a new cache=mmap model.")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
fs/9p/vfs_file.c
patch
|
blob
|
history
diff --git
a/fs/9p/vfs_file.c
b/fs/9p/vfs_file.c
index
3576123
..
6d97b6b
100644
(file)
--- a/
fs/9p/vfs_file.c
+++ b/
fs/9p/vfs_file.c
@@
-612,9
+612,9
@@
static void v9fs_mmap_vm_close(struct vm_area_struct *vma)
struct writeback_control wbc = {
.nr_to_write = LONG_MAX,
.sync_mode = WB_SYNC_ALL,
- .range_start = vma->vm_pgoff * PAGE_SIZE,
+ .range_start =
(loff_t)
vma->vm_pgoff * PAGE_SIZE,
/* absolute end, byte at end included */
- .range_end = vma->vm_pgoff * PAGE_SIZE +
+ .range_end =
(loff_t)
vma->vm_pgoff * PAGE_SIZE +
(vma->vm_end - vma->vm_start - 1),
};