Skip to content
OpenAdvisories
High · 7.8 CVE-2025-22083 EUVD-2025-11212GHSA-vcjc-q999-g4p2

vhost-scsi: Fix handling of multiple calls to vhost_scsi_set_endpoint

Published Apr 16, 2025 · Updated Nov 10, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.15 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.4 Package: linux-aws-5.8 Package: linux-aws-6.2 Package: linux-aws-6.5 Package: linux-aws-6.8 Package: linux-aws-fips Package: linux-aws-hwe Package: linux-azure Package: linux-azure-4.15 Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.15 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.4 Package: linux-azure-5.8 Package: linux-azure-6.11 Package: linux-azure-6.2 Package: linux-azure-6.5 Package: linux-azure-6.8 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.15 Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.2 Package: linux-azure-fips Package: linux-azure-nvidia Package: linux-bluefield Package: linux-fips Package: linux-gcp Package: linux-gcp-4.15 Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.15 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.4 Package: linux-gcp-5.8 Package: linux-gcp-6.11 Package: linux-gcp-6.2 Package: linux-gcp-6.5 Package: linux-gcp-6.8 Package: linux-gcp-fips Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop Package: linux-gkeop-5.15 Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.15 Package: linux-hwe-5.19 Package: linux-hwe-5.4 Package: linux-hwe-5.8 Package: linux-hwe-6.11 Package: linux-hwe-6.2 Package: linux-hwe-6.5 Package: linux-hwe-6.8 Package: linux-hwe-edge Package: linux-ibm Package: linux-ibm-5.15 Package: linux-ibm-5.4 Package: linux-ibm-6.8 Package: linux-intel Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-intel-iotg Package: linux-intel-iotg-5.15 Package: linux-iot Package: linux-kvm Package: linux-lowlatency Package: linux-lowlatency-hwe-5.15 Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.11 Package: linux-lowlatency-hwe-6.2 Package: linux-lowlatency-hwe-6.5 Package: linux-lowlatency-hwe-6.8 Package: linux-lts-xenial Package: linux-nvidia Package: linux-nvidia-6.11 Package: linux-nvidia-6.2 Package: linux-nvidia-6.5 Package: linux-nvidia-6.8 Package: linux-nvidia-lowlatency Package: linux-nvidia-tegra Package: linux-nvidia-tegra-5.15 Package: linux-nvidia-tegra-igx Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oem-6.11 Package: linux-oem-6.5 Package: linux-oem-6.8 Package: linux-oracle Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.15 Package: linux-oracle-5.3 Package: linux-oracle-5.4 Package: linux-oracle-5.8 Package: linux-oracle-6.5 Package: linux-oracle-6.8 Package: linux-raspi Package: linux-raspi-5.4 Package: linux-raspi-realtime Package: linux-raspi2 Package: linux-realtime Package: linux-realtime-6.8 Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.15 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-riscv-6.5 Package: linux-riscv-6.8 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-starfive-6.5 Package: linux-vmware Package: linux-xilinx Package: linux-xilinx-zynqmp Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

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

vhost-scsi: Fix handling of multiple calls to vhost_scsi_set_endpoint

If vhost_scsi_set_endpoint is called multiple times without a
vhost_scsi_clear_endpoint between them, we can hit multiple bugs
found by Haoran Zhang:

1. Use-after-free when no tpgs are found:

This fixes a use after free that occurs when vhost_scsi_set_endpoint is
called more than once and calls after the first call do not find any
tpgs to add to the vs_tpg. When vhost_scsi_set_endpoint first finds
tpgs to add to the vs_tpg array match=true, so we will do:

vhost_vq_set_backend(vq, vs_tpg);
...

kfree(vs->vs_tpg);
vs->vs_tpg = vs_tpg;

If vhost_scsi_set_endpoint is called again and no tpgs are found
match=false so we skip the vhost_vq_set_backend call leaving the
pointer to the vs_tpg we then free via:

kfree(vs->vs_tpg);
vs->vs_tpg = vs_tpg;

