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 033F21F4FAF for ; Mon, 21 Oct 2024 18:02:59 +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=1729533780; cv=none; b=TqEoIcq8L3yPCe8jzhVmef0k/S8Z5COHv4U9Mz00WyQ+4asfi+Klou3ryqGKIZWPiTCgfu5JZfIb9AqbN3I3o/+i1dVjOTEc0j/s6jJX9oDyJuTmNPurXDRSq4uObci9B0w8HmMypzvzo28q5foAqlyz75xj+HooQWMTC1mHu0g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729533780; c=relaxed/simple; bh=13SbZGc23rHUEf6w9RWKbZt+r3bE05Id0ViYV6jtVBI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Zp7IwGBw+eThf3JvNxUp5C9RXmcA+SYTDfiJBHR/2G/qBfCInW5eDlBPcJdqyoQwuvgd0bkMnopTAFe/i5GHceaEGmqOQzNFaFTKKDEFAYV483/EL1OAUOqsnAJ7KhAAsII5wjTtRjJ0xiJVbMmUXKzhpeJKm0ZVAvFEfi1UfJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TnQmJVms; 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="TnQmJVms" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77A55C4CEE5; Mon, 21 Oct 2024 18:02:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729533779; bh=13SbZGc23rHUEf6w9RWKbZt+r3bE05Id0ViYV6jtVBI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=TnQmJVmsiMNS9gdu8MDJfabYLlxq/jf22wPAkIXimCHSS9+s9nd5WCea0P9oxwFr8 UdCQ03xZr56FQb2VTV99PF61zvBlabMheW6a/7J2TMMf5Izjj3HbiW8vejN1O31O/S baFRYYDC4iVVmyiOzQTKvNeEeIxuTB5TeoH9Jcvw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49889: ext4: avoid use-after-free in ext4_ext_show_leaf() Date: Mon, 21 Oct 2024 20:01:37 +0200 Message-ID: <2024102117-CVE-2024-49889-6140@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=2991; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=13SbZGc23rHUEf6w9RWKbZt+r3bE05Id0ViYV6jtVBI=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli095t++BaPTGc77vURylBvW25POy3wy9UdsxgcovSk L+u9OdiRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzk4FyGBTfSlcUE879dCr4w Nb/71vqbq4Jz1RjmyhWmFcx/4bzicvKiqfUFXy5wfbuhCgA= 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: avoid use-after-free in ext4_ext_show_leaf() In ext4_find_extent(), path may be freed by error or be reallocated, so using a previously saved *ppath may have been freed and thus may trigger use-after-free, as follows: ext4_split_extent path = *ppath; ext4_split_extent_at(ppath) path = ext4_find_extent(ppath) ext4_split_extent_at(ppath) // ext4_find_extent fails to free path // but zeroout succeeds ext4_ext_show_leaf(inode, path) eh = path[depth].p_hdr // path use-after-free !!! Similar to ext4_split_extent_at(), we use *ppath directly as an input to ext4_ext_show_leaf(). Fix a spelling error by the way. Same problem in ext4_ext_handle_unwritten_extents(). Since 'path' is only used in ext4_ext_show_leaf(), remove 'path' and use *ppath directly. This issue is triggered only when EXT_DEBUG is defined and therefore does not affect functionality. The Linux kernel CVE team has assigned CVE-2024-49889 to this issue. Affected and fixed versions =========================== Fixed in 5.10.227 with commit b0cb4561fc42 Fixed in 5.15.168 with commit 4999fed877bb Fixed in 6.1.113 with commit 2eba3b0cc5b8 Fixed in 6.6.55 with commit 34b2096380ba Fixed in 6.10.14 with commit 8b114f2cc7dd Fixed in 6.11.3 with commit d483c7cc1796 Fixed in 6.12-rc1 with commit 4e2524ba2ca5 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-49889 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/b0cb4561fc4284d04e69c8a66c8504928ab2484e https://git.kernel.org/stable/c/4999fed877bb64e3e7f9ab9996de2ca983c41928 https://git.kernel.org/stable/c/2eba3b0cc5b8de624918d21f32b5b8db59a90b39 https://git.kernel.org/stable/c/34b2096380ba475771971a778a478661a791aa15 https://git.kernel.org/stable/c/8b114f2cc7dd5d36729d040b68432fbd0f0a8868 https://git.kernel.org/stable/c/d483c7cc1796bd6a80e7b3a8fd494996260f6b67 https://git.kernel.org/stable/c/4e2524ba2ca5f54bdbb9e5153bea00421ef653f5