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 E3DF74C97 for ; Sat, 17 Aug 2024 09:12:18 +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=1723885939; cv=none; b=p8p0ujvENm12SCziWQHKpopKHWAXjwmHyU39AKA4h2hkq4M+JnCYv4hPXJFWOstG9AOOK4ff7qdpc6Hp96EBCYoHGYAW4hbXMNnphwl0HI/A33qJKvJtKPpkfW1LTE5l/NkivzDrflu1UtP91pRZ4i+OtrMCBmhG1Zadj2+mR40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723885939; c=relaxed/simple; bh=LQ1pwQZgEJ+aMn6DFecQmfk/1cWofzMds6Ht6wENs1k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ClbXu44JY1Mxs2wjG23RnZzEVdX64woIZLtXc/LC4WJxDirZOHNWjAloLUfXmSxHkanFzzSrBhcUMVDA4WiPO+UD2UQxfKWAQJUwdMMLbX4/pBa1QDDw07WNqsldZJ5Xk9aztZ5GcqZ6KqKRLF6nlC3kyfygj9kwTQFTYt28/MA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=z8PlkFRH; 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="z8PlkFRH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59236C116B1; Sat, 17 Aug 2024 09:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723885938; bh=LQ1pwQZgEJ+aMn6DFecQmfk/1cWofzMds6Ht6wENs1k=; h=From:To:Cc:Subject:Date:Reply-to:From; b=z8PlkFRH6Ta/xuLCZQF3P+8VKrAcuANdIN5i4LzvUlOlIv5lOU5T9Cc5p8XzlrQy6 Bb67knk1+P7C7bIlwdCM71aftD0/yves82HpsTrxlnlpnQ/7C6e+iDoFLXTRvUKNpn sT18m8zmGTKOL7FCEHYoZqyEbVb7on7af8xGw4ZM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-42304: ext4: make sure the first directory block is not a hole Date: Sat, 17 Aug 2024 11:10:09 +0200 Message-ID: <2024081749-CVE-2024-42304-d0e4@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=3204; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=LQ1pwQZgEJ+aMn6DFecQmfk/1cWofzMds6Ht6wENs1k=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkHMu6tflJ1sj4wffVTUzZPCWEfxxtLn2rKNymW79i4Q qjzveCKjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI7RcM8/OkdV+2CKy0W8Cn pcmSO3OGLOecswxzZeymvz13Ty1mQfLT579uhOm0XdbjBAA= 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: make sure the first directory block is not a hole The syzbot constructs a directory that has no dirblock but is non-inline, i.e. the first directory block is a hole. And no errors are reported when creating files in this directory in the following flow. ext4_mknod ... ext4_add_entry // Read block 0 ext4_read_dirblock(dir, block, DIRENT) bh = ext4_bread(NULL, inode, block, 0) if (!bh && (type == INDEX || type == DIRENT_HTREE)) // The first directory block is a hole // But type == DIRENT, so no error is reported. After that, we get a directory block without '.' and '..' but with a valid dentry. This may cause some code that relies on dot or dotdot (such as make_indexed_dir()) to crash. Therefore when ext4_read_dirblock() finds that the first directory block is a hole report that the filesystem is corrupted and return an error to avoid loading corrupted data from disk causing something bad. The Linux kernel CVE team has assigned CVE-2024-42304 to this issue. Affected and fixed versions =========================== Issue introduced in 5.3 with commit 4e19d6b65fb4 and fixed in 6.1.103 with commit b609753cbbd3 Issue introduced in 5.3 with commit 4e19d6b65fb4 and fixed in 6.6.44 with commit c3893d9de8ee Issue introduced in 5.3 with commit 4e19d6b65fb4 and fixed in 6.10.3 with commit 299bc6ffa57e Issue introduced in 5.3 with commit 4e19d6b65fb4 and fixed in 6.11-rc1 with commit f9ca51596bbf Issue introduced in 4.9.187 with commit 3f0307b0d2d8 Issue introduced in 4.14.135 with commit 514631c2225c Issue introduced in 4.19.62 with commit 3a17ca864baf Issue introduced in 5.1.21 with commit 7f1f86276515 Issue introduced in 5.2.4 with commit 5021b7a5bdd6 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-42304 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/namei.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/b609753cbbd38f8c0affd4956c0af178348523ac https://git.kernel.org/stable/c/c3893d9de8ee153baac56d127d844103488133b5 https://git.kernel.org/stable/c/299bc6ffa57e04e74c6cce866d6c0741fb4897a1 https://git.kernel.org/stable/c/f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6