CVE-2026-72085: scsi: xen: scsiback: Free unsubmitted command instead of double-putting it

Greg Kroah-Hartman <[email protected]>
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026081521-CVE-2026-72085-3058@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

scsi: xen: scsiback: Free unsubmitted command instead of double-putting it

scsiback_get_pend_req() obtains a command tag and returns a vscsibk_pend
whose embedded se_cmd has only been memset to 0, so its cmd_kref is 0;
the se_cmd is initialised (kref_init() via target_init_cmd()) only
later, in scsiback_cmd_exec(), on the successful VSCSIIF_ACT_SCSI_CDB
path. The two error paths in scsiback_do_cmd_fn() taken before the
command is submitted -- a failed scsiback_gnttab_data_map() and an
unknown ring_req.act -- call
transport_generic_free_cmd(&pending_req->se_cmd, 0), which kref_put()s a
refcount of 0. That underflows it ("refcount_t: underflow;
use-after-free") and, as the release function is not run, leaks the
command tag.

Impact: a pvSCSI guest can leak every command tag of a LUN's session,
stopping the LUN, by submitting requests with a bad grant reference or
an unknown request type; under panic_on_warn the refcount underflow
panics the host.

Add a helper that just returns the tag with target_free_tag() and sends
the error response. It frees the tag while the v2p reference still pins
the session, and snapshots the response fields beforehand because
freeing the tag can let another ring reuse the pending_req slot.

The Linux kernel CVE team has assigned CVE-2026-72085 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 4.6 with commit 2dbcdf33dbf61f44b29adb52338282c3d7840d0e and fixed in 5.15.212 with commit 9c0f6894982b1f13bda220707497b25ac9c95bdb
	Issue introduced in 4.6 with commit 2dbcdf33dbf61f44b29adb52338282c3d7840d0e and fixed in 6.1.178 with commit a13b789497a7fdd27d4d63f5c69d23db706ef0fe
	Issue introduced in 4.6 with commit 2dbcdf33dbf61f44b29adb52338282c3d7840d0e and fixed in 6.6.145 with commit fa588f28401102652068c4cc75e135507f4b5106
	Issue introduced in 4.6 with commit 2dbcdf33dbf61f44b29adb52338282c3d7840d0e and fixed in 6.12.97 with commit fcd64d4d97af5d9736f31040f8ed8cd4c17e4c45
	Issue introduced in 4.6 with commit 2dbcdf33dbf61f44b29adb52338282c3d7840d0e and fixed in 6.18.40 with commit f1516c56ac540da1769f264c3cfefe4499548a5d
	Issue introduced in 4.6 with commit 2dbcdf33dbf61f44b29adb52338282c3d7840d0e and fixed in 7.1.5 with commit 1e97c404e44991fb087c38ccd7414f2d326f9b74
	Issue introduced in 4.6 with commit 2dbcdf33dbf61f44b29adb52338282c3d7840d0e and fixed in 7.2-rc4 with commit ca978f8a93d4d36841839bf2847d29b88c2591d6

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-72085
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/xen/xen-scsiback.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/9c0f6894982b1f13bda220707497b25ac9c95bdb
	https://git.kernel.org/stable/c/a13b789497a7fdd27d4d63f5c69d23db706ef0fe
	https://git.kernel.org/stable/c/fa588f28401102652068c4cc75e135507f4b5106
	https://git.kernel.org/stable/c/fcd64d4d97af5d9736f31040f8ed8cd4c17e4c45
	https://git.kernel.org/stable/c/f1516c56ac540da1769f264c3cfefe4499548a5d
	https://git.kernel.org/stable/c/1e97c404e44991fb087c38ccd7414f2d326f9b74
	https://git.kernel.org/stable/c/ca978f8a93d4d36841839bf2847d29b88c2591d6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.