From mboxrd@z Thu Jan 1 00:00:00 1970 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 C533D48987E for ; Fri, 25 Sep 2026 10:34:14 +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=1790332456; cv=none; b=KmnHgKX8uwruaP5O+UP2CS8jguiQiQUic1xXB9AW/2fpxiigOTYaU7Ctad2XrQBAc0bLSDeLuzGVH65zRReuXDUEGso62AduDxyE8LS3vG5ySe5IYI2mzvszzXAJhmQrAntFcjrFVhfflgeskF4P8WLKXjahc2pxurDAHR3C2nw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790332456; c=relaxed/simple; bh=zcYXWTwGJQ+Iru4/QW+5Ynju7wEKRxLrjFAYG/zl6JM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UyW1X47ipYo+a6WoRnpk4TpsHhcfA14sQU+eJNxKCA/V4Up99FI0Ecvh8bKiVscfTl4fVTAWl85+VWLdDNSJGiq49BA7GpiUOMdGTt4Aua0dWDNTtDHuuKsu5Enyy0hCTN5Kpq5mpwcHFNUUonhAd01UMngd1zbyPTL5V2CYmoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=w5cQ6bF1; 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="w5cQ6bF1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E01961F000FF; Fri, 25 Sep 2026 10:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790332454; bh=oKAQ7I9mhFYjXehph+Zj6uhHM6yxiI51eP0bX1gnHhQ=; h=From:To:Cc:Subject:Date:Reply-To; b=w5cQ6bF17OLhGtIs/fXhM3BrK7We0EKhnjKkG+f1nXIcr5N9wOqg0YbkKOWDw8pPS thzmh86v5MrmzsPD4zOlHx8koqMejGIcUZZjYleyJH4adMeVbs9iMWsgIBHlyZ/dKo mAbJCHeyZM1JQzvpiC7kNTU0Ro4eCsw5bUv4PwTg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-97997: virtio_ring: fix stale descriptor flags after a failed packed add Date: Fri, 25 Sep 2026 12:25:00 +0200 Message-ID: <2026092522-CVE-2026-97997-233d@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=3869; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+YMwOcPiZonI7MrZlhI4uZNCqkCyTFviUZKDCuxeENM=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnbvOPur+FRyPHu69FrNr52zuuS6YzAf0/jHFrmT/h4g ZHz8VaOjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIkh8M8xMkwtvEWkTzZ6V/ U9vHpTyr+vfkcob5Gbx9tdUZOuv/p+m8ObO85/erPP+FAA== 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: virtio_ring: fix stale descriptor flags after a failed packed add In a packed ring the AVAIL and USED bits sit in the descriptor itself, so writing them makes that descriptor available. Those bit combinations flip meaning on every round of the ring, tracked by a wrap counter, so invalidating or validating a descriptor means inverting both bits. Commit 1ce9e6055fa0 ("virtio_ring: introduce packed ring support") has virtqueue_add_packed() make every descriptor of a chain available as it maps the chain, and write the head last. The device consumes the ring in order and stops at a head that is not available yet, so it never reaches the rest. When vring_map_one_sg() fails partway, unmap_release unmaps the segments and restores avail_used_flags, but the descriptors it wrote to in the ring stay marked with AVAIL and USED bits. The head is now the only entry that keeps the device from consuming these stale entries. For example, the ring would look like this now. Z - pre-previous command A - previous command B - aborted command C - current command [A1 DONE] [A2 DONE] [B2] [B3] [Z1 DONE] When the driver now attempts to issue the C command, the next add starts at the same head as B. If C spans less descriptors than B, there is no end marker because AVAIL and USED bits were still in place. And that means the device will start interpreting these stale entries (B2/B3) as another command entry, which then blocks the queue. This effect typically happens in swiotlb configurations under memory pressure, because vring_map_one_sg() can then fail with larger I/O requests which then leads to command abortions. There are broadly 2 ways to avoid leaving those flags behind: 1) Defer those flags too until the chain is complete. 2) Rewrite those flags for the previous wrap counter. Implement the second option in both packed add paths. The first option traverses the chain a second time on every successful add. The second option invalidates all added descriptors when any add fails. With this patch applied, a packed virtqueue keeps completing requests after a failed add. The Linux kernel CVE team has assigned CVE-2026-97997 to this issue. Affected and fixed versions =========================== Issue introduced in 5.0 with commit 1ce9e6055fa0a9043405c5604cf19169ec5379ff and fixed in 7.2.7 with commit d595358276b60e5df4d3930bc94033249b1d5adc Issue introduced in 5.0 with commit 1ce9e6055fa0a9043405c5604cf19169ec5379ff and fixed in 7.3-rc3 with commit 75d276e5bb68778b2916f98a2bc30f142ebadc64 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-97997 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/virtio/virtio_ring.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/d595358276b60e5df4d3930bc94033249b1d5adc https://git.kernel.org/stable/c/75d276e5bb68778b2916f98a2bc30f142ebadc64