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 03DF456B6C for ; Fri, 17 May 2024 14:02:02 +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=1715954523; cv=none; b=Cjri4nKoyAgwsFbAfTylruOaN+eYHEMxYPF9hP63a6ER/ljp5jp+w/LX/v8x3+qDHfuhd8bOobv0MkNv3IEEOe7SNJcXjAsn2Pa4lGbjcWCLvgqhIshFK5ZxJWAJUlhQENt86qdow9dSpCII7mRgifgwcEpi518tfDvZeBW1m9g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715954523; c=relaxed/simple; bh=9bsNhiWfv2ZP2ZaYhvw8n9jZpN5XVeagMxMdsykKN98=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iL//f95BZrmar1zg9b7klMpJSK6UzrH8nCLdfcNxoSp5jhaXKLEoKWOhux12vXXN63kO5YD467gYQjIbzgeF2ImaLQm2+g3MOIc3tkem7+/xc2DwzyVJdoDBRHo8d1tO0i+b04KxN4JcfE6vyT7n3UiqjY26SN8aRTmQkK6lHqI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kWYPOogX; 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="kWYPOogX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FBAAC2BD11; Fri, 17 May 2024 14:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715954522; bh=9bsNhiWfv2ZP2ZaYhvw8n9jZpN5XVeagMxMdsykKN98=; h=From:To:Cc:Subject:Date:Reply-to:From; b=kWYPOogXLv5oAZl8oXdgwZiWRI4Iy7kb9Bqsri1bdlx0HddgJ9A2QZ5BLEtboivhK RLXvq8KH9samiHdL3v6SDdoa/Vm9x5KoCsVcUVVPztHK80A/9mFhovSkz327PM54Zw /63DRynB2pK+VCQaucwkq7cbACZHbYVauPiAYRFo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52668: btrfs: zoned: fix lock ordering in btrfs_zone_activate() Date: Fri, 17 May 2024 16:01:29 +0200 Message-ID: <2024051728-CVE-2023-52668-4da2@gregkh> X-Mailer: git-send-email 2.45.1 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=2825; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9bsNhiWfv2ZP2ZaYhvw8n9jZpN5XVeagMxMdsykKN98=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnuyRbLJ6ac2zmjKPjhgyX3nm4UNprLxv39x8aDeu3Lz 9n86EmZ3RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATKfjHMD/Xa87e7NUBlqd9 ly56xF+f2XH0XT3DguU9shu3q02r1nmr7mKzbvu8T/Zc2gA= 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: btrfs: zoned: fix lock ordering in btrfs_zone_activate() The btrfs CI reported a lockdep warning as follows by running generic generic/129. WARNING: possible circular locking dependency detected 6.7.0-rc5+ #1 Not tainted ------------------------------------------------------ kworker/u5:5/793427 is trying to acquire lock: ffff88813256d028 (&cache->lock){+.+.}-{2:2}, at: btrfs_zone_finish_one_bg+0x5e/0x130 but task is already holding lock: ffff88810a23a318 (&fs_info->zone_active_bgs_lock){+.+.}-{2:2}, at: btrfs_zone_finish_one_bg+0x34/0x130 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&fs_info->zone_active_bgs_lock){+.+.}-{2:2}: ... -> #0 (&cache->lock){+.+.}-{2:2}: ... This is because we take fs_info->zone_active_bgs_lock after a block_group's lock in btrfs_zone_activate() while doing the opposite in other places. Fix the issue by expanding the fs_info->zone_active_bgs_lock's critical section and taking it before a block_group's lock. The Linux kernel CVE team has assigned CVE-2023-52668 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit a7e1ac7bdc5a and fixed in 6.6.15 with commit 6f74989f5909 Issue introduced in 6.6 with commit a7e1ac7bdc5a and fixed in 6.7.3 with commit 1908e9d01e53 Issue introduced in 6.6 with commit a7e1ac7bdc5a and fixed in 6.8 with commit b18f3b60b35a 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-2023-52668 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/btrfs/zoned.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/6f74989f5909cdec9b1274641f0fa306b15bb476 https://git.kernel.org/stable/c/1908e9d01e5395adff68d9d308a0fb15337e6272 https://git.kernel.org/stable/c/b18f3b60b35a8c01c9a2a0f0d6424c6d73971dc3