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 86ECAC138 for ; Wed, 22 May 2024 08:20:21 +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=1716366021; cv=none; b=Uj22OYOTgOCXwCYk+Mp8h3XSW9P5kgDW0EwVQ1HRxmv9U/4SEwArUKZFukfu8krs0moETpLU/zgeMmfMCKeM1uJK9jDWhN/xA9fhCZE7smeV3zDDEJLPd5KP0CELzIrHQrb5Qr+zXjxHiM6FyD+k3vr8U0B/bCFvlhMAcHvP65w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716366021; c=relaxed/simple; bh=SQcY+LOUmDXIbSvdTNletQBWE8PasurD7IkkzUwE/qU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mfZamnMsTBsOzakTZ0LjC29Rfwj4d8wia8L9l8XEEWqe97Q49B+gtMJJS9HgkCpE1jM/NKO6Hi57vXjnOx+dtYt7BdvQbZIEi0xDAS62IMR8hEK1ujG2QztIMsU6o8cT4xHXchO0Zf/SvlLDqRzTukoGmxSWcPGhj011ygjWUbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KOH3rNMV; 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="KOH3rNMV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A651EC2BD11; Wed, 22 May 2024 08:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716366021; bh=SQcY+LOUmDXIbSvdTNletQBWE8PasurD7IkkzUwE/qU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=KOH3rNMVFGWm7JXbPEOloWqdW+Wsin/Em5aexoZgKeCrQylZmMpfTcmbuacUAlDZa 6eSdCC+6hwRv/CrWscDAfc//xuxV/y4ZZAS0G5PJd9EVtORj1ApgFXvoauWQXCOgrD tinG7fnbPEb6o+eEVZWHJr4Tlww9kXoQYF9d9Jbc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47493: ocfs2: fix race between searching chunks and release journal_head from buffer_head Date: Wed, 22 May 2024 10:19:53 +0200 Message-ID: <2024052241-CVE-2021-47493-24fb@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=3035; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=SQcY+LOUmDXIbSvdTNletQBWE8PasurD7IkkzUwE/qU=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm+q+bWqYfdYJWfIO8Z2LvYvudXf5LR95oWzhPdBeHzp s3iOyfaEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNZosqw4KYXp84dqdSwpYdO zFXW2aS8s0F8G8OCyY3fxUKzQ5g0ln51CdcrWKwuqCcJAA== 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: ocfs2: fix race between searching chunks and release journal_head from buffer_head Encountered a race between ocfs2_test_bg_bit_allocatable() and jbd2_journal_put_journal_head() resulting in the below vmcore. PID: 106879 TASK: ffff880244ba9c00 CPU: 2 COMMAND: "loop3" Call trace: panic oops_end no_context __bad_area_nosemaphore bad_area_nosemaphore __do_page_fault do_page_fault page_fault [exception RIP: ocfs2_block_group_find_clear_bits+316] ocfs2_block_group_find_clear_bits [ocfs2] ocfs2_cluster_group_search [ocfs2] ocfs2_search_chain [ocfs2] ocfs2_claim_suballoc_bits [ocfs2] __ocfs2_claim_clusters [ocfs2] ocfs2_claim_clusters [ocfs2] ocfs2_local_alloc_slide_window [ocfs2] ocfs2_reserve_local_alloc_bits [ocfs2] ocfs2_reserve_clusters_with_limit [ocfs2] ocfs2_reserve_clusters [ocfs2] ocfs2_lock_refcount_allocators [ocfs2] ocfs2_make_clusters_writable [ocfs2] ocfs2_replace_cow [ocfs2] ocfs2_refcount_cow [ocfs2] ocfs2_file_write_iter [ocfs2] lo_rw_aio loop_queue_work kthread_worker_fn kthread ret_from_fork When ocfs2_test_bg_bit_allocatable() called bh2jh(bg_bh), the bg_bh->b_private NULL as jbd2_journal_put_journal_head() raced and released the jounal head from the buffer head. Needed to take bit lock for the bit 'BH_JournalHead' to fix this race. The Linux kernel CVE team has assigned CVE-2021-47493 to this issue. Affected and fixed versions =========================== Fixed in 5.10.77 with commit 5043fbd294f5 Fixed in 5.14.16 with commit 2e382600e885 Fixed in 5.15 with commit 6f1b228529ae 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-2021-47493 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/ocfs2/suballoc.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/5043fbd294f5909a080ade0f04b70a4da9e122b7 https://git.kernel.org/stable/c/2e382600e8856ea654677b5134ee66e03ea72bc2 https://git.kernel.org/stable/c/6f1b228529ae49b0f85ab89bcdb6c365df401558