If a scsi request is then sent we do:

vhost_scsi_handle_vq -> vhost_scsi_get_req -> vhost_vq_get_backend

which sees the vs_tpg we just did a kfree on.

2. Tpg dir removal hang:

This patch fixes an issue where we cannot remove a LIO/target layer
tpg (and structs above it like the target) dir due to the refcount
dropping to -1.

The problem is that if vhost_scsi_set_endpoint detects a tpg is already
in the vs->vs_tpg array or if the tpg has been removed so
target_depend_item fails, the undepend goto handler will do
target_undepend_item on all tpgs in the vs_tpg array dropping their
refcount to 0. At this time vs_tpg contains both the tpgs we have added
in the current vhost_scsi_set_endpoint call as well as tpgs we added in
previous calls which are also in vs->vs_tpg.

Later, when vhost_scsi_clear_endpoint runs it will do
target_undepend_item on all the tpgs in the vs->vs_tpg which will drop
their refcount to -1. Userspace will then not be able to remove the tpg
and will hang when it tries to do rmdir on the tpg dir.

3. Tpg leak:

This fixes a bug where we can leak tpgs and cause them to be
un-removable because the target name is overwritten when
vhost_scsi_set_endpoint is called multiple times but with different
target names.

The bug occurs if a user has called VHOST_SCSI_SET_ENDPOINT and setup
a vhost-scsi device to target/tpg mapping, then calls
VHOST_SCSI_SET_ENDPOINT again with a new target name that has tpgs we
haven't seen before (target1 has tpg1 but target2 has tpg2). When this
happens we don't teardown the old target tpg mapping and just overwrite
the target name and the vs->vs_tpg array. Later when we do
vhost_scsi_clear_endpoint, we are passed in either target1 or target2's
name and we will only match that target's tpgs when we loop over the
vs->vs_tpg. We will then return from the function without doing
target_undepend_item on the tpgs.

Because of all these bugs, it looks like being able to call
vhost_scsi_set_endpoint multiple times was never supported. The major
user, QEMU, already has checks to prevent this use case. So to fix the
issues, this patch prevents vhost_scsi_set_endpoint from being called
if it's already successfully added tpgs. To add, remove or change the
tpg config or target name, you must do a vhost_scsi_clear_endpoint
first.

Affected products

