Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3209061pxb; Mon, 9 Nov 2020 05:39:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyANeiYGPOkgsndd1uGMg8cL2SZQ+8Xc6VWcI91/jNPahuFp00FuMfUj9r/PwQwsHx+CCNA X-Received: by 2002:a17:906:6b86:: with SMTP id l6mr14772352ejr.524.1604929141483; Mon, 09 Nov 2020 05:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929141; cv=none; d=google.com; s=arc-20160816; b=zKw9P3YLKAnuUeuMMZRowYi+OTRWyspIBYS/fHBw9aKNpFY3CeANuNbh8251M42kFG 0BOnkJ+PqVs8nT3LpX2FgBLCKT1ZV+oSfMOVTdw54u0AVljE1XHua0Tsa9y01m7Uf+MM +EMnpxqhqsYD2QdMqWNYmUlmZ3Ui5fhcN5FjrdmVbrb8NeYa4kcZ6uNszXzGGRyPAuEN Z3bC1UrGaXpgpVTFrn1z/7kylspIbQQp6T68yYQ6O6QrSCH0abEV+cCa+fvFC5jE5AEz Bc7XG9On6yrAab/LQ1F/I7fONvaGCNZzBrakn0ie5ypgP/O2Hf9YnaJMTyA/JgTu4xEm XhMw== 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=dKMKRji7qwvIj65baEmYoBrKgibqZMn/3XV4fU2N9Nc=; b=rUPSKNstkZOVYZnyeOiDNEgxq3nGDghaA3gt1xff/WyAAXKVrT2m/wPgCjSK6Crlik 0mvHNQ/EKDUK4ULIw/4HHHrY0F0gGTxoIGZYyOOeCFk1bW1X6Vm80KDUmf8wFttROZZn 4zmDrWNPX+21mBgcTYyknOLareTPPbJgOT0UI0Mrj2cqSDhZj58lZeilrS7nFV9er+MJ XiqdBcrZJPDz+aC1iEsuu5K6N6LS2FUNlPrr7p8wQ5Q5ryhveL3FY3A4A6Dpitam7Trc evVlOSnaMhZgZv+csj1EApMf7JK3V9iTDoZnJC4cx7EjJsZtDV4u/IO15PtQXUKEpq5K Neog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xGVzkLzy; 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 o23si1251184edw.247.2020.11.09.05.38.38; Mon, 09 Nov 2020 05:39:01 -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=xGVzkLzy; 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 S1730772AbgKINEw (ORCPT + 99 others); Mon, 9 Nov 2020 08:04:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:56432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730166AbgKINDk (ORCPT ); Mon, 9 Nov 2020 08:03:40 -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 8CA302222F; Mon, 9 Nov 2020 13:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927003; bh=DJn9Bzb5YL6m8DBD5B6lJM0UZRtpFwQYvnaivUi/c7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xGVzkLzy6e9x1LIgAsPwpqO2wwIO0YI7aigI8AzA9/ftaugv6ONkpegeEgB+yCswz w5UfFsEI5LLkLKbF5nT+yZVAgVfdnlBtpoNNJaCjGKt+pUxsubyAh+/KvGEXo6SbDt t9PCJQozfrecEYiA/pzmVzfhAvfuyKJODFT/5F4k= 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 4.9 076/117] 9P: Cast to loff_t before multiplying Date: Mon, 9 Nov 2020 13:55:02 +0100 Message-Id: <20201109125029.292070666@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@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 @@ -624,9 +624,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), };