Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2189261ybm; Thu, 23 May 2019 12:50:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+fFMtt0n6FT5y7eTVkkoul6yS7SvmT7cEgSy0KY6qHyUuLXhNTW0vk8Cr7wwF7ldEQqv2 X-Received: by 2002:a17:902:4181:: with SMTP id f1mr78216128pld.22.1558641031176; Thu, 23 May 2019 12:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558641031; cv=none; d=google.com; s=arc-20160816; b=XuoB3pXdAmKMNM9teHw5dOI2KgdM9jQOi5Kp5EIg89+BjsjQyPU/qWvx1X7iHgswN3 MA7v0X5bdprmgjL6ajGbDgwJZb1dIPvqagWtbETKBs8SMHReVhxqRIU+6EueWaa35M1i 2fYJia1Oi8HZ4b2DdxRhKBE+wJsFSNmMpxWvC4yPN8wUP6/VRPipE46wPdWbdRuRNr1e EP2pp8ucPbA+FFqQWPHa1/ozQTk56W0+hyPnfjAYO+bZuZd7yaMbIcbAcUfifdlLEF+s 9WUYfj0TpSkA6Kxghx1/8zGC5nItzyxO+TjDD5s/tzK84dnhfgMeqEh4i3fC3whm3gVS gcVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Aw5PZ6SRhR7s3hgpKB3nRqH5GBqoEY+x8qnvkq4OIW8=; b=Ct3PwMNQVRvpcRavcS9Kd4HUwmyXY9WznNlx8kumAjOD/zJu/XlexPcQhtcgYHXCa9 RfN+Mr5duALX/i204oW8tUAwpPuYq+idaZjVbK8S/WPivFPiHsW4zDWJfisuws7NwB4e KIjsM2Fk7nBhlLgnz8hop1NCmT5AF8h8Ag1OPZemG1skf1zy04A9yCE2ssVIJomkL22v sYIKoY4XiOxxK4d1SX1+xZN7YlLnSqHnN2J2jkOtOeRJ11ZIqTg3OZE17TIsZlv8jqXn EMQgYSZq+w+eC9XRBQKtvLBZGDFBRBmqsEowMtDzKgD+UZ9ZTgNB9iOvUUzisYLIzW9x xdTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P/2Agi0s"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si524576plk.237.2019.05.23.12.50.16; Thu, 23 May 2019 12:50:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P/2Agi0s"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388206AbfEWTLc (ORCPT + 99 others); Thu, 23 May 2019 15:11:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:44912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388194AbfEWTL3 (ORCPT ); Thu, 23 May 2019 15:11:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 261D1217D7; Thu, 23 May 2019 19:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638688; bh=sBiEtL3xSL3LEDcQEkAfib4ojf4HSSTCLYJxCD6V/jI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P/2Agi0sm51ZnaNmQV6DpsDXXrxV+qfw93PIDDBjCiOjzsiy80Uyq7pOP0xkzD45c ZgyrexhjQQgV4vK4DaxteG2KSn3tj8pKHy7ZspmQ20aFEna07ZFvoqDM8QILMERjH4 ArJZuFvs+V3qscWrMqIicRExMBoLZDDiw7kuq+qo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antonio SJ Musumeci , Miklos Szeredi Subject: [PATCH 4.14 28/77] fuse: fix writepages on 32bit Date: Thu, 23 May 2019 21:05:46 +0200 Message-Id: <20190523181724.151094898@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miklos Szeredi commit 9de5be06d0a89ca97b5ab902694d42dfd2bb77d2 upstream. Writepage requests were cropped to i_size & 0xffffffff, which meant that mmaped writes to any file larger than 4G might be silently discarded. Fix by storing the file size in a properly sized variable (loff_t instead of size_t). Reported-by: Antonio SJ Musumeci Fixes: 6eaf4782eb09 ("fuse: writepages: crop secondary requests") Cc: # v3.13 Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1525,7 +1525,7 @@ __acquires(fc->lock) { struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_inode *fi = get_fuse_inode(inode); - size_t crop = i_size_read(inode); + loff_t crop = i_size_read(inode); struct fuse_req *req; while (fi->writectr >= 0 && !list_empty(&fi->queued_writes)) {