From mboxrd@z Thu Jan 1 00:00:00 1970 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 73645446B4 for ; Tue, 21 May 2024 15:38:36 +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=1716305916; cv=none; b=Q7XQxDMl46wagnu6N82xYkZfPIcRhNiTdQnvFFMrPk7M8V5LaS1uNrwbtcQwKqpOdqspz5OMt+T6tgSTnJUNWWqR/w7Hwk2GbWj+yhnxakumfdJ3Rq5y9cghyZRAT207yqyB/ovUWI+TMZa3Lxu3gWYqGhGEiYTVtEMAZjid0R0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305916; c=relaxed/simple; bh=LZs852/rl/y6wpFulGHl65XcYq/XyADC15kAshsTCZs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jL7chSACTEoWjtOhLsG988eBSVqRFib5ers6bN+NPsx0ufdlWmwQHbg5v360xTJ6j3Ms7WD9o9IGrBrx+kr9s3QdGO1GCcofxv0mXfWgPx2fiT3vD/loFe7Ld34h+HNEVWQXnC89iqacMa0MwHokkXN/HoVGXC82K3v96nlvk7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=q1oIGpq+; 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="q1oIGpq+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF229C32786; Tue, 21 May 2024 15:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716305916; bh=LZs852/rl/y6wpFulGHl65XcYq/XyADC15kAshsTCZs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=q1oIGpq+n4xkRGvAaLmBdq+DdqR11Sh98UDiUc3hId4PUGXeo7UWhF5XchvAcwf39 slDsxdB/MuzK8fhhqWdcCCquj7xPdnFARrU2rZ3MObMR8Q3YBkHeE9fIqAycgBdUtd 6yewjDymwJcFiQ/bofEC0X1jVxYPQGYUuNFiAq4w= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52852: f2fs: compress: fix to avoid use-after-free on dic Date: Tue, 21 May 2024 17:32:28 +0200 Message-ID: <2024052114-CVE-2023-52852-e55a@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=2887; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=LZs852/rl/y6wpFulGHl65XcYq/XyADC15kAshsTCZs=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk++5yfcVpstWvrrA5rZC1QExL53LjtdpujCdvs5fJN5 X9m2B/viGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgInw3GWYK8Y7k3PJleoJlpK/ 3AIbqxTZ22PsGea7MwRrbTMU99b5/dbBP+aS7M7O/WYA 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: f2fs: compress: fix to avoid use-after-free on dic Call trace: __memcpy+0x128/0x250 f2fs_read_multi_pages+0x940/0xf7c f2fs_mpage_readpages+0x5a8/0x624 f2fs_readahead+0x5c/0x110 page_cache_ra_unbounded+0x1b8/0x590 do_sync_mmap_readahead+0x1dc/0x2e4 filemap_fault+0x254/0xa8c f2fs_filemap_fault+0x2c/0x104 __do_fault+0x7c/0x238 do_handle_mm_fault+0x11bc/0x2d14 do_mem_abort+0x3a8/0x1004 el0_da+0x3c/0xa0 el0t_64_sync_handler+0xc4/0xec el0t_64_sync+0x1b4/0x1b8 In f2fs_read_multi_pages(), once f2fs_decompress_cluster() was called if we hit cached page in compress_inode's cache, dic may be released, it needs break the loop rather than continuing it, in order to avoid accessing invalid dic pointer. The Linux kernel CVE team has assigned CVE-2023-52852 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 6ce19aff0b8c and fixed in 5.15.139 with commit 8c4504cc0c64 Issue introduced in 5.14 with commit 6ce19aff0b8c and fixed in 6.1.63 with commit 9375ea7f2690 Issue introduced in 5.14 with commit 6ce19aff0b8c and fixed in 6.5.12 with commit 932ddb5c29e8 Issue introduced in 5.14 with commit 6ce19aff0b8c and fixed in 6.6.2 with commit 9d065aa52b6e Issue introduced in 5.14 with commit 6ce19aff0b8c and fixed in 6.7 with commit b0327c84e91a Issue introduced in 5.13.19 with commit a23706426da9 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-2023-52852 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/f2fs/data.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/8c4504cc0c64862740a6acb301e0cfa59580dbc5 https://git.kernel.org/stable/c/9375ea7f269093d7c884857ae1f47633a91f429c https://git.kernel.org/stable/c/932ddb5c29e884cc6fac20417ece72ba4a35c401 https://git.kernel.org/stable/c/9d065aa52b6ee1b06f9c4eca881c9b4425a12ba2 https://git.kernel.org/stable/c/b0327c84e91a0f4f0abced8cb83ec86a7083f086