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 8F56C143891 for ; Tue, 21 May 2024 15:07:35 +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=1716304055; cv=none; b=O6HP4fgDa6ml7GFsX297v52P8lXodzhM7epo9EvqZK/aBcLX9mWGgJ+mzDRS1HXX2jxkFj55PWtcfqsRIhaj3NwqG80a4xrCc7HqeqgbFWSygbHcJWGO2vUYzUgpqtMsle7sFqrSrvkEGcwJWxlwQRfJaTgMdAhbvF8dQmRqGC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716304055; c=relaxed/simple; bh=8QMC76wqgM74r+B2ud3mODP9nXOkJVaWY0nf3olWA3g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=P9qWPEOBMkBGnqk36AZp1ZO+GstkG3YPCoYpj6zmdB5pMxLy+iVHG5XA1oaEl4RWfiFa98H+lm1jPvvzjB7ZctRKFRTqg4MDqz+9V/UsL/DcvkSLBEmjbGor3vrH4atDrpXz6xEcOrW+lkl2dZlt2LS1KIyFKQMI2VV1dKmndg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bjJjFvZu; 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="bjJjFvZu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8D36C2BD11; Tue, 21 May 2024 15:07:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716304055; bh=8QMC76wqgM74r+B2ud3mODP9nXOkJVaWY0nf3olWA3g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=bjJjFvZuYj2yU5jM4eaUO/6W3qums6D0RVa84Vp7wBX+CGS5xgCoOHtsR7LVo8Rdl wZLUf86Ne2WOcY2jyL69KP2c28XEIXdxP7fLKYSUd9itU9u+X0hXcwlT8g3l5xuTSq xu80PC6DRLQx+9qpvJUO4JbFzNgqXJ9Nday1EV9k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47406: ext4: add error checking to ext4_ext_replay_set_iblocks() Date: Tue, 21 May 2024 17:04:23 +0200 Message-ID: <2024052150-CVE-2021-47406-04e3@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=3085; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=8QMC76wqgM74r+B2ud3mODP9nXOkJVaWY0nf3olWA3g=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+26/7MCbdOPxuGser/RVzrNbMrp9Re/hVxLrzp8Kvn m+cZTb/VUcsC4MgE4OsmCLLl208R/dXHFL0MrQ9DTOHlQlkCAMXpwBMRLeRYcGyd91W+49urDVh DZUx4sv//3T+TmeGBQuc3woZcjztfrosPbaEZ5eyloOlEAA= 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: ext4: add error checking to ext4_ext_replay_set_iblocks() If the call to ext4_map_blocks() fails due to an corrupted file system, ext4_ext_replay_set_iblocks() can get stuck in an infinite loop. This could be reproduced by running generic/526 with a file system that has inline_data and fast_commit enabled. The system will repeatedly log to the console: EXT4-fs warning (device dm-3): ext4_block_to_path:105: block 1074800922 > max in inode 131076 and the stack that it gets stuck in is: ext4_block_to_path+0xe3/0x130 ext4_ind_map_blocks+0x93/0x690 ext4_map_blocks+0x100/0x660 skip_hole+0x47/0x70 ext4_ext_replay_set_iblocks+0x223/0x440 ext4_fc_replay_inode+0x29e/0x3b0 ext4_fc_replay+0x278/0x550 do_one_pass+0x646/0xc10 jbd2_journal_recover+0x14a/0x270 jbd2_journal_load+0xc4/0x150 ext4_load_journal+0x1f3/0x490 ext4_fill_super+0x22d4/0x2c00 With this patch, generic/526 still fails, but system is no longer locking up in a tight loop. It's likely the root casue is that fast_commit replay is corrupting file systems with inline_data, and we probably need to add better error handling in the fast commit replay code path beyond what is done here, which essentially just breaks the infinite loop without reporting the to the higher levels of the code. The Linux kernel CVE team has assigned CVE-2021-47406 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 8016e29f4362 and fixed in 5.10.71 with commit a63474dbf692 Issue introduced in 5.10 with commit 8016e29f4362 and fixed in 5.14.10 with commit 27e10c5d31ff Issue introduced in 5.10 with commit 8016e29f4362 and fixed in 5.15 with commit 1fd95c05d8f7 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-47406 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/ext4/extents.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/a63474dbf692dd09b50fed592bc41f6de5f102fc https://git.kernel.org/stable/c/27e10c5d31ff1d222c7f797f1ee96d422859ba67 https://git.kernel.org/stable/c/1fd95c05d8f742abfe906620780aee4dbe1a2db0