Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp164227pxu; Tue, 6 Oct 2020 22:55:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwiAGkRAc4lTHgSv0V58wYbT6x7C9C/ne3G7xY6i+XiLuufq7KJTE8VBN5i+Z1ciAgyi1J X-Received: by 2002:a17:907:392:: with SMTP id ss18mr1669178ejb.429.1602050142853; Tue, 06 Oct 2020 22:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602050142; cv=none; d=google.com; s=arc-20160816; b=J0vB/tBPh+vjVHAbBDiitzIj5nnvkRXXvMvJ4dcKbtZ/E/hnvNV1nes9fAkc8sfaIe mK65ARfx4IVlISVAc5B7Gj1OTVYGLtQy1E4ctsZXA3zATTKiAj1ZY21hKvXAHn9npKwc zYe0fsl29XzJ7PFbWut2eQA0/61AxPBgMRKZW4MpAE9k91a3NwXIhssJtkjZScYqgSs0 Un0ow1zMboDHytpjet0tVbzTx1t9pzrVLAQnWHXAMY689D86gTXqgQYTTf4SdeP+qBPQ F47b/ksprz0IRgxsHgsvdtuden0GgJ5Y3/8PgL6n9XX8NA1O6Yq/RjnsJKuv2rUBf6q2 3Qrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BBGqLkpiWOAukT4cGbe+ekpiE16tTJaZW03Gt7ynzdI=; b=SwXj+S+drASajIgVDa6Vr4NdVWf/2IdO54ZevhnrK40ORYLqWphACYAJVMtITysdrZ RZnzszEsTLBkcUnm1xegdUCF5LYDyAPeWsTgk5MAZ3LeGqstqwyV4HE5mVBathgLNspZ 0yjYnvBi1t93jyg28QIkSjzJbhFTR9hAad96ECo0yhpsbR2WePMQpnfg/uEfnAQFb09V jcbZwkfCDViYYYkpEH3nzeEEOJfikPfSEXyxZLB1vSh9II2GjO0gIVMhTynBOzxQFB8G vjS3aEa/woHcqW2cUGk60nkI1Jw7gmTKYX3e0c9NiSyW4fnJVM7NmFh56xuP860diz8J qz8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="t/QSLeG7"; 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 v20si717643ejg.640.2020.10.06.22.55.17; Tue, 06 Oct 2020 22:55:42 -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="t/QSLeG7"; 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 S1727107AbgJGFsy (ORCPT + 99 others); Wed, 7 Oct 2020 01:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbgJGFsx (ORCPT ); Wed, 7 Oct 2020 01:48:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 888C7C061755; Tue, 6 Oct 2020 22:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BBGqLkpiWOAukT4cGbe+ekpiE16tTJaZW03Gt7ynzdI=; b=t/QSLeG7RQBiWYRnopnrssXYFK n3vc0rGv17CNvb8Y/WkwuC/SxjNbRnzsh5m9BRlD8G6GX7t98k1d/y8cbqRO3l5L1aMv6Ydc0Mlg5 mI7i+pJQhT+VDALgc36DA0L/rTkp3ekxv+5aT/QsLlOv6P0LrPlMneAQMxZv5s2RdPz9PrRCSBa+T mSbtHJTbLCF/3NY+XJ95FcoXB62OM28dlVXti3pxX4KlwMT2J1tLLDuKyTyp1gXlUOrs/GWjXG7M9 YPio7RcXP51/avKaLimQVw1+JGWGKFzzAB90Z4jGDaZdw3MOOzI9IPKUfE6nNI5jJkBF/BQQWeSoh mzhEKVAg==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ2Jl-0004NF-9U; Wed, 07 Oct 2020 05:48:49 +0000 Date: Wed, 7 Oct 2020 06:48:49 +0100 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-fsdevel@vger.kernel.org, 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: Re: [PATCH 1/7] 9P: Cast to loff_t before multiplying Message-ID: <20201007054849.GA16556@infradead.org> References: <20201004180428.14494-1-willy@infradead.org> <20201004180428.14494-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201004180428.14494-2-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 04, 2020 at 07:04:22PM +0100, Matthew Wilcox (Oracle) wrote: > 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, Given the may places where this issue shows up I think we really need a vma_offset or similar helper for it. Much better than chasing missing casts everywhere.