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 0ECE9131E49 for ; Tue, 23 Sep 2025 06:01:16 +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=1758607277; cv=none; b=cZGFSxnmh04ko+CZ4MWI4ZVPkqUzBHdqcHFeDKUZud5mT6ljUGfG2WDy2H/Kxo6Vmygwb6k+F8TqTNwwGn1bITjlbLCvtOJLBG77wAop5r99M+kVBxEzGcITdcI1vrzmAkIYwkYlM4naAG3qkNxzJzRW2QKBGPGAtMrQD2iacfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758607277; c=relaxed/simple; bh=foG08HutKv+ljMJZ+Dk3dSnL9sC7Hr7nKyk/H7apyhI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hUD3vgijMnrpodt+gvPTX0bt9hKqunNICzkGmbCCaP7bcqH7Zo2fXJOYsE4+343lxGDubiiZUOK+42Qnxlh2JuV1Qh3avBdK/ilVLBGuRCQSp7JezeJtU5+WPeCbjlK1PktodFwDigSvCum95WuH7oAbXL6rxh4Jgn04I8EpVgI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f7sifZ9V; 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="f7sifZ9V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42E21C4CEF5; Tue, 23 Sep 2025 06:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758607276; bh=foG08HutKv+ljMJZ+Dk3dSnL9sC7Hr7nKyk/H7apyhI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=f7sifZ9VIPoQGq/+h1qzAEFP9JcaMvFtzZW41+AUdzwwZHyR+E6a7ZavEjCluj2yg 63jeumrca5D2xSshK62tjzLQpSpzwKQeFiMZpN2XbVzXQXyGf/qMRcwQV88knMJ58N VernkgIBByrBKU2R/FnP7E4ic7jHYgFj+HPUgaNw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39878: ceph: fix crash after fscrypt_encrypt_pagecache_blocks() error Date: Tue, 23 Sep 2025 08:01:09 +0200 Message-ID: <2025092301-CVE-2025-39878-29db@gregkh> X-Mailer: git-send-email 2.51.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=2560; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=MLC7MW7afqeQGUS/QJW6OfkTEoJ8YY+tMIRLbEtmtoE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmXzOc+UtjML/Sx5qzfsRObD1gWl0c/XNldw8xjIHZhk +BtkxLBjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhI6xmGBUctnnVMtU15rLuo UGlqnPL/jtf7NjDMD2pXX2HMfU1RSD9hNtehX3cYdgjuAgA= 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: ceph: fix crash after fscrypt_encrypt_pagecache_blocks() error The function move_dirty_folio_in_page_array() was created by commit ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method") by moving code from ceph_writepages_start() to this function. This new function is supposed to return an error code which is checked by the caller (now ceph_process_folio_batch()), and on error, the caller invokes redirty_page_for_writepage() and then breaks from the loop. However, the refactoring commit has gone wrong, and it by accident, it always returns 0 (= success) because it first NULLs the pointer and then returns PTR_ERR(NULL) which is always 0. This means errors are silently ignored, leaving NULL entries in the page array, which may later crash the kernel. The simple solution is to call PTR_ERR() before clearing the pointer. The Linux kernel CVE team has assigned CVE-2025-39878 to this issue. Affected and fixed versions =========================== Issue introduced in 6.15 with commit ce80b76dd32764cc914975777e058d4fae4f0ea0 and fixed in 6.16.8 with commit dd1616ecbea920d228c56729461ed223cc501425 Issue introduced in 6.15 with commit ce80b76dd32764cc914975777e058d4fae4f0ea0 and fixed in 6.17-rc6 with commit 249e0a47cdb46bb9eae65511c569044bd8698d7d 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-39878 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/ceph/addr.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/dd1616ecbea920d228c56729461ed223cc501425 https://git.kernel.org/stable/c/249e0a47cdb46bb9eae65511c569044bd8698d7d