Message ID | PUZPR04MB63164078AA37CA1A2BCF159881E39@PUZPR04MB6316.apcprd04.prod.outlook.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2595426wrr; Mon, 12 Dec 2022 18:45:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6RVaMuv0vrOkfhU3Z2Y6RmKn5F+SNOHlXv7EwzIKpXfGmGpZ3ROJniipknl764XsInjO1q X-Received: by 2002:a17:903:234e:b0:189:e545:7254 with SMTP id c14-20020a170903234e00b00189e5457254mr24817142plh.23.1670899554875; Mon, 12 Dec 2022 18:45:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670899554; cv=pass; d=google.com; s=arc-20160816; b=EezxeWq4+5XYpJ1uV9hkNAWhQ8mi2j+zxLLZ1g36p6M3eigXpgWNrKEnqvLO3gH993 jfyWAOc3r1WMABHDDVhkdSQs5Z+QnjHlPAJsmTarMPOs1vhFx5qCiy8XZJrJXnrOnLxs 60hbxWtrju9m/4/ZjDJZCBqr+RvvoCHhL3FGRT8unJzMF+p7G7BPFXEHPMBb+6VfU8Gy 1l0y2+7rY1ZeZpzwJB2OD6nhMqMuvELwugrl3BAJln9UR6pbsZN/Swte/6bOTy1USOqK QXdYPOy9M1D7V3SVYBMlMu0idof/FnRv8SxHPtAy8PeDukKNXmUBQ6T0G7qkHbU/u/15 EnHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=dX7eKy0dTsE07ZhSSuBXld0RR7lJHMxB0ctZurNCFAU=; b=I1f33+qogLGfMTULROLxrTYcyRUeGZLja3rbLY6+f7SlAvP5EAjo5PGZrTe5soDk83 6JCxjWMillBgyVZ6yZrX9eCoIXjunUhhxY2R+vphR7JShKBroMRbOHsl8cJ8aw0YbktW pzIQY/fo8CJ1+/g/yCisUl61xiYyqbK7hXNQvTkQNSYRb7gqhusPkybk79MLewgclJf/ E8m5up9IlpHBrTqbZMl4cO1B7rLQ1i5ZYAAngugFLPcIFdqz9vzcUDF76X+aqdq34c+j iRKiPD+ynKtTNfrp6w6c926r1nhPJCRKV+RZnQW26G5gEsc6A91fNbHL8p4tSJoLe6Gi nMjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sony.com header.s=S1 header.b=FbxsyL41; arc=pass (i=1 spf=pass spfdomain=sony.com dkim=pass dkdomain=sony.com dmarc=pass fromdomain=sony.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a170902ec8500b00176db49b734si12099554plg.283.2022.12.12.18.45.41; Mon, 12 Dec 2022 18:45:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sony.com header.s=S1 header.b=FbxsyL41; arc=pass (i=1 spf=pass spfdomain=sony.com dkim=pass dkdomain=sony.com dmarc=pass fromdomain=sony.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234420AbiLMCjS (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Mon, 12 Dec 2022 21:39:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234223AbiLMCiF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 12 Dec 2022 21:38:05 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B531E738; Mon, 12 Dec 2022 18:37:20 -0800 (PST) Received: from pps.filterd (m0209321.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BCMKDks027794; Tue, 13 Dec 2022 02:37:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=S1; bh=dX7eKy0dTsE07ZhSSuBXld0RR7lJHMxB0ctZurNCFAU=; b=FbxsyL41N2R28HmqPGL20hoLYWAFJgqZ0z+jmtFAKSh53JTGOrmrZhlmpOs2IqCwEbq8 EBt/A3XvnynLuBiKmwaQN2T3qNvs1000nfR6Vc+bKtnXnWDhyypK//JKAgZXlOaNIzdn imAst3i42qNEXplqJBS8ebE375riUMOz/zQ3I6NdrnLZbEgTtnsVppkRM4sGO2QoAriu RlIB+WezlZZbKo+I/hpqZmtdkl9tvERZ8DHfH/SFkhvdolJA30QWvrHh6b9VtVX8S3oH WEwq9tE9YyLTWT52hlLPevZFYTNfzTcfosZqNVwsclVRkSNX6RGzVpVgjM9hMMdoQLX5 7A== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2041.outbound.protection.outlook.com [104.47.110.41]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcfh5jkrm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:37:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z1wYk19odN+rFXemGy4gfT9L0pxIpCdYDdcF9lXuVCel4SjhEmwiEnsizeYL3ResUX6pFFe1xb0AQMDOdnAujosmIWd5woXuq5Gf61Q4XGeraIYHoiqAKAWiH2WkgzOrTYfXkodVH1UPfAqrOMmLUN96gKoJ8WcdA5oRs+Jnf5yinyhh/P+/EkXf99NF2dxZZJAp7Bmzy+g4yUgJntHMli0RHHcwWANHvAsCCcuka31T8lFIOktKiC6vpwNyByQm/FsHmR5nShFyHy5YrXbxhHZU1QGb2a+PHVvLFFdPMb54NbV7qUYMnS60HoHH6MZ5dOnIOU9uzERSulCEPmGRrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dX7eKy0dTsE07ZhSSuBXld0RR7lJHMxB0ctZurNCFAU=; b=ZkBfW1X+UwKJmag+wQb6Vi1Q4RQGtzyrYQChXb4bAA08Jpk19ZwgUenbs1sHZ7HxctTL6U9OgB/AHofA0qI5Np9pib5Vjrd4YrRUkgDhW4SYwMpMy7pKFFFEZ3Z3FP0VkiC1L0uUztckmrWubYsTjrK6ckGSTRstyn+ICLEkEw4A/QMDhcelr84+0bboKKe3GSYYJZnXGTl/6NYfWMqbN8QMrRadVzCaVihpGBormN+o6fFwWB0Q9hpIdaTslkbInWVLJkOmJ+qjEDqg9L0oS0LgF86Z5b5fTsDDLRd5KCLPd7dsAyJ2HkLNU2UoHVUkFWXZy9WboIbb9FZ4xw2z3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sony.com; dmarc=pass action=none header.from=sony.com; dkim=pass header.d=sony.com; arc=none Received: from PUZPR04MB6316.apcprd04.prod.outlook.com (2603:1096:301:fc::7) by SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:37:08 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:37:08 +0000 From: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com> To: "sj1557.seo@samsung.com" <sj1557.seo@samsung.com>, "linkinjeon@kernel.org" <linkinjeon@kernel.org> CC: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "Andy.Wu@sony.com" <Andy.Wu@sony.com>, "Wataru.Aoyama@sony.com" <Wataru.Aoyama@sony.com> Subject: [PATCH v2 6/7] exfat: fix overflow in sector and cluster conversion Thread-Topic: [PATCH v2 6/7] exfat: fix overflow in sector and cluster conversion Thread-Index: AdkOmq99zRXgAzKURlGtnFNFRSw9uw== Date: Tue, 13 Dec 2022 02:37:08 +0000 Message-ID: <PUZPR04MB63164078AA37CA1A2BCF159881E39@PUZPR04MB6316.apcprd04.prod.outlook.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: 19179749-d7d1-4ee6-67fa-08dadcb2ee6d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xV0+uieF5v8PRmrYxBy0BQBlONZZQZSoaHnwCCLNt4akPTV/5snZDntH5tWg79CAJt67w6PycHVbXXlxEvy+bpf3idh87HKa0orS2YUAlINyjLSYK1Dl+PewEqpegpTpObcOsrhpYH9w7JypbFOhVNeB7j2BC+9Q0dCeCu3vl0j6cIXAyfrt+JwiRNCmP4q1fqjERtkQbfgwaXE9dn3uxpbHrKAl5T40ZydG8LiveyZoLesIWt6VIrhpu6Ke+HcDf6+qJlcCHrWAiUxahl18S1oXZqJi6z0EGUFqOpLZBHELa7HSS3bPqLu8UMjs6iu2el/WK/64n8KlaD4Bmlxz0OK6mi3Uzhe4EL8dmVy6ATjXow2aC51043AxS81JSgVpDWuBODE9liJyM0/yUGsqy88wbxUR155lTd2ETQEvdNUmugmps43k7XkQg+E10qUBvGyLycRhG9RwBTNrEbnGQVkGcRKx/aclFnH/CItYLjsYlcY2KgP5yDbGy2gnYrBMHbHf/yQrXGXdps/W11Yfrj3X/YgWCDnZSbI4TZi4gYheewo3LYFnzxkbhLFAdYwBvSgZ6J47cf1K7xTnXViMhPIF+LW+mXgeOtFhebTAHI6KiArlWCFaGJFVaB5uRsyTSsD/BhuXPPy4T1ct9r5I8p7lajYHmh80i3Jn6mFFOLE6Zx+n004FfRwAYIM28CdaaIM6gi8rWEZvpU4OnrQzXA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(136003)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(4744005)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?wUTcpPO7Tmmai1R25KUyi7noDV5Y?= =?utf-8?q?Dj+NbXawo/oIciXX8gyoonArbB9IMdlXNqZAokhP9Rcz96gKfoyDd4k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BbCByqdSAtqYEdqfTB?= =?utf-8?q?+77WEcffwE6jZUwFrdVp06m4F7kthck6X7k9GJjJ5823jO2Jp2+jBFeWKgnESOgO2?= =?utf-8?q?sFh5/WKae6f1DVNjXKEP7zLlLehdaCuPl7sVAbnGDlJav9p5iuoyC+OcGjeM/oS2u?= =?utf-8?q?+W/rrDsG929WgZZQHPUjK1jkEVOYZNJ7tCyjfn0chab9uQMOrv7CLYZjvTEN1AB30?= =?utf-8?q?iUj6Wwj8Hn8L7btMPYr32aEvqhkcDH41Z57eSkF1x4B4Qsrzbq+RtTxb6nJjOTjD4?= =?utf-8?q?KDn7bQlTloqGgJvp/Zljfc0FH3FjJIw5TKZVI6dlPjVlqx5DhV7BZMwBBV4JESC+i?= =?utf-8?q?CeaXPyuy7Ya/4fUw19QUBO/bbf7SregE2kiB/vT6CpLrEjTyJSolJ6bMZS7utbr1O?= =?utf-8?q?dnQgjcI9WYlX2fC2cbnTJ0HvmRLLucnamulDlvU+f4okDXj1y1CR262Je5XUn1Rft?= =?utf-8?q?Jz+XXvIKbgBJwt10ac2m42SAqIQGIT6B0mv001YtX9Q8W0YwasQlHIEmjcxK+7/0E?= =?utf-8?q?f7upO6/Hc8BgbvH7XUMxzJcHqPqSLhBPVDDBqrW2N12U2BipJAzsbBUfT9Qy00759?= =?utf-8?q?7EhNFA5PPTPh?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: sony.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR04MB6316.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19179749-d7d1-4ee6-67fa-08dadcb2ee6d X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:37:08.8314 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 66c65d8a-9158-4521-a2d8-664963db48e4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: x8u5wvgYu+shyrJUsAajRF9hkbeGh6Dd3W1X59OQYRHrb73zvzwGRXQeVnJU6r6B3Xexs32PvO7eesRwi3hxhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-GUID: XtaIQHyZnd5pB90RAIzf9e0mPBAdMhpd X-Proofpoint-ORIG-GUID: XtaIQHyZnd5pB90RAIzf9e0mPBAdMhpd X-Sony-Outbound-GUID: XtaIQHyZnd5pB90RAIzf9e0mPBAdMhpd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-12_02,2022-12-12_02,2022-06-22_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752065171738205491?= X-GMAIL-MSGID: =?utf-8?q?1752065171738205491?= |
Series |
[v2,1/7] exfat: remove call ilog2() from exfat_readdir()
|
|
Commit Message
Yuezhang.Mo@sony.com
Dec. 13, 2022, 2:37 a.m. UTC
According to the exFAT specification, there are at most 2^32-11
clusters in a volume. so using 'int' is not enough for cluster
index, the return value type of exfat_sector_to_cluster() should
be 'unsigned int'.
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
---
fs/exfat/exfat_fs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.25.1
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index a1e7feb22079..bc6d21d7c5ad 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -400,7 +400,7 @@ static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi, sbi->data_start_sector; } -static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi, +static inline unsigned int exfat_sector_to_cluster(struct exfat_sb_info *sbi, sector_t sec) { return ((sec - sbi->data_start_sector) >> sbi->sect_per_clus_bits) +