Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4884261pjb; Mon, 27 Jul 2020 07:33:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlrFy/UG5JU8dzcJTJ8mTkcgouH1Ycv4atYlfuqSGoNSMmVxrTZuz6arlfijmeIexVS8O+ X-Received: by 2002:aa7:ce84:: with SMTP id y4mr21851165edv.113.1595860418903; Mon, 27 Jul 2020 07:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860418; cv=none; d=google.com; s=arc-20160816; b=pEMGfOTqCkRqW0gz0XZ/JjFdD7ykmqItJrrw736i9PIQ9IySqtwx3uazrQuHSmesnm er4czIQVpGGCjGGxstYEN5fd/GSeSouGuaR+IF0vJdx4UMZQzYwsOYJpljt8GC05u56J oKV98DYWeEw4wmD0OwzjchjIJTZ8FwOkgjm6ddUzJe+UuitBLW4q56QENb4RymQW5Njx CF/DClE2ptuXDgD68rSYvddchlZiWCAjD9uj7gyUwSnzXeqwI11xsQ5RJInAKRmkWZ66 CEHa7ogaG3ODSAd2ekhN9uCiZ7hEwmQZ+lGjNs6Lu/B+HJs97156YqUs2lW9iG6POTNZ D0Gw== 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=hKDtWyuF3NTs0jQtsrvJqPDiRHAzx1WxuqOexwQXvJw=; b=E+s6mb/NfLsVp7ue+rQzZTmPOzks755O94OfdWyPHb8UecxOMz+EQhuenmiF7oadv5 1e4dOm5QIVgiDlZPfZbtiAs3/aIlVnnRYkEWjmV3q+5ciyQGhU1x5bj3nbAAbB6Zh+XL z5GozQJ0gL5qwYQHjZnTZQrH00/X42OG/k2zcJsuyhMiIMcnRSaDF+osL082jlGUxvHA bCjIJY+CjdHp6XrYff+lGKJWgJMVcVW3pUn73khaFVg6gvELI72F//jXqt3TYdZesnju Lp23ygbi5AAHsAWlB+rSIAH0KHXXAD0EYSh0zhWUmvqgd1R2MtpDpPNIUNk+dk0M98bB YM4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lXhYUJB8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si2426349eje.180.2020.07.27.07.33.16; Mon, 27 Jul 2020 07:33:38 -0700 (PDT) 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=lXhYUJB8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732814AbgG0OcF (ORCPT + 99 others); Mon, 27 Jul 2020 10:32:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:47736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730648AbgG0OTm (ORCPT ); Mon, 27 Jul 2020 10:19:42 -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 B72BD2075A; Mon, 27 Jul 2020 14:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859582; bh=J25/JXUK4b6mmR7U9r7A6ToZsorSLCfD4+2z74cq+Ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lXhYUJB8prtmZ4POyXczz6ACTXrIVD0jzC7PG9Lp/J8AIAd+7W79YJpDtP52pr91c RHDt6/NQhxWDY/Nu/PDn8iHNkE67T19mCZhn4jyUEGFLdGPgGb5OLoj+2TbPterdTs l2kvz1nBY70hKK8xO6cFJO4M8zYA+GJrbJxo1HxY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sungjong Seo , Namjae Jeon Subject: [PATCH 5.7 027/179] exfat: fix overflow issue in exfat_cluster_to_sector() Date: Mon, 27 Jul 2020 16:03:22 +0200 Message-Id: <20200727134933.991795930@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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: Namjae Jeon commit 43946b70494beefe40ec1b2ba4744c0f294d7736 upstream. An overflow issue can occur while calculating sector in exfat_cluster_to_sector(). It needs to cast clus's type to sector_t before left shifting. Fixes: 1acf1a564b60 ("exfat: add in-memory and on-disk structures and headers") Cc: stable@vger.kernel.org # v5.7 Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman --- fs/exfat/exfat_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -375,7 +375,7 @@ static inline bool exfat_is_last_sector_ static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi, unsigned int clus) { - return ((clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) + + return ((sector_t)(clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) + sbi->data_start_sector; }