Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 37EF7494A08 for ; Fri, 25 Sep 2026 10:33:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790332389; cv=none; b=Ov12QHcXpWvsrw4/NnrX3akFpV5t4iGKyZBcT2VCpQLJs8TAu5jdJPxmhSsHhT2ITsMyKvEACbeJoJWRkTG/uKbJciaAZ9QbzUhHrgNO8grvIOnjwLq4A8GUybZg41dE3Jd86e4bfrDgGc8TbDwchTmQyXrACATUpF6Nzi2lds8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790332389; c=relaxed/simple; bh=DVsovm+vsx1PsZvy0oyi40bPCeGTHIAKlDFvtEhY+dw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=F24VCDsunrCQrYCh938wzr5LvENyJ17vG6NbQY7fnSI2f6fbt4WIWE8xxkVQyCj7jozITavmOu6vOXNmfh4VJ0QYUFvdHWXJoAz4hnqowaB1Uv+MhlMg0lZ0ZNFZ+mlIxFt1jdrxrV5oJYWdlefFLXud+eemvjmk6V08P9D1sew= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dkvSff6i; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dkvSff6i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A5301F000FF; Fri, 25 Sep 2026 10:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790332388; bh=bGt47EL1VjQ6aGVFZd+odrhkvYTrzzEEilIkOAtdGoE=; h=From:To:Cc:Subject:Date:Reply-To; b=dkvSff6ixDePwMMcjVGlTH+fjarWIk/Goj/E2Rkm7Lfw+M1hwmcXRN9XQlXEazFfl x9TMo6PSO+wtDpFSnmv/LtMV8ks/dpElvhNnzsx7/FsdCMOHAXppGLv5ja5xYFB07W X2HOxWTeYDSMNlKMXbR+AmXXi0BXfYr49cyPMp6M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-97992: vhost-vdpa: protect config_ctx from being freed under the config callback Date: Fri, 25 Sep 2026 12:24:55 +0200 Message-ID: <2026092521-CVE-2026-97992-3c3d@gregkh> X-Mailer: git-send-email 2.55.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=4887; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=zm8ZG2KMU+kYv6itasH3l+NjOIcL77UXZaJfquo/rTo=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnbvGPPf9jgd2JqRHJ1VnBzS7lc68W72fMyd3e8kwzI/ 71Z69f6jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjINVuGBXst3pSvuTyx6DNT htrKNjk38b/lnxgWzPgYNV/11JfWqb/Y3N33cOXOEdy/FgA= 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: vhost-vdpa: protect config_ctx from being freed under the config callback vhost_vdpa_config_cb() loads v->config_ctx and signals it without taking a reference and without holding any lock: struct eventfd_ctx *config_ctx = v->config_ctx; if (config_ctx) eventfd_signal(config_ctx); VHOST_VDPA_SET_CONFIG_CALL replaces that field and drops what is normally the last reference to the old context: swap(ctx, v->config_ctx); if (ctx) eventfd_ctx_put(ctx); eventfd_ctx_put() drops the last kref and frees the context immediately, with no RCU grace period, so a callback that has already loaded the pointer goes on to dereference freed memory. The two sides share no lock: the ioctl runs under vhost_dev.mutex, while the parent invokes the callback from its own interrupt or workqueue context. This is not the reopen refcount underflow fixed by commit f6bbf0010ba0 ("vhost-vdpa: fix use-after-free of v->config_ctx"), which was about vhost_vdpa_config_put() leaving a stale pointer behind. Here the pointer is maintained correctly and it is the read side that is unprotected. With VDUSE as the parent this is reachable from userspace with access to /dev/vduse (root by default). VDUSE_DEV_INJECT_CONFIG_IRQ queues dev->inject, and vduse_dev_irq_inject() runs the callback under VDUSE's own dev->irq_lock, which vhost does not hold. vduse_dev_reset() does flush_work(&dev->inject), but VHOST_VDPA_SET_CONFIG_CALL never goes through reset, so an inject already in flight is not waited for. A process that injects config interrupts on the VDUSE fd while another thread swaps the call fd on the vhost-vdpa fd hits it in seconds: BUG: KASAN: slab-use-after-free in native_queued_spin_lock_slowpath Read of size 4 at addr ffff888107d21808 by task kworker/u17:1/2993 Workqueue: vduse-irq vduse_dev_irq_inject Call Trace: native_queued_spin_lock_slowpath+0x97/0x5b0 _raw_spin_lock_irqsave+0xd4/0xe0 eventfd_signal_mask+0x69/0x120 vhost_vdpa_config_cb+0x34/0x50 vduse_dev_irq_inject+0x46/0x60 process_one_work+0x468/0x950 Allocated by task 2992: do_eventfd+0x50/0x200 __x64_sys_eventfd2+0x2e/0x40 Freed by task 2992: eventfd_ctx_put+0xb9/0xc0 vhost_vdpa_unlocked_ioctl+0x116c/0x2190 Add a spinlock covering every access to config_ctx, so the callback either signals a context that is still alive or observes NULL, and the put happens only once no callback can reach the old value. Clearing the parent's callback before the put would not be enough: of the in-tree set_config_cb() implementations only VDUSE takes a lock, the rest store the pointer unlocked, so that would not order against an in-flight invocation. The Linux kernel CVE team has assigned CVE-2026-97992 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 776f395004d829bbbf18c159ed9beb517a208c71 and fixed in 6.12.111 with commit bf35c8948ab7a3eaf1f724fa1e870e3f73a1749b Issue introduced in 5.8 with commit 776f395004d829bbbf18c159ed9beb517a208c71 and fixed in 6.18.53 with commit 5a075ee2398929d5cc1393666f219c35332becb1 Issue introduced in 5.8 with commit 776f395004d829bbbf18c159ed9beb517a208c71 and fixed in 7.2.7 with commit f4a93f15ed1c8406ba5c8e5b28cafacb2b3bcd11 Issue introduced in 5.8 with commit 776f395004d829bbbf18c159ed9beb517a208c71 and fixed in 7.3-rc3 with commit 62be4e3e5f5f947fbf765b914cebdc478f715d12 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-2026-97992 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: drivers/vhost/vdpa.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/bf35c8948ab7a3eaf1f724fa1e870e3f73a1749b https://git.kernel.org/stable/c/5a075ee2398929d5cc1393666f219c35332becb1 https://git.kernel.org/stable/c/f4a93f15ed1c8406ba5c8e5b28cafacb2b3bcd11 https://git.kernel.org/stable/c/62be4e3e5f5f947fbf765b914cebdc478f715d12