Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp804564pxb; Tue, 3 Nov 2020 13:01:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdnO29w2ps7HrO6SVzOx0RZpLMTTkeVed7ARWZlNtldtvNE+Tv+kiuraJqKQKrR/GYqfZt X-Received: by 2002:a17:906:ccd3:: with SMTP id ot19mr17433520ejb.44.1604437303782; Tue, 03 Nov 2020 13:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437303; cv=none; d=google.com; s=arc-20160816; b=xMSfz0RP5gvU5xf4ERqahzVK2tgdsQQ++ct1fWZnnhXjfmQy9ANEAYjIZU0enplW7x nypGYECfYPocNQVhmDdm2o7tQqTZLeY0hB1P5uVWDQOX2F4E3K+XupKX+0vX8xbU/tKF Q4Ilh+S63crnUJrY5aN/SQmkSI0DtUrV6aQVKGVmUOU18yL3P3m/ii55ZCppN2HSMp95 qtG+U2a+FcC539/fTUBhaknSrq4erwwFxrmRDzd+1/mRApMqAKwD7w9YSKGysrreu21R 6v/sxVAl0UZMBUydA1iyiN2tfpEnP/atVN9rjwdX51K1pikjCfjpAYLf8r49DHmhW//+ xlJQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ty4v2kwXzCG/pwwYIH9lU589oP9F40nt9ed8aY5pWAw=; b=Lw+msWtYWYYYVKpRi4Pdqq1iFM0BQKYoZRHJId7C57DUZ2V5jy/rpNn4PQUmuhCSaQ 1S3lWqKhOtyyasDPrvndzxr3yBoD/Ywje6HuQcWv6ZKpdafdnOCfsGL/RwZJ3RGZizJB K+mYYsDoCHY6EWEgjjZT5C35XfS/2+W+Va8I1f/j970r2kSYSAmop2wKqNrV2NdHh+SG G/a13U24I5+Ftzvla2hXd6ofD00pwKvQqz6SfK9mfwwooFhuLFZjspIANXinykjCLsCb JLvhykmS5Fitq2Pg1o/XXG/Kk0KMgcUwwLqwMNKE4a7wggbLTdrCGWIcvunH8uGK5+/M UMSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nh0XrH4t; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si16686651edr.134.2020.11.03.13.01.20; Tue, 03 Nov 2020 13:01:43 -0800 (PST) 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=@kernel.org header.s=default header.b=nh0XrH4t; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733184AbgKCVAF (ORCPT + 99 others); Tue, 3 Nov 2020 16:00:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:35574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733180AbgKCVAC (ORCPT ); Tue, 3 Nov 2020 16:00:02 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 341222053B; Tue, 3 Nov 2020 21:00:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437201; bh=3pBLNJs1luTn9YzSBMBqv1uQYXwYTOhXuVCwqMm8TRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nh0XrH4tQIICLgISfkN/nZPyrLe9j3TGeAjmd/qk1piPh2DkfVHKNsgo/wSLn7nVt KtMVmu/MlnWcpIveCZq2vXdzklfRyzMW/lR7qOWbOgjRhNiyKLI20kezwauc2XMrua KQ/1bQksVacs1v1pYEuLYVNIgxWDpgPFC25/pkDI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Matthew Wilcox (Oracle)" , Dominique Martinet Subject: [PATCH 5.4 189/214] 9P: Cast to loff_t before multiplying Date: Tue, 3 Nov 2020 21:37:17 +0100 Message-Id: <20201103203308.383145075@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox (Oracle) commit f5f7ab168b9a60e12a4b8f2bb6fcc91321dc23c1 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: fb89b45cdfdc ("9P: introduction of a new cache=mmap model.") Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Dominique Martinet Signed-off-by: Greg Kroah-Hartman --- fs/9p/vfs_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -609,9 +609,9 @@ static void v9fs_mmap_vm_close(struct vm 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), };