From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DC17EBA49 for ; Tue, 7 Mar 2023 18:33:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43FFFC433D2; Tue, 7 Mar 2023 18:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678214015; bh=gfRlo4YFg8bSFzFPjhGJLXLES0gbHRs/xxajiyVKsVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KDCJ8oY/HQnQmtf1gWMN3nNXd0r3ZlyI3hki6QACJ1yHTbtk3Tlqkagjbb5+xdjYL v3/wM0GRHs+Zoit+GPRHm7nGqPjSipZ1eMrIYlXXVpWmpbQ7hCSkjcG2FRQukJ6TCO KtxWdC9Awm/YNy2i7GFsntTaSpL13cuo8VDZyy0M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yuezhang Mo , Sungjong Seo , Namjae Jeon Subject: [PATCH 6.1 693/885] exfat: redefine DIR_DELETED as the bad cluster number Date: Tue, 7 Mar 2023 18:00:27 +0100 Message-Id: <20230307170032.210318922@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170001.594919529@linuxfoundation.org> References: <20230307170001.594919529@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Sungjong Seo commit bdaadfd343e3cba49ad0b009ff4b148dad0fa404 upstream. When a file or a directory is deleted, the hint for the cluster of its parent directory in its in-memory inode is set as DIR_DELETED. Therefore, DIR_DELETED must be one of invalid cluster numbers. According to the exFAT specification, a volume can have at most 2^32-11 clusters. However, DIR_DELETED is wrongly defined as 0xFFFF0321, which could be a valid cluster number. To fix it, let's redefine DIR_DELETED as 0xFFFFFFF7, the bad cluster number. Fixes: 1acf1a564b60 ("exfat: add in-memory and on-disk structures and headers") Cc: stable@vger.kernel.org # v5.7+ Reported-by: Yuezhang Mo Signed-off-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 @@ -41,7 +41,7 @@ enum { #define ES_2_ENTRIES 2 #define ES_ALL_ENTRIES 0 -#define DIR_DELETED 0xFFFF0321 +#define DIR_DELETED 0xFFFFFFF7 /* type values */ #define TYPE_UNUSED 0x0000