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 62C5E156678 for ; Thu, 1 May 2025 13:09: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=1746104958; cv=none; b=meS+Nd1+8G2XyUh/EKV5Yxy7d8fJhT3MsEtT/hqDeuI59xRL4z/KLaTwSeQ8sSDegKeOoVQrHJfMRH50a/8wPv/lgHtWVGqMDpRdiHbz3o0aqFVL5+yQVKxfGH+UJXeO0QxLqbofMa4TS6yfHere5wAfvl8+B8/rU/4hVlOpTDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746104958; c=relaxed/simple; bh=0/3nncj+ogAZAPTehehA7VoEuYd2sN6/n6LXwXwyW0c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ReP48yjqzmimxoMVym4b7WAYqbM1CofZenHHl0MVocphJj1fKy6MJaGIklFIb4VmUqLva5sWePms/ZifZ5x5UGvhVN1hUEr3XGcU4B12NgIGErZt5vRg0hWj0/OJ+d5p3sRZDGzaPv24fN3WHqEdqDKn6OTkcNa39X+wqY1zMXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HDnyC5iq; 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="HDnyC5iq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DE8FC4CEE4; Thu, 1 May 2025 13:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746104957; bh=0/3nncj+ogAZAPTehehA7VoEuYd2sN6/n6LXwXwyW0c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HDnyC5iq4xoM2yiksGRnL1ZkUURPWgFiYpPRSPi+w9EYp9Dz4LWD/amqtiKbkMcGg oRqTuOMC2LwPvZlT2tQttf84xmGnXted5VSpu1RH3x1fKG7T4yOWvGwURv6T0oX50t NYNu3BDIbKdSQh8N/Pc52eXdneq8hZCywFRPpvho= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37779: lib/iov_iter: fix to increase non slab folio refcount Date: Thu, 1 May 2025 15:07:27 +0200 Message-ID: <2025050116-CVE-2025-37779-6bed@gregkh> X-Mailer: git-send-email 2.49.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=3734; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JarOp4/UIcxzCmZDe+vGNe69z/CgBdZL+1LFGo2/Ulk=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCRSxWL+38g78aV5ZbbjLinzzng/mNCaZhLW+umkSW+ GYyGR7qiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIm0KTHML2SWUbH4/a48Icpl x5awQLtKyUX6DPOsHmY/0H80xS7oJrNb8/KVj7OcEwwB 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: lib/iov_iter: fix to increase non slab folio refcount When testing EROFS file-backed mount over v9fs on qemu, I encountered a folio UAF issue. The page sanity check reports the following call trace. The root cause is that pages in bvec are coalesced across a folio bounary. The refcount of all non-slab folios should be increased to ensure p9_releas_pages can put them correctly. BUG: Bad page state in process md5sum pfn:18300 page: refcount:0 mapcount:0 mapping:00000000d5ad8e4e index:0x60 pfn:0x18300 head: order:0 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 aops:z_erofs_aops ino:30b0f dentry name(?):"GoogleExtServicesCn.apk" flags: 0x100000000000041(locked|head|node=0|zone=1) raw: 0100000000000041 dead000000000100 dead000000000122 ffff888014b13bd0 raw: 0000000000000060 0000000000000020 00000000ffffffff 0000000000000000 head: 0100000000000041 dead000000000100 dead000000000122 ffff888014b13bd0 head: 0000000000000060 0000000000000020 00000000ffffffff 0000000000000000 head: 0100000000000000 0000000000000000 ffffffffffffffff 0000000000000000 head: 0000000000000010 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set Call Trace: dump_stack_lvl+0x53/0x70 bad_page+0xd4/0x220 __free_pages_ok+0x76d/0xf30 __folio_put+0x230/0x320 p9_release_pages+0x179/0x1f0 p9_virtio_zc_request+0xa2a/0x1230 p9_client_zc_rpc.constprop.0+0x247/0x700 p9_client_read_once+0x34d/0x810 p9_client_read+0xf3/0x150 v9fs_issue_read+0x111/0x360 netfs_unbuffered_read_iter_locked+0x927/0x1390 netfs_unbuffered_read_iter+0xa2/0xe0 vfs_iocb_iter_read+0x2c7/0x460 erofs_fileio_rq_submit+0x46b/0x5b0 z_erofs_runqueue+0x1203/0x21e0 z_erofs_readahead+0x579/0x8b0 read_pages+0x19f/0xa70 page_cache_ra_order+0x4ad/0xb80 filemap_readahead.isra.0+0xe7/0x150 filemap_get_pages+0x7aa/0x1890 filemap_read+0x320/0xc80 vfs_read+0x6c6/0xa30 ksys_read+0xf9/0x1c0 do_syscall_64+0x9e/0x1a0 entry_SYSCALL_64_after_hwframe+0x71/0x79 The Linux kernel CVE team has assigned CVE-2025-37779 to this issue. Affected and fixed versions =========================== Issue introduced in 6.14 with commit b9c0e49abfca06f1a109acea834bcfc934f33f76 and fixed in 6.14.4 with commit d833f21162c4d536d729628f8cf1ee8d4110f2b7 Issue introduced in 6.14 with commit b9c0e49abfca06f1a109acea834bcfc934f33f76 and fixed in 6.15-rc3 with commit 770c8d55c42868239c748a3ebc57c9e37755f842 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-37779 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: lib/iov_iter.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/d833f21162c4d536d729628f8cf1ee8d4110f2b7 https://git.kernel.org/stable/c/770c8d55c42868239c748a3ebc57c9e37755f842