Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp823370pxb; Tue, 3 Nov 2020 13:33:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvzriDbs/HZ82YBDmphQ9fD/ZPasOvODeFD+L8M30UZSKHKfvC2T15HLr0puhZns/WF1zb X-Received: by 2002:a50:fc89:: with SMTP id f9mr13948860edq.89.1604439232735; Tue, 03 Nov 2020 13:33:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439232; cv=none; d=google.com; s=arc-20160816; b=NBhfP5e+iI22davEmKG6FYrWP+7U0LjvJ4yEFEahD8lbl8cnpyqXsnsv0LMXXqlC8M LAYcDYDQjvJiZNJnYZiJhWBXn5GPvAmScnlfg/dGASlVJRsGPC6onV8goSO/c7QqNbUj gaRA1jbjGgjI/0Iqiorh7WY3CYN5utrpp0fBHCrwTb7OXq6xLBxyxBK4fwdkjGxAlqwD YT01tXuIfGGcMTnytRM4/BUJeK4Set44zyL7UMj050aWlCnmZ4jBfHnFmVbRU3CQo56k aV/qudbR0oaqsp7L0pV2MirH4+Hd+I7ecNbc/Qq6boDDpiO6SfK2quNLcmj4e5kM9ZIP ME2g== 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=zIZ9of4IhpvVVmKCXQG4ur96weWjTsL8ef/qqC/DC7A=; b=ZDqlO1IGGL01uarBG+M50hVoh7263SsKObFdXw84PQOk8rBBOxislGY71dJ0EWnc2r jS4VvxzN68q77zT4jAegNV7gkc/fSaX/TKLNJSahZfwnOTGS0FLLiZCfxQTK/zA/bR3G UEDi5NE/ul3/Zjo8p3z3g5+QKG0r2W09OoJW1knYgoU2ffzoPxm7BZCf1ymWp0vXsd7H TXGz5c4dlB6bdAzgJuUepnIuKAwG+6iLGZoxhSc5MnTE0YK2Hn5NDDLks/bmU9P7+nxK IHPrV0PICwfegEGSjMKn9DzdBs3F+Cle3yv4EtNATaoLywa6BG78zCHzsyctvjqmHW4z hdXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tmI7Q/iE"; 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 h22si76317eje.314.2020.11.03.13.33.29; Tue, 03 Nov 2020 13:33:52 -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="tmI7Q/iE"; 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 S1733205AbgKCV3B (ORCPT + 99 others); Tue, 3 Nov 2020 16:29:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:35408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733167AbgKCU75 (ORCPT ); Tue, 3 Nov 2020 15:59:57 -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 A7A9522226; Tue, 3 Nov 2020 20:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437197; bh=PhZiF3/f8TONGTYt4osYsdHZsjC/HvsaoqTj5qrAW6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tmI7Q/iE8bfb9GdiuiGJoEIEYf+YZCDx4Euxi8eG1GTghz2+YJLIgST3Go8GhiOfB 0l2iD7rSfYQek+csW67Vph8yKqYQblQyJ7+QRDbYvISoQSOc+KnmMlJCDvDousnZxV ppONBEnTRr+1/jbZ5ouqivsTAdfEut4icgGlV8zI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Matthew Wilcox (Oracle)" , Jeff Layton , Ilya Dryomov Subject: [PATCH 5.4 187/214] ceph: promote to unsigned long long before shifting Date: Tue, 3 Nov 2020 21:37:15 +0100 Message-Id: <20201103203308.219605906@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 c403c3a2fbe24d4ed33e10cabad048583ebd4edf upstream. 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) Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Greg Kroah-Hartman --- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1427,7 +1427,7 @@ static vm_fault_t ceph_filemap_fault(str 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;