Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2764245pxk; Sun, 4 Oct 2020 11:05:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMDqgh4RtdUZd9JhyuBP5jrtA7KWO3GrxDEe/4aeMenxUaLxS9zJTpy0Dnv5guizEWkRR2 X-Received: by 2002:a17:906:fcae:: with SMTP id qw14mr12087453ejb.537.1601834759039; Sun, 04 Oct 2020 11:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601834759; cv=none; d=google.com; s=arc-20160816; b=vqYwiedMXP14PCxrJ9fhdD78WwDXe+fxKeJpzKq8hFMxfYYtV7HAvjJwdcyiwunhU7 iVwJBQNK2AuiOUE/Iqe765fD4XJidgOErBRue3G4OO4DANslwACTgQ5CmDlvaajZXikx NjRy3KKUg7LXNziW9i3Upgdid3kTDHezwg+yyYryBNNeqbKQZ0KpJ564fiTCnWyoAqoP Z8T5s2avfn+t+GfAUksKUMavwKMCaIP3n+lu6UkLZ0r8sDs0qw1hljwpBZVs6FZmRRSx cPEMRNfAzHzJswrMvLjbrH4knwQb6O796lV2aW3pfRfsB+IvsZZzflj80c6JSHSxM9aJ KJoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lcDrPyve8ZGqJ4GdFbmYERQ0EctUPUpm2VwVCWrS8pU=; b=LIKQLUKm9n2lmUa1ZIxki2YgLL7mZzR2Y6Z82HXhO1CBj4hHcwMgiYlgIwwnJPS9yH YpUvJC5kjXbh/r5MODr60dr6IwbuEMAxg8MqFDw37JHUIvbd9fzYnDf7IiIAXQTfnYJ5 bS6W40SuXR6eoC9v84WKYpi6MGv7ftbHRVRhtDMfowgEZeeFdbGr4Zj5h62Vg2kmWxe9 odoAxgXEdMgjviDu5qzIvMQ10JMUXxYIB05efQR+Cf8IQuJQ1E6OtYD4Q/BD87CZ5rxf kcREE2ENn704vYA9rqfTotN+CR2/8YaEQaWzkz5L2uKfhQD0IQK2q3+RGKR/AqNmOOIk 0TLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="b/hQUZP8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cn23si5592300edb.216.2020.10.04.11.05.36; Sun, 04 Oct 2020 11:05:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="b/hQUZP8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbgJDSEk (ORCPT + 99 others); Sun, 4 Oct 2020 14:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgJDSEj (ORCPT ); Sun, 4 Oct 2020 14:04:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF29C0613CE; Sun, 4 Oct 2020 11:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=lcDrPyve8ZGqJ4GdFbmYERQ0EctUPUpm2VwVCWrS8pU=; b=b/hQUZP816I2ZPcyTtYJrK0hPU eTT6yKyUGxFh7cmzFamPce4SyXe30LGUt/w2KAnHF4rWLPsDPz8qLwoSZihNO4XGJ225/rAL9xCPp eJT3Hw5qpYqLVINHcgEZEPjKCvuMYoTcdJp3VKRm2OVr4YjlY4vrGvPOuWRnw9PHt32Bp//fi7Dzb PvCfP5kaSZXNQAoYhUAtkkrE3t1AzsweMP5UROoIeF71zOfo1kQoHfYts7prtHfRLVFCx2/hKVDuy S70qOhDWnAi0pZzDyNBy4V2Ivu9/nA75VcvlC/styaN6bzFWKDrsAystUNHqLn6AHosJiPwxNLG5K sMNpzx4g==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kP8N5-0003mY-6K; Sun, 04 Oct 2020 18:04:31 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , ericvh@gmail.com, lucho@ionkov.net, viro@zeniv.linux.org.uk, jlayton@kernel.org, idryomov@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-btrfs@vger.kernel.org, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, stable@vger.kernel.org Subject: [PATCH 1/7] 9P: Cast to loff_t before multiplying Date: Sun, 4 Oct 2020 19:04:22 +0100 Message-Id: <20201004180428.14494-2-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201004180428.14494-1-willy@infradead.org> References: <20201004180428.14494-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 32-bit systems, this multiplication will overflow for files larger than 4GB. Cc: stable@vger.kernel.org Fixes: fb89b45cdfdc ("9P: introduction of a new cache=mmap model.") Signed-off-by: Matthew Wilcox (Oracle) --- fs/9p/vfs_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3576123d8299..6d97b6b4d34b 100644 --- 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), }; -- 2.28.0