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 383394C97 for ; Sat, 17 Aug 2024 09:12:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723885976; cv=none; b=D4kqDFAlVWv3ycJUKiMS17P11DHk14fnRmv4Br58wMRlWfx07+YQpIMKYY+VGtKQPqVm+cqe/UVPRTFm4I5YwKGa0GnH7wzZrotDRvoqOofkpU3L0a23OxTzPo164ygTWB96APKMWsriZ4JdYkTaaANki3OJr5GKC5G8QgS/Y6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723885976; c=relaxed/simple; bh=YKbrKIwoikytmPBGbzA1f+p8V8yIlnZDPA0z14b5DCU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=s2GPPt4/nKvjdbCfHQyhn/Frs52PtlGkXyx5bF2OxEOXWlWLvzO49LGLwjW6t2PU8R7CRtGGg8brnaeNi6hRbYlXCAulxh4M5hUgoDrBq3iDGIXB3vNoQvTPTU1rrIvVjMUeoGQorqi+JSFaVlSOAsJF3IbkAW+vogGGElnf10Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J23hFA+F; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="J23hFA+F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC56BC116B1; Sat, 17 Aug 2024 09:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723885976; bh=YKbrKIwoikytmPBGbzA1f+p8V8yIlnZDPA0z14b5DCU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=J23hFA+FEnt9zIDfZYvmehd7FKlqsukGGHqeH80WXTxt/WtfuQNrMRiV2ac0VWCxA BnGameXLmIOvqWnI/+c7gPtkVI4uTyTBTP76VpTdkmYQASY1E3wRHw48SW5GYihKiT +TH84r+RGXvoZ7dI0BIS7JyugxIqGA3EeR6DFA1A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-42315: exfat: fix potential deadlock on __exfat_get_dentry_set Date: Sat, 17 Aug 2024 11:10:20 +0200 Message-ID: <2024081753-CVE-2024-42315-a707@gregkh> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2855; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=YKbrKIwoikytmPBGbzA1f+p8V8yIlnZDPA0z14b5DCU=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkHMh7qKz5lPq7CoWpfpLvNfwnb6RS5l1tCN/zZeuHtl qOJh4wmdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE/v5nmO8/W1d7ybuWyHVz Q9gv7uMTMDDpL2WYZxE5cfpUlTcz3BqzS5se5344takrHAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: exfat: fix potential deadlock on __exfat_get_dentry_set When accessing a file with more entries than ES_MAX_ENTRY_NUM, the bh-array is allocated in __exfat_get_entry_set. The problem is that the bh-array is allocated with GFP_KERNEL. It does not make sense. In the following cases, a deadlock for sbi->s_lock between the two processes may occur. CPU0 CPU1 ---- ---- kswapd balance_pgdat lock(fs_reclaim) exfat_iterate lock(&sbi->s_lock) exfat_readdir exfat_get_uniname_from_ext_entry exfat_get_dentry_set __exfat_get_dentry_set kmalloc_array ... lock(fs_reclaim) ... evict exfat_evict_inode lock(&sbi->s_lock) To fix this, let's allocate bh-array with GFP_NOFS. The Linux kernel CVE team has assigned CVE-2024-42315 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit a3ff29a95fde and fixed in 6.6.44 with commit a7ac198f8dba Issue introduced in 6.2 with commit a3ff29a95fde and fixed in 6.10.3 with commit 1d1970493c28 Issue introduced in 6.2 with commit a3ff29a95fde and fixed in 6.11-rc1 with commit 89fc548767a2 Issue introduced in 5.10.190 with commit bd3bdb9e0d65 Issue introduced in 5.15.150 with commit 92dcd7d6c606 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-42315 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/exfat/dir.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/a7ac198f8dba791e3144c4da48a5a9b95773ee4b https://git.kernel.org/stable/c/1d1970493c289e3f44b9ec847ed26a5dbdf56a62 https://git.kernel.org/stable/c/89fc548767a2155231128cb98726d6d2ea1256c9