Skip to content

Commit 29a41f7

Browse files
Matthew Wilcox (Oracle)gregkh
authored andcommitted
9P: Cast to loff_t before multiplying
commit f5f7ab1 upstream. 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: fb89b45 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8ff240c commit 29a41f7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/9p/vfs_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ static void v9fs_mmap_vm_close(struct vm_area_struct *vma)
612612
struct writeback_control wbc = {
613613
.nr_to_write = LONG_MAX,
614614
.sync_mode = WB_SYNC_ALL,
615-
.range_start = vma->vm_pgoff * PAGE_SIZE,
615+
.range_start = (loff_t)vma->vm_pgoff * PAGE_SIZE,
616616
/* absolute end, byte at end included */
617-
.range_end = vma->vm_pgoff * PAGE_SIZE +
617+
.range_end = (loff_t)vma->vm_pgoff * PAGE_SIZE +
618618
(vma->vm_end - vma->vm_start - 1),
619619
};
620620

0 commit comments

Comments
 (0)