ceph: promote to unsigned long long before shifting
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 4 Oct 2020 18:04:24 +0000 (19:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:07:03 +0000 (11:07 +0100)
commit c403c3a2fbe24d4ed33e10cabad048583ebd4edf upstream.

On 32-bit systems, this shift will overflow for files larger than 4GB.

Cc: stable@vger.kernel.org
Fixes: 61f68816211e ("ceph: check caps in filemap_fault and page_mkwrite")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/addr.c

index 4d622654bfbcc2eb10ce81d461c53a35e5f2c44d..ae1435c12d2be13ddf5ea9976e0d56cd5c4832a4 100644 (file)
@@ -1443,7 +1443,7 @@ static int ceph_filemap_fault(struct vm_fault *vmf)
        struct ceph_inode_info *ci = ceph_inode(inode);
        struct ceph_file_info *fi = vma->vm_file->private_data;
        struct page *pinned_page = NULL;
-       loff_t off = vmf->pgoff << PAGE_SHIFT;
+       loff_t off = (loff_t)vmf->pgoff << PAGE_SHIFT;
        int want, got, ret;
        sigset_t oldset;