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 4B71A1991AE for ; Mon, 21 Oct 2024 18:07:28 +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=1729534048; cv=none; b=cteYou3YikasA85VG/WYxJeJbRnwA6E7SbuProE1a50kbzPOEXckn4X54GuaED591Q6HaknRCIH13EPrDpWVJGyW8ByqgZwJwMweZhXbEswbrsVEckIOXvp13wwutt1ExMh9fMCQwI02QHHawqxf3ugTdDt32xDjCQsfT0FZPT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729534048; c=relaxed/simple; bh=Fq8kW4MShkr6ohJxiBEjvwJ6blyk0SDF8wldE6uCzv4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VrQRRhsmP/nFqK387hSXpUXfNwf/4tfTmkpCLHhEhDNXFTl2Rgzm5lnsEmX/VIoWvoNCwYmfJLUHKLdaMxp+Js4fC9ZZ8OttYS6UMJOn7wZTcV+lRxkB8EvsuyrYQW5RswMz8GHpSux5biH6wHRdomI5QyvCsSU0/sNKdsH40/A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qDhKye3m; 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="qDhKye3m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC033C4CEC3; Mon, 21 Oct 2024 18:07:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729534048; bh=Fq8kW4MShkr6ohJxiBEjvwJ6blyk0SDF8wldE6uCzv4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=qDhKye3mG2wcIE1lqd45Y/lrBVl39nsNuXqZqzPvnGFrixfDeR+N9+UYh9jFGxQdO aVD3kF1lTMieV/YITo5OPXPx2jdctXnTdh7P9bawZX63M5QpPRTl+AAYcCh22YaR5S o1Cz51QJvfr4xh1Xj9eafQ6XTfud/Z/gM143Alro= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49957: ocfs2: fix null-ptr-deref when journal load failed. Date: Mon, 21 Oct 2024 20:02:45 +0200 Message-ID: <2024102131-CVE-2024-49957-3302@gregkh> X-Mailer: git-send-email 2.47.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=3108; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Fq8kW4MShkr6ohJxiBEjvwJ6blyk0SDF8wldE6uCzv4=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli03577txjMefwX3YbsblvQg6lTv16PkT/zZUDj/+69 5R6CcjWdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEnjkyzE+fOy36wVGHmhN7 YxV8t159pcLw/zDDXOEDEZct7ONEvX7O0w4/fMq4Ke/9NQA= 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 null-ptr-deref when journal load failed. During the mounting process, if journal_reset() fails because of too short journal, then lead to jbd2_journal_load() fails with NULL j_sb_buffer. Subsequently, ocfs2_journal_shutdown() calls jbd2_journal_flush()->jbd2_cleanup_journal_tail()-> __jbd2_update_log_tail()->jbd2_journal_update_sb_log_tail() ->lock_buffer(journal->j_sb_buffer), resulting in a null-pointer dereference error. To resolve this issue, we should check the JBD2_LOADED flag to ensure the journal was properly loaded. Additionally, use journal instead of osb->journal directly to simplify the code. The Linux kernel CVE team has assigned CVE-2024-49957 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.32 with commit f6f50e28f0cb and fixed in 5.10.227 with commit bf605ae98dab Issue introduced in 2.6.32 with commit f6f50e28f0cb and fixed in 5.15.168 with commit ff55291fb367 Issue introduced in 2.6.32 with commit f6f50e28f0cb and fixed in 6.1.113 with commit 82dfdd1e31e7 Issue introduced in 2.6.32 with commit f6f50e28f0cb and fixed in 6.6.55 with commit 86a89e75e9e4 Issue introduced in 2.6.32 with commit f6f50e28f0cb and fixed in 6.10.14 with commit f60e94a83db7 Issue introduced in 2.6.32 with commit f6f50e28f0cb and fixed in 6.11.3 with commit 387bf565cc03 Issue introduced in 2.6.32 with commit f6f50e28f0cb and fixed in 6.12-rc1 with commit 5784d9fcfd43 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-49957 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/journal.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/bf605ae98dab5c15c5b631d4d7f88898cb41b649 https://git.kernel.org/stable/c/ff55291fb36779819211b596da703389135f5b05 https://git.kernel.org/stable/c/82dfdd1e31e774578f76ce6dc90c834f96403a0f https://git.kernel.org/stable/c/86a89e75e9e4dfa768b97db466ad6bedf2e7ea5b https://git.kernel.org/stable/c/f60e94a83db799bde625ac8671a5b4a6354e7120 https://git.kernel.org/stable/c/387bf565cc03e2e8c720b8b4798efea4aacb6962 https://git.kernel.org/stable/c/5784d9fcfd43bd853654bb80c87ef293b9e8e80a