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 767B42153FB for ; Fri, 22 Aug 2025 16:02:06 +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=1755878526; cv=none; b=iBeVzg5i0xs4hJqczsVsfrU/RkcrdJKdEPyesWFjkibxqbOLy87Wbdds93RI3+6/xsQEvzoqiuuhPl9DVVgNWyamxIo1P9+01obVbXZSnwB2a6RmeMCk3OYMRdzOWa1AjAs8SYMOSWbyem8T6jBvxkU9vPcXX3qBVsi/XUs8bRo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755878526; c=relaxed/simple; bh=uBqPPDpUCdQfID9Jc0LY0PU/sqPYZXRu06Ju8wa2rjM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OhuBbUcAc9R2SI0d12PiE6neOOrICQPE6Bk518RRiGDrDFAHvp9O4AVfYiVshhh6Y7Rxcu8GtHSce6ldIVJZXNAH2sThq5rXVzf83RW3NK2MDHCb/tVYR5vY5qh0kDaQY0yNXZUy01owIcjbIFbAhLeLgl81BGlNBwuzKeaGHn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tTjacEgy; 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="tTjacEgy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAC17C4CEED; Fri, 22 Aug 2025 16:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755878526; bh=uBqPPDpUCdQfID9Jc0LY0PU/sqPYZXRu06Ju8wa2rjM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=tTjacEgyxqGKcXr6dTSbVYaKhKREDCLAB/Z+neJsTZxA0YKANBOilGc2jByBP46Y/ /HrlCNu9D6tI6Fpmfx/3pwdpgl1AIqDaK6ZrRSSVJ0GSBzJVIxLN1pBcHlXC4IrMtU AkKt7soDg/V/bFpoImdM6kh0wVhCNEdmxblqVEKE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38627: f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic Date: Fri, 22 Aug 2025 18:00:36 +0200 Message-ID: <2025082231-CVE-2025-38627-7cb6@gregkh> X-Mailer: git-send-email 2.50.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=3365; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=V89oPoynug19U9d6dtoOfcYKPf31j1DOQjiZJ0GWaLU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkrpsh/3DH/QHJCertSl2mb/VqbVkX3vQGpieuPFJ5Jf F5q7Di7I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbSupJhwdbsWpUZMcr/9s+/ xRFddlcrjMk7hGHBeY1D3T7a3A7btF8Irzz2geG7aosWAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic The decompress_io_ctx may be released asynchronously after I/O completion. If this file is deleted immediately after read, and the kworker of processing post_read_wq has not been executed yet due to high workloads, It is possible that the inode(f2fs_inode_info) is evicted and freed before it is used f2fs_free_dic. The UAF case as below: Thread A Thread B - f2fs_decompress_end_io - f2fs_put_dic - queue_work add free_dic work to post_read_wq - do_unlink - iput - evict - call_rcu This file is deleted after read. Thread C kworker to process post_read_wq - rcu_do_batch - f2fs_free_inode - kmem_cache_free inode is freed by rcu - process_scheduled_works - f2fs_late_free_dic - f2fs_free_dic - f2fs_release_decomp_mem read (dic->inode)->i_compress_algorithm This patch store compress_algorithm and sbi in dic to avoid inode UAF. In addition, the previous solution is deprecated in [1] may cause system hang. [1] https://lore.kernel.org/all/c36ab955-c8db-4a8b-a9d0-f07b5f426c3f@kernel.org The Linux kernel CVE team has assigned CVE-2025-38627 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit bff139b49d9f70c1ac5384aac94554846aa834de and fixed in 6.16.1 with commit 8fae5b6addd5f6895e03797b56e3c7b9f9cd15c9 Issue introduced in 6.0 with commit bff139b49d9f70c1ac5384aac94554846aa834de and fixed in 6.17-rc1 with commit 39868685c2a94a70762bc6d77dc81d781d05bff5 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-2025-38627 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/compress.c fs/f2fs/f2fs.h 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/8fae5b6addd5f6895e03797b56e3c7b9f9cd15c9 https://git.kernel.org/stable/c/39868685c2a94a70762bc6d77dc81d781d05bff5