From patchwork Sun Oct 4 18:04:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 267326 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=-12.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 27D03C4363C for ; Sun, 4 Oct 2020 18:04:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4275206DD for ; Sun, 4 Oct 2020 18:04:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="VhN9v/xF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbgJDSEr (ORCPT ); Sun, 4 Oct 2020 14:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgJDSEn (ORCPT ); Sun, 4 Oct 2020 14:04:43 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A546EC0613CE; Sun, 4 Oct 2020 11:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=O+GazgI/0xP6Dkm5fRqJzqqdOxWJi4HKwI9NOqmx0qg=; b=VhN9v/xFPFu2bLILuvb2SViDvn 8txRRfkJZfL9lZ+ezUktQtM07eImKNitiKTlQuVwLt09CSdNjFllQTxWmTQXxeDZmT4oyuFRMwMIu 5v+8lIM3NgNVJ+CqW2DlRuyfdLCV0/tv7e0mks1P9uv8E2dYuwHPr6QubBlWrRmmmJaBanXkNSubO GRvDIiITVSvcWycoFaQypYP0Gc3bGRq0zRFIMFR98JIRBZMcv0640XyFBuId5fUJWXk3qaMIXKdoj idBOaEkkoL7tklgWLdKkMWyqcFTC1cZkPcuvtxfO6m6JdH3kW2HSFuFqDpF5hcsrImENV+lcD47za U+/5T9lQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kP8N5-0003mg-Jf; Sun, 04 Oct 2020 18:04:31 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , 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: [PATCH 3/7] ceph: Promote to unsigned long long before shifting Date: Sun, 4 Oct 2020 19:04:24 +0100 Message-Id: <20201004180428.14494-4-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201004180428.14494-1-willy@infradead.org> References: <20201004180428.14494-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org On 32-bit systems, this shift will overflow for files larger than 4GB. Cc: stable@vger.kernel.org Fixes: 61f68816211e ("ceph: check caps in filemap_fault and page_mkwrite") Signed-off-by: Matthew Wilcox (Oracle) --- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 6ea761c84494..970e5a094035 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1522,7 +1522,7 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf) struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_file_info *fi = vma->vm_file->private_data; struct page *pinned_page = NULL; - loff_t off = vmf->pgoff << PAGE_SHIFT; + loff_t off = (loff_t)vmf->pgoff << PAGE_SHIFT; int want, got, err; sigset_t oldset; vm_fault_t ret = VM_FAULT_SIGBUS;