VendorProductAffectedFixed
Linux Linux 3.9 6.1.162

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 6.12.25-1 —
Debian 13 linux 6.12.25-1 —
Debian 12 linux 6.1.162-1 DSA-6127-1
Debian 11 linux-6.1 6.1.162-1~deb11u1 DLA-4476-1
ReleasePackageFixed inAdvisory
Ubuntu Nvidia-BlueField 24.04 LTS linux-bluefield 6.8.0-1012.16 —
Ubuntu Nvidia-BlueField 22.04 LTS linux-bluefield 5.15.0-1103.105 —
Ubuntu 25.10 linux-azure-fde No fix yet —
Ubuntu 25.04 linux 6.14.0-22.22 USN-7594-1
Ubuntu 25.04 linux-aws +3 6.14.0-1007.7 USN-7594-3, USN-7594-2, USN-7594-1
Ubuntu 25.04 linux-gcp 6.14.0-1008.8 USN-7594-1
Ubuntu 25.04 linux-realtime 6.14.0-1004.4 USN-7594-1
Ubuntu 24.04 LTS linux 6.8.0-86.87 USN-7835-1
Ubuntu 24.04 LTS linux-aws 6.8.0-1041.43 USN-7835-1
Ubuntu 24.04 LTS linux-azure 6.8.0-1041.47 USN-7835-1
Ubuntu 24.04 LTS linux-azure-6.11 6.11.0-1018.18~24.04.1 USN-7628-1
Ubuntu 24.04 LTS linux-azure-nvidia 6.8.0-1029.32 USN-7940-2
Ubuntu 24.04 LTS linux-gcp 6.8.0-1042.45 USN-7835-1
Ubuntu 24.04 LTS linux-gcp-6.11 6.11.0-1016.16~24.04.1 USN-7605-1
Ubuntu 24.04 LTS linux-gke 6.8.0-1038.43 USN-7835-3
Ubuntu 24.04 LTS linux-gkeop 6.8.0-1025.28 USN-7835-1
Ubuntu 24.04 LTS linux-hwe-6.11 6.11.0-28.28~24.04.1 USN-7605-1
Ubuntu 24.04 LTS linux-ibm 6.8.0-1039.39 USN-7835-1
Ubuntu 24.04 LTS linux-intel +4 No fix yet —
Ubuntu 24.04 LTS linux-lowlatency 6.8.0-86.87.1 USN-7835-1
Ubuntu 24.04 LTS linux-lowlatency-hwe-6.11 6.11.0-1015.16~24.04.2 USN-7605-2
Ubuntu 24.04 LTS linux-nvidia 6.8.0-1041.44 USN-7835-3
Ubuntu 24.04 LTS linux-nvidia-6.11 6.11.0-1012.12 —
Ubuntu 24.04 LTS linux-nvidia-lowlatency 6.8.0-1041.44.1 USN-7835-3
Ubuntu 24.04 LTS linux-nvidia-tegra 6.8.0-1012.12 —
Ubuntu 24.04 LTS linux-oem-6.11 6.11.0-1024.24 USN-7606-1
Ubuntu 24.04 LTS linux-oracle 6.8.0-1038.39 USN-7835-1
Ubuntu 24.04 LTS linux-raspi 6.8.0-1041.45 USN-7887-2
Ubuntu 24.04 LTS linux-xilinx 6.8.0-1018.19 —
Show 19 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS linux 5.15.0-202.212 USN-8961-1
Ubuntu 22.04 LTS linux-aws 5.15.0-1119.126 USN-8961-1
Ubuntu 22.04 LTS linux-aws-6.8 6.8.0-1041.43~22.04.1 USN-7835-6
Ubuntu 22.04 LTS linux-azure 5.15.0-1125.134 USN-8961-1
Ubuntu 22.04 LTS linux-azure-6.8 6.8.0-1041.47~22.04.1 USN-7835-1
Ubuntu 22.04 LTS linux-azure-fde 5.15.0-1124.133 USN-8962-1
Ubuntu 22.04 LTS linux-gcp 5.15.0-1120.130 USN-8961-1
Ubuntu 22.04 LTS linux-gcp-6.8 6.8.0-1042.45~22.04.1 USN-7835-3
Ubuntu 22.04 LTS linux-gke 5.15.0-1115.121 USN-8961-1
Ubuntu 22.04 LTS linux-gkeop 5.15.0-1102.110 USN-8961-1
Ubuntu 22.04 LTS linux-hwe-6.8 +1 6.8.0-86.87~22.04.1 USN-7835-4
Ubuntu 22.04 LTS linux-ibm 5.15.0-1113.117 USN-8961-1
Ubuntu 22.04 LTS linux-ibm-6.8 6.8.0-1039.39~22.04.1 USN-7835-1
Ubuntu 22.04 LTS linux-intel-iotg 5.15.0-1114.120 USN-8961-1
Ubuntu 22.04 LTS linux-kvm 5.15.0-1111.116 USN-8961-1
Ubuntu 22.04 LTS linux-lowlatency 5.15.0-197.207 USN-8961-1
Ubuntu 22.04 LTS linux-lowlatency-hwe-6.8 6.8.0-86.87.1~22.04.1 USN-7835-1
Ubuntu 22.04 LTS linux-nvidia 5.15.0-1114.115 USN-8961-1
Ubuntu 22.04 LTS linux-nvidia-6.8 6.8.0-1041.44~22.04.2 USN-7835-3
Ubuntu 22.04 LTS linux-nvidia-tegra 5.15.0-1070.72 USN-8963-1
Ubuntu 22.04 LTS linux-nvidia-tegra-igx 5.15.0-1059.59 USN-8963-1
Ubuntu 22.04 LTS linux-oracle 5.15.0-1116.122 USN-8961-1
Ubuntu 22.04 LTS linux-oracle-6.8 6.8.0-1038.39~22.04.1 USN-7835-5
Ubuntu 22.04 LTS linux-raspi 5.15.0-1113.116 USN-9029-1
Ubuntu 22.04 LTS linux-riscv +33 No fix yet —
Ubuntu 20.04 LTS linux-gke +28 No fix yet —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Ubuntu Pro Realtime 24.04 LTS linux-raspi-realtime 6.8.0-2032.33 USN-7887-1
Ubuntu Pro Realtime 24.04 LTS linux-realtime 6.8.1-1036.37 USN-7835-2
Ubuntu Pro Realtime 22.04 LTS linux-intel-iot-realtime 5.15.0-1111.115 USN-8961-1
Ubuntu Pro Realtime 22.04 LTS linux-realtime 5.15.0-1118.127 USN-8961-1
Ubuntu Pro Realtime 22.04 LTS linux-realtime-6.8 6.8.1-1036.37~22.04.1 USN-7835-2
Ubuntu Pro FIPS 20.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 18.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 16.04 LTS linux-fips No fix yet —
Ubuntu Pro FIPS-updates 24.04 LTS linux-aws-fips 6.8.0-1041.43+fips1 —
Ubuntu Pro FIPS-updates 24.04 LTS linux-azure-fips 6.8.0-1044.50+fips1 USN-7940-1
Ubuntu Pro FIPS-updates 24.04 LTS linux-fips 6.8.0-86.87+fips1 —
Ubuntu Pro FIPS-updates 24.04 LTS linux-gcp-fips 6.8.0-1042.45+fips1 —
Ubuntu Pro FIPS-updates 22.04 LTS linux-aws-fips 5.15.0-1119.126+fips1 USN-8961-1
Ubuntu Pro FIPS-updates 22.04 LTS linux-azure-fips 5.15.0-1125.134+fips1 USN-8961-1
Ubuntu Pro FIPS-updates 22.04 LTS linux-fips 5.15.0-202.212+fips1 USN-8961-1
Ubuntu Pro FIPS-updates 22.04 LTS linux-gcp-fips 5.15.0-1120.130+fips1 USN-8961-1
Ubuntu Pro FIPS-updates 20.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS-updates 18.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS-updates 16.04 LTS linux-fips No fix yet —
Ubuntu Pro FIPS-preview 22.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro 20.04 LTS linux +10 No fix yet —
Ubuntu Pro 20.04 LTS linux-aws-5.15 5.15.0-1119.126~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-azure-5.15 5.15.0-1125.134~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-azure-fde-5.15 5.15.0-1124.133~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-gcp-5.15 5.15.0-1120.130~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-hwe-5.15 5.15.0-202.212~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-ibm-5.15 5.15.0-1113.117~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-intel-iotg-5.15 5.15.0-1114.120~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-lowlatency-hwe-5.15 5.15.0-197.207~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-nvidia-tegra-5.15 5.15.0-1070.72~20.04.1 USN-8963-1
Ubuntu Pro 20.04 LTS linux-oracle-5.15 5.15.0-1116.122~20.04.1 USN-8961-1
Ubuntu Pro 20.04 LTS linux-riscv-5.15 5.15.0-1113.117~20.04.2 —
Ubuntu Pro 18.04 LTS linux +12 No fix yet —
Ubuntu Pro 16.04 LTS linux +7 No fix yet —
Ubuntu Pro 14.04 LTS linux +3 No fix yet —
ReleasePackageFixed inAdvisory
SLES 15 SP7 kernel-64kb +6 6.4.0-150700.53.6.1 SUSE-SU-2025:02307-1
SLES 15 SP7 kernel-azure +2 6.4.0-150700.20.6.1 SUSE-SU-2025:02254-1
SLES 15 SP7 kernel-default-base 6.4.0-150700.53.6.1.150700.17.6.1 SUSE-SU-2025:02307-1
SLES 15 SP6 kernel-64kb +3 6.4.0-150600.23.60.4 SUSE-SU-2025:02538-1
SLES 15 SP6 kernel-azure +2 6.4.0-150600.8.43.1 SUSE-SU-2025:02249-1
SLES 15 SP6 kernel-coco +3 6.4.0-15061.28.coco15sp6.1 SUSE-SU-2025:02923-1
SLES 15 SP6 kernel-default 6.4.0-150600.23.60.5 SUSE-SU-2025:02538-1
SLES 15 SP6 kernel-default-base 6.4.0-150600.23.60.5.150600.12.26.4 SUSE-SU-2025:02538-1
SLES 15 SP6 kernel-docs +1 6.4.0-150600.23.60.3 SUSE-SU-2025:02538-1
SLES 12 SP5 kernel-syms +2 4.12.14-122.296.1 SUSE-SU-2026:1078-1
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.1 kernel-default-base 6.4.0-31.1.21.9 SUSE-SU-2025:20475-1
SLE Micro 6.1 kernel-rt +1 6.4.0-34.1 SUSE-SU-2025:20483-1
SLE Micro 6.1 kernel-source +2 6.4.0-31.1 SUSE-SU-2025:20475-1
SLE Micro 6.0 kernel-default-base 6.4.0-31.1.21.9 SUSE-SU-2025:20493-1
SLE Micro 6.0 kernel-rt +1 6.4.0-34.1 SUSE-SU-2025:20498-1
SLE Micro 6.0 kernel-source +2 6.4.0-31.1 SUSE-SU-2025:20493-1
SLE Live Patching 15 SP7 kernel-default 6.4.0-150700.53.6.1 SUSE-SU-2025:02307-1
SLE Live Patching 15 SP7 kernel-livepatch-SLE15-SP7-RT_Update_2 1-150700.1.5.1 SUSE-SU-2025:02333-1
SLE Live Patching 15 SP7 kernel-livepatch-SLE15-SP7_Update_2 1-150700.15.3.1 SUSE-SU-2025:02307-1
SLE Live Patching 15 SP6 kernel-default 6.4.0-150600.23.60.5 SUSE-SU-2025:02538-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_13 1-150600.1.5.1 SUSE-SU-2025:02335-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_13 1-150600.13.6.4 SUSE-SU-2025:02538-1
SLE Live Patching 12 SP5 kernel-default 4.12.14-122.296.1 SUSE-SU-2026:1078-1
SLE Live Patching 12 SP5 kgraft-patch-SLE12-SP5_Update_78 1-8.3.1 SUSE-SU-2026:1078-1
SUSE Real Time Module 15 SP7 kernel-rt +2 6.4.0-150700.7.8.1 SUSE-SU-2025:02333-1
SUSE Real Time Module 15 SP6 kernel-rt +3 6.4.0-150600.10.44.1 SUSE-SU-2025:02335-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.6 dtb-aarch64 +2 6.4.0-150600.23.60.3 SUSE-SU-2025:02538-1
openSUSE Leap 15.6 kernel-64kb +5 6.4.0-150600.23.60.4 SUSE-SU-2025:02538-1
openSUSE Leap 15.6 kernel-azure +2 6.4.0-150600.8.43.1 SUSE-SU-2025:02249-1
openSUSE Leap 15.6 kernel-default 6.4.0-150600.23.60.5 SUSE-SU-2025:02538-1
openSUSE Leap 15.6 kernel-default-base 6.4.0-150600.23.60.5.150600.12.26.4 SUSE-SU-2025:02538-1
openSUSE Leap 15.6 kernel-obs-qa 6.4.0-150600.23.60.2 SUSE-SU-2025:02538-1
openSUSE Leap 15.6 kernel-rt +3 6.4.0-150600.10.44.1 SUSE-SU-2025:02335-1

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 kernel-uek +34 6.12.0-101.33.4.3.el10uek ELSA-2025-20530, ELSA-2025-20480

Advisories 42

References