Message ID | PUZPR04MB6316CCBBA0DD68C90C9333CB810A2@PUZPR04MB6316.apcprd04.prod.outlook.com (mailing list archive) |
---|---|
State | New |
Headers | show
Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DF6B3234 for <linux-fsdevel@vger.kernel.org>; Tue, 31 Dec 2024 04:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=185.183.30.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735620956; cv=fail; b=YjOF6sJsbuRwA70y3cw4J4yL7KrmhOtqSuUZ4cfQ0daohmp2WD6uycIPiLKUvHdIhnusZnsesVWmXZ8VaxNB13MKcnZLK9oyS5tDSgYDRcK/snnk4LOvf/8MXpLAtc/3hktLBzdb8HkS4n/k+ouEdDexP7vJ+m8HocTGywfxk7M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735620956; c=relaxed/simple; bh=ow6+qMMdkCgMeVR88AKX+qatdaFW/nNwvfFwhdNU8to=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=JG1JShrPAqd0BeFt4VMt6ZTEzbMASO1xxzQSJ/M5N7sxIwEQ7f5IXmL3j0oql3fhURr7Gz8v5iqaqQTAR8awdYt9ANpLRxX1KAMK75x3lqtQFkzmEzQq/Ev5HaMWu50aK/OmAnxZWi7AFjAvgx9zQ3fjOf8LXEqdg0sH0M0t360= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=pass smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=pIQjv0kZ; arc=fail smtp.client-ip=185.183.30.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="pIQjv0kZ" Received: from pps.filterd (m0209322.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BV4Vr8A008739; Tue, 31 Dec 2024 04:55:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=cc :content-type:date:from:message-id:mime-version:subject:to; s= S1; bh=8cPUXq2eeykATpwGYeQZPhDgv131AdNM7hf4yHCXQ+U=; b=pIQjv0kZS +iDFMReeFmy1RviQ3JVtGcpHHPsYHM2WBUwfpJxE3XFvphLqP/HEUIhZvDBZVHXI svqPAkpZNir95m0FdoSM5v5WPoiZONVRrsYEDOoqJtWYY2D7Puu4Pp5iKwPkx+Mu goOORmrz+ugC42u1/H0Q5Ient8M7sRnAwOgompoOA8FAAIW8iE+cX5dG3Ts1FTR1 Dgj41CGsqfguCDYE3ZDmrLvGF1E7d/mM/jNqFu0eB150n9Y0TZgD1d3OONwsVWOC KqpThXDBq2Lgk3d/mGVhGYlF+QlCqr94HcY9ysCfMtvVjt0GnpLukK05a2DVoniQ eSyCMazZzDBJA== Received: from seypr02cu001.outbound.protection.outlook.com (mail-koreacentralazlp17013074.outbound.protection.outlook.com [40.93.138.74]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 43t8441nw5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Dec 2024 04:55:41 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KOXdeBCuQjP/wma4MD5vyUedGxECm5qWBD+DM90zhcnY6YWybO2pnOhlY0YdukA5/l2AvbwpWNxxnPNN0AYGF0fFh6afCCLl9jcgqkb3Z/dzAxgI/lxsZolDrGCeiJzYgsTVSq1ampsKwPA3YZAqN15hpAyP5XwhU+3qLW4pS6y1s9PJuFNla/ejET45rIISaRHC0R9bDwsebNKz3kwSxCFAX2uQrIgPCZq8ReuRp1FD9USspD5jehSGjwVvyuWiRDn3mUNQ8/M37dt00Oqr4Hrd2Ugn12z6bgjsBf8mQpU7Qiim3VAFv75u/4yJRElSvDPYLUL4Ivc2we3vSvvpdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=8cPUXq2eeykATpwGYeQZPhDgv131AdNM7hf4yHCXQ+U=; b=ewWLN6ypmtXaW0iaxGNCGwGATRhUvc1nllPlZZpn7LPXEmA65zrfdmOovV2KCIcoGImm8+TPowntlzbLQOpFSkvh4E/8bNWl7wn4ykjqQufQ4w7XsBHN4feR728V/O7wbx+6brkeIiTvVAZsH6j+6aueyurkwKrfpXln7OqQpTYDAeyrweSWxfFoBbRNpZ7fk1+5J5J/L3dSFEpPxkNhWo+dkTLkuDzYemoUyRwkVBhD5f5KjHnty0oP9yb59fyv8rLcieLM6Lus+ueTMoQUUtb12rysqoK8tUsCQviMa9eVv+WpLpAWzn8Oh54lOjY6NYcyVS+XYlCRZ4LDKWCXQA== 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 SEZPR04MB5898.apcprd04.prod.outlook.com (2603:1096:101:7e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.19; Tue, 31 Dec 2024 04:55:30 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::409e:64d3:cee0:7b06]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::409e:64d3:cee0:7b06%4]) with mapi id 15.20.8293.000; Tue, 31 Dec 2024 04:55:30 +0000 From: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com> To: "linkinjeon@kernel.org" <linkinjeon@kernel.org>, "sj1557.seo@samsung.com" <sj1557.seo@samsung.com> CC: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org> Subject: [PATCH v2] exfat: fix the infinite loop in __exfat_free_cluster() Thread-Topic: [PATCH v2] exfat: fix the infinite loop in __exfat_free_cluster() Thread-Index: AQHbWz8bVzA4/x0ZA02mbh+4GV+EAg== Date: Tue, 31 Dec 2024 04:55:30 +0000 Message-ID: <PUZPR04MB6316CCBBA0DD68C90C9333CB810A2@PUZPR04MB6316.apcprd04.prod.outlook.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|SEZPR04MB5898:EE_ x-ms-office365-filtering-correlation-id: c228a0df-c2ea-426f-882c-08dd295759bf x-proofpoint-id: d8690225-876f-412f-87c6-a7cb45557a4c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|10070799003|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?AI9MqKsu4o9wyBv9a+48NwIoX+?= =?iso-8859-1?q?BxY+OAOdF+lXG3m7rG+p1Yd9yddhFK7oDngv5rf6S1aigfy9SkeUjAOprwTl?= =?iso-8859-1?q?qayqhjvJV7HcByEmlTuTHDvACuJ78s7YCRd2qzOYdLzahBRAiUt49uh0yNnf?= =?iso-8859-1?q?o2b2PRBG/ZdYJQHwRKxTE7Uir3jmuYg8ScnmmYyppeU7Jsxuze/aP66RVlE7?= =?iso-8859-1?q?1jf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qxAH9TWZC6n457MVVArid0kiK2rzyRR?= =?iso-8859-1?q?bVboIbxpb9LaXDUv2Sfs34L5A3+RDaqxjeXJql8i/bfP0h3vVrAONOK7/cnh?= =?iso-8859-1?q?JPDZ1XuPIVQZ4+AJ/FXr/aVlse28xlM0SiatAxcQeakf2dCYb5rNodu1PsVa?= =?iso-8859-1?q?VsTi5nnJn3H1kKW2C7JHUiDe8tFpyy7p+ThWWXN63etnmhwSJBm9khCTo+HP?= =?iso-8859-1?q?kBzvu1kud/9ocQzPtwlcqXXSWr6rBFlbVEAB5XIlIHqk3Oi14rLdLWJBiogj?= =?iso-8859-1?q?9FfvBYQ7NfHI+OsVilGg/d0ZSBa4ijk4QNvtpeUhg+2aTXTylyJqkAr4E0+u?= =?iso-8859-1?q?7O?= 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:(13230040)(1800799024)(376014)(10070799003)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?mJPQesBq1c6V6IcuxfhRrBo?= =?iso-8859-1?q?l3Cp61clBE9S2DXcXN01AUim7B5e91kEYUy2F8X1AMQILCFeDwTrPrKOTmF+?= =?iso-8859-1?q?WE6b7Cvm4+CNSX8DVA1KUwxOFOwf0TECdarFYlrQwT4fh9GYJQsBCQUOaXEn?= =?iso-8859-1?q?7nm2u7ubHlZYPpgTwtNdmmttY52btIxvs5D9gseWD99xvZ7FjF7zYTHSRrrq?= =?iso-8859-1?q?OyblEDcgeMmbBYd3oLRw1uGCO8Ox4UmyDKVDzfOr5VZqscpFMA5m65uHP/i8?= =?iso-8859-1?q?Dn33wvfQILDohWkPgz7qeYdCUHgxTvJNe1t3Lrr3Ksr3v7jOH7qla8ZwPR0u?= =?iso-8859-1?q?wBFsBbeFVT7eY8ZAf67FgEVRcM9lzjSXjWH2bdreTuNDi+CJkgkcZZW78Qff?= =?iso-8859-1?q?SBclbrrNv62vLWMK83AF/gkrst9xsEOR1Zzkufc4Okz6Z/UOplGQ6wknoN3Z?= =?iso-8859-1?q?6nA/4FLgy/msd/kQOqG1l7wIx5vPHZlaYhKFCJN4BEHr1MY9En+axpRtF8dJ?= =?iso-8859-1?q?EWoumNY8qfOV75Fzb3hB3qffh3vlyWA+iXBkaScKe+vlIvETOrePmzEPspvj?= =?iso-8859-1?q?dcH5p8wgVNjnlgXImxMKS+cSAGqd34btpOgdYv9Fcx+9YZAufjVMaqmJsNVT?= =?iso-8859-1?q?5PoGLlP2LpMUKk2mpmZ85vWTz21kpOMjzjC20ft/uw0TBrdgpzdRtHJghNkt?= =?iso-8859-1?q?SfQiU9UrDapOH61DbVIVogYk4PcNsEGIkYqoduvMvCkHwR7lGOwyr5NP4PEx?= =?iso-8859-1?q?iTWzF0R5KYhmhMcvuI8d5h+jBw8vQIqmsH4Xn8IP56K0ND8BRD2wyk0r2oWo?= =?iso-8859-1?q?DpUEeacfgG4X/tVwyAzVef/LM2oioN4cY1H3Pj4iKHnc8XaSQHPUOo8jBZZy?= =?iso-8859-1?q?XSZbrAud8Dt1ZcTqnceHg/iTRKnZ39P6eUMcZ2gM5a2Rg1IOzROSxHisD5Ps?= =?iso-8859-1?q?OPXpO3utZfEmgCiFDJTcxCxijPzlIJxvePkiNH1N6bIPAL2l02HmwcIbk3h9?= =?iso-8859-1?q?lCfGkceHmXgqGCo/6qZJccVjltLJfYBEncrFjYyweyAl46kpegQRLZEVzd+6?= =?iso-8859-1?q?r3qDOekrGTT0slfr6bZDJwsWBVtq2LRtHDU53aPBNMp4dIZolJnwg+HBxecI?= =?iso-8859-1?q?l194nMHRrSDah0oryYto6E9VRD5cAFviM+Z2+FWQ/zFMrcgCFJgA+1qUWK14?= =?iso-8859-1?q?Z2u3viTbIurjO1V7wAXEWVp4D/z20HxjOgXS112zvBLxCDocOTc/Dg0+c6gQ?= =?iso-8859-1?q?PwODLWWa6ZAse4hwhyfEt5/olOSVewbS+OziEnJZYUyAKkufQ0ps4Q9531B8?= =?iso-8859-1?q?kz+y0XsM3i5maceHBJ4sZX5pVwqOJf5KlnNqjSprHqFJ/XJ4nS3zBV17cszU?= =?iso-8859-1?q?whwcu1uZXGePfdNSCZmrIeHs2f/e7xx4HTZaLr8sqMB4IRFYFg2omULfSpXk?= =?iso-8859-1?q?TbusOdjc21NqbWELxA7A0va7AQCKnZW7S4lwZkJVu8qmEhN5ekUIu4LfKfGu?= =?iso-8859-1?q?pHAGQVGn7XtVLHVtnixYFziWnPGo/V2pQFs/7LtAIlaUMob42fFB/ZHJDBgH?= =?iso-8859-1?q?BbmTCTalfHT4FHobEsY5Jnr3eAXeVeYyhtBaWhNCpNjFBS7+RSBMF1vYwiuy?= =?iso-8859-1?q?15nNhzK60ailshvjxqiNxRCTMNalzbU+uC/d4K+/w6igvRqJycvF4KEVA9O8?= =?iso-8859-1?q?=3D?= Content-Type: multipart/mixed; boundary="_002_PUZPR04MB6316CCBBA0DD68C90C9333CB810A2PUZPR04MB6316apcp_" Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: <linux-fsdevel.vger.kernel.org> List-Subscribe: <mailto:linux-fsdevel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-fsdevel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: CYLmnAitcAe9HNSVpEJU47K+kUH+WxYBCetbw9v8nWpvaVPdE247w7qt+Hq4xGuCZG6BabaAbr0PuV6N2eRctD6JaWUjOqL8LM0MPtqpvadUBmXOTf1T0n084LPkmv6j+dKzuqyNQLD5NXqMrNv5974mGgHYBFXtVoTVUsacGMJq9iOnmtsWorgA4Po+CpvIyuNIuvNJG9W2yDeeJt2adD47y3pTfdtn7F98CRGHrGWAo5j32zXqbZZ54xL6KTeoZoaDG7BhSDF0xbc/O4o1mL9y9bvHgd9XqBdCYTnF6s6+ARGFRV0XN3K3qc/IFYxJZiemYMx5ZKkrbL2RDeYE0Wuv5ZqIrVaQzg9YDhHVHZ5Z9r71VnDI/8VCo+XixjY0Q1BwqZw8cA8WS/4Le+J2y0Tzd+AEkBL/QJF/mV7vtujMNKNTtF010c9fWX1RDfdCBaX7n5LhpzphnLr2qyVJ8cM/K7dQKTw3pP4PCP1RitlhMdf6S1Uid52RYDm9C1L8wc0gqQ9rGXmwMyJlUNLzTYgZKtJMei5VspM32JlGpupEpYC5WaCrFFGpnkoQ5tNTUxCZoPchHVDbA0ZkP+RZlycdcwYMx0CdPRpd+HEdWnJvWSMTr1OmoG3lUheV4TGz 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: c228a0df-c2ea-426f-882c-08dd295759bf X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Dec 2024 04:55:30.0958 (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: TfSOpotkesWIhwWE3HZ3oMS6JGSXEd7+Lx1X21CwQ2ByWz64TQCmtgzM/tjdi+3Ij8gDEb7gqmFJmjZZ7G0Irw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB5898 X-Proofpoint-GUID: aYPvSrktRop1nZA1yb3FVFkW1cd-ioil X-Proofpoint-ORIG-GUID: aYPvSrktRop1nZA1yb3FVFkW1cd-ioil X-Sony-Outbound-GUID: aYPvSrktRop1nZA1yb3FVFkW1cd-ioil X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-31_01,2024-12-24_01,2024-11-22_01 |
Series |
[v2] exfat: fix the infinite loop in __exfat_free_cluster()
|
expand
|
From 9bd0e9a1fc6f1c56d3c7e9ae6f82fbb18f1bea91 Mon Sep 17 00:00:00 2001 From: Yuezhang Mo <Yuezhang.Mo@sony.com> Date: Mon, 16 Dec 2024 13:39:42 +0800 Subject: [PATCH v2] exfat: fix the infinite loop in __exfat_free_cluster() In __exfat_free_cluster(), the cluster chain is traversed until the EOF cluster. If the cluster chain includes a loop due to file system corruption, the EOF cluster cannot be traversed, resulting in an infinite loop. This commit uses the total number of clusters to prevent this infinite loop. Reported-by: syzbot+1de5a37cb85a2d536330@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=1de5a37cb85a2d536330 Tested-by: syzbot+1de5a37cb85a2d536330@syzkaller.appspotmail.com Fixes: 31023864e67a ("exfat: add fat entry operations") Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> --- fs/exfat/fatent.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index 773c320d68f3..9e5492ac409b 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -216,6 +216,16 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain if (err) goto dec_used_clus; + + if (num_clusters >= sbi->num_clusters - EXFAT_FIRST_CLUSTER) { + /* + * The cluster chain includes a loop, scan the + * bitmap to get the number of used clusters. + */ + exfat_count_used_clusters(sb, &sbi->used_clusters); + + return 0; + } } while (clu != EXFAT_EOF_CLUSTER); } -- 2.43.0