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 5F8FE2FB612 for ; Tue, 13 Jan 2026 15:31:07 +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=1768318267; cv=none; b=lNOXJ9w5rwR6nN1B8fBPdiQbMgTRQu2WYTBHWkKnl1a48QFyalDm3CVBNQLh+hJOvbGDUW11Q2pL+ra9s4nvcPCi1DLv4BIWCO8hq9f0bf4spyFqsvatPBGvLosvDXuCMvzuC+YSvttXtLmO3mU9DMBSMUwrmRfpMRyT00J4eVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768318267; c=relaxed/simple; bh=thxdQKAlzsvtTBhvN0bxHgQO7shI5yiDI98PCqQ226k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NYwK26cVVpnyobHzRakSms7P5uFFMWVrOD8RjgT+haI+YJZL8gUo9WsREw+LYNbUP3nXbIQA2ymaxENzS64AlYt4Adf3QNrtdSa6+MrMYqH7O8CkI/CcXI/qKxOhcNL76VB1dT9ws2jaF0FBW1uj2PIg+fPwm0uFIQEE/rmUZCQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yXZ0Ariv; 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="yXZ0Ariv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AD76C116C6; Tue, 13 Jan 2026 15:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768318266; bh=thxdQKAlzsvtTBhvN0bxHgQO7shI5yiDI98PCqQ226k=; h=From:To:Cc:Subject:Date:Reply-To:From; b=yXZ0ArivPsRrPpccEcvdD2Ltdb+VrIfQ7HVPxWtZhxwV5BeI/2Lf7T6tByMwHjVhT qbR2L3gLYCP24uQTUpJQL9Yb+s1Aez3FMxCs1NDlmbtL/Ni+nDN05mnoB7z8tSWs7G nWK9tAnsOcVITpBpMXyFvi8K8D2p4nuqrU89OV6M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-68810: KVM: Disallow toggling KVM_MEM_GUEST_MEMFD on an existing memslot Date: Tue, 13 Jan 2026 16:29:36 +0100 Message-ID: <2026011311-CVE-2025-68810-308a@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4228; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=iO3GiyELfA59hlYjCP7KFxaxYkpuuEUinJ8awkIbpno=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlpKceZP5VGmlpFJc+Y5jinUDPH2dTz17pHE1S2rknbH czxiae9I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbyq5VhwcZJfCWZpW9DO1+u 3yO5QvTvm5XtPgzz/bqlRDfbtyonLOIWUn7Eop4YUjIdAA== 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: KVM: Disallow toggling KVM_MEM_GUEST_MEMFD on an existing memslot Reject attempts to disable KVM_MEM_GUEST_MEMFD on a memslot that was initially created with a guest_memfd binding, as KVM doesn't support toggling KVM_MEM_GUEST_MEMFD on existing memslots. KVM prevents enabling KVM_MEM_GUEST_MEMFD, but doesn't prevent clearing the flag. Failure to reject the new memslot results in a use-after-free due to KVM not unbinding from the guest_memfd instance. Unbinding on a FLAGS_ONLY change is easy enough, and can/will be done as a hardening measure (in anticipation of KVM supporting dirty logging on guest_memfd at some point), but fixing the use-after-free would only address the immediate symptom. ================================================================== BUG: KASAN: slab-use-after-free in kvm_gmem_release+0x362/0x400 [kvm] Write of size 8 at addr ffff8881111ae908 by task repro/745 CPU: 7 UID: 1000 PID: 745 Comm: repro Not tainted 6.18.0-rc6-115d5de2eef3-next-kasan #3 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: dump_stack_lvl+0x51/0x60 print_report+0xcb/0x5c0 kasan_report+0xb4/0xe0 kvm_gmem_release+0x362/0x400 [kvm] __fput+0x2fa/0x9d0 task_work_run+0x12c/0x200 do_exit+0x6ae/0x2100 do_group_exit+0xa8/0x230 __x64_sys_exit_group+0x3a/0x50 x64_sys_call+0x737/0x740 do_syscall_64+0x5b/0x900 entry_SYSCALL_64_after_hwframe+0x4b/0x53 RIP: 0033:0x7f581f2eac31 Allocated by task 745 on cpu 6 at 9.746971s: kasan_save_stack+0x20/0x40 kasan_save_track+0x13/0x50 __kasan_kmalloc+0x77/0x90 kvm_set_memory_region.part.0+0x652/0x1110 [kvm] kvm_vm_ioctl+0x14b0/0x3290 [kvm] __x64_sys_ioctl+0x129/0x1a0 do_syscall_64+0x5b/0x900 entry_SYSCALL_64_after_hwframe+0x4b/0x53 Freed by task 745 on cpu 6 at 9.747467s: kasan_save_stack+0x20/0x40 kasan_save_track+0x13/0x50 __kasan_save_free_info+0x37/0x50 __kasan_slab_free+0x3b/0x60 kfree+0xf5/0x440 kvm_set_memslot+0x3c2/0x1160 [kvm] kvm_set_memory_region.part.0+0x86a/0x1110 [kvm] kvm_vm_ioctl+0x14b0/0x3290 [kvm] __x64_sys_ioctl+0x129/0x1a0 do_syscall_64+0x5b/0x900 entry_SYSCALL_64_after_hwframe+0x4b/0x53 The Linux kernel CVE team has assigned CVE-2025-68810 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit a7800aa80ea4d5356b8474c2302812e9d4926fa6 and fixed in 6.12.64 with commit 89dbbe6ff323fc34659621a577fe0af913f47386 Issue introduced in 6.8 with commit a7800aa80ea4d5356b8474c2302812e9d4926fa6 and fixed in 6.18.3 with commit cb51bef465d8ec60a968507330e01020e35dc127 Issue introduced in 6.8 with commit a7800aa80ea4d5356b8474c2302812e9d4926fa6 and fixed in 6.19-rc2 with commit 9935df5333aa503a18de5071f53762b65c783c4c 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-68810 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: virt/kvm/kvm_main.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/89dbbe6ff323fc34659621a577fe0af913f47386 https://git.kernel.org/stable/c/cb51bef465d8ec60a968507330e01020e35dc127 https://git.kernel.org/stable/c/9935df5333aa503a18de5071f53762b65c783c4c