From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F676C282DD for ; Thu, 23 May 2019 19:11:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64F2F217D9 for ; Thu, 23 May 2019 19:11:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638693; bh=sBiEtL3xSL3LEDcQEkAfib4ojf4HSSTCLYJxCD6V/jI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wWVZ8pNlF//gn3j00fyvpj2S0GYe4pb0rn3nhv1lmDFuxqZfBjDm1e54XvDRxypMi XQHKhfEZQYjxEli08fB/XffcYfWRM72pV+ZFrq6Dz2YPTVgLSAbQT7AOaiFli7DVd/ exCJyZsU6//xBb6fOGTalX4TAh9m6FYE5CXTOmsQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388210AbfEWTLc (ORCPT ); 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)) {