FlawAtlas
Search the atlas
UBUNTU-CVE-2025-22083 High

UBUNTU-CVE-2025-22083

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.

Exploit probability Not scored
Published April 16, 2025
Required by Not available
Last source change August 19, 2026

02 / AFFECTED SOFTWARE

Affected packages

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-fips

55 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-6.5

11 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-iot

53 explicit affected versions

Ubuntu:Pro:FIPS-updates:24.04:LTS linux-azure-fips

2 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-azure

116 explicit affected versions

Ubuntu:22.04:LTS linux-ibm

89 explicit affected versions

Ubuntu:18.04:LTS linux-oem

50 explicit affected versions

Ubuntu:18.04:LTS linux-aws-5.0

6 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.11

12 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.5

19 explicit affected versions

Ubuntu:20.04:LTS linux-raspi2

6 explicit affected versions

Ubuntu:22.04:LTS linux

100 explicit affected versions

Ubuntu:24.04:LTS linux-riscv

24 explicit affected versions

Ubuntu:22.04:LTS linux-gkeop

85 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-lowlatency-hwe-5.15

84 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-fips

91 explicit affected versions

Ubuntu:22.04:LTS linux-azure

86 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-gcp-5.15

76 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-6.5

10 explicit affected versions

Ubuntu:22.04:LTS linux-ibm-6.8

23 explicit affected versions

Ubuntu:24.04:LTS linux-oem-6.8

26 explicit affected versions

Ubuntu:22.04:LTS linux-gke

90 explicit affected versions

Ubuntu:Pro:14.04:LTS linux

191 explicit affected versions

Ubuntu:22.04:LTS linux-azure-5.19

7 explicit affected versions

Ubuntu:22.04:LTS linux-raspi

84 explicit affected versions

Ubuntu:22.04:LTS linux-oracle-6.8

27 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.5

13 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-azure-fips

85 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-hwe-5.4

120 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia

30 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.14

35 explicit affected versions

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-gcp-fips

51 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-tegra

50 explicit affected versions

Ubuntu:24.04:LTS linux-oracle

32 explicit affected versions

Ubuntu:20.04:LTS linux-gke-5.15

18 explicit affected versions

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-azure-fips

42 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-oracle

118 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde

64 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.2

10 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.13

13 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.8

4 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-kvm

121 explicit affected versions

Ubuntu:16.04:LTS linux-hwe-edge

23 explicit affected versions

Ubuntu:24.04:LTS linux

38 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-gcp

124 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-gcp-fips

1 explicit affected versions

Ubuntu:24.04:LTS linux-raspi-realtime

1 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.8

21 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.13

16 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-aws-fips

76 explicit affected versions

Ubuntu:24.04:LTS linux-aws

34 explicit affected versions

Ubuntu:24.04:LTS linux-hwe-6.11

6 explicit affected versions

Ubuntu:18.04:LTS linux-oracle-5.0

7 explicit affected versions

Ubuntu:20.04:LTS linux-riscv

12 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-oracle

111 explicit affected versions

Ubuntu:24.04:LTS linux-azure-6.11

6 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.11

12 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.5

14 explicit affected versions

Ubuntu:25.10 linux-azure-fde

10 explicit affected versions

Ubuntu:22.04:LTS linux-intel-iot-realtime

1 explicit affected versions

Ubuntu:20.04:LTS linux-intel-5.13

7 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-tegra

5 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-azure-5.4

104 explicit affected versions

Ubuntu:24.04:LTS linux-lowlatency-hwe-6.11

5 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.13

12 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-raspi

105 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.11

12 explicit affected versions

Ubuntu:Pro:Realtime:22.04:LTS linux-realtime-6.8

27 explicit affected versions

Ubuntu:Pro:14.04:LTS linux-aws

120 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-tegra-igx

45 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.8

21 explicit affected versions

Ubuntu:24.04:LTS linux-gkeop

20 explicit affected versions

Ubuntu:18.04:LTS linux-hwe-edge

10 explicit affected versions

Ubuntu:18.04:LTS linux-gke-5.4

37 explicit affected versions

Ubuntu:24.04:LTS linux-azure-nvidia

8 explicit affected versions

Ubuntu:22.04:LTS linux-oracle-6.5

13 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8

26 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde-6.2

10 explicit affected versions

Ubuntu:Pro:Realtime:22.04:LTS linux-intel-iot-realtime

68 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-aws-fips

1 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.10

26 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.13

13 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-aws

144 explicit affected versions

Ubuntu:22.04:LTS linux-xilinx-zynqmp

37 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-fips

1 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.6

29 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-gcp-5.4

111 explicit affected versions

Ubuntu:18.04:LTS linux-gcp-5.3

13 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency

96 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-lowlatency

27 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.8

27 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-azure-fips

1 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-raspi-5.4

100 explicit affected versions

Ubuntu:22.04:LTS linux-aws

92 explicit affected versions

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-aws-fips

55 explicit affected versions

Ubuntu:18.04:LTS linux-gke-4.15

33 explicit affected versions

Ubuntu:22.04:LTS linux-riscv

23 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-ibm-5.15

60 explicit affected versions

Ubuntu:18.04:LTS linux-aws-5.3

10 explicit affected versions

Ubuntu:Pro:FIPS-updates:24.04:LTS linux-fips

6 explicit affected versions

Ubuntu:Pro:16.04:LTS linux

188 explicit affected versions

Ubuntu:Pro:FIPS-updates:24.04:LTS linux-gcp-fips

5 explicit affected versions

Ubuntu:Nvidia-BlueField:24.04:LTS linux-bluefield

11 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.11

12 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.8

7 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.2

12 explicit affected versions

Ubuntu:Pro:20.04:LTS linux

132 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-gcp

138 explicit affected versions

Ubuntu:Pro:FIPS:16.04:LTS linux-fips

2 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia

77 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-kvm

132 explicit affected versions

Ubuntu:22.04:LTS linux-oracle

93 explicit affected versions

Ubuntu:Pro:14.04:LTS linux-lts-xenial

165 explicit affected versions

Ubuntu:Pro:18.04:LTS linux

154 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-5.19

10 explicit affected versions

Ubuntu:22.04:LTS linux-oem-5.17

26 explicit affected versions

Ubuntu:24.04:LTS linux-azure

28 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-azure-fips

1 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-intel-iotg-5.15

69 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.8

21 explicit affected versions

Ubuntu:24.04:LTS linux-raspi

33 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.2

13 explicit affected versions

Ubuntu:24.04:LTS linux-ibm

32 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-aws

139 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-ibm-5.4

78 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.0

16 explicit affected versions

Ubuntu:22.04:LTS linux-kvm

91 explicit affected versions

Ubuntu:24.04:LTS linux-gcp

36 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-aws-hwe

116 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde-5.19

3 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-gcp-4.15

93 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-azure-fips

1 explicit affected versions

Ubuntu:24.04:LTS linux-gcp-6.11

5 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-aws-fips

2 explicit affected versions

Ubuntu:20.04:LTS linux-gke

51 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-azure-4.15

92 explicit affected versions

Ubuntu:24.04:LTS linux-oem-6.11

15 explicit affected versions

Ubuntu:Pro:Realtime:24.04:LTS linux-raspi-realtime

28 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.13

12 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-azure-5.15

71 explicit affected versions

Ubuntu:22.04:LTS linux-intel-iotg

80 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.1

27 explicit affected versions

Ubuntu:Nvidia-BlueField:22.04:LTS linux-bluefield

66 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-oracle

121 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-aws-fips

1 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-fips

1 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-fips

98 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.8

29 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-5.19

8 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.8

5 explicit affected versions

Ubuntu:24.04:LTS linux-intel

3 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-5.19

8 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-gcp-fips

1 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.2

10 explicit affected versions

Ubuntu:Pro:Realtime:24.04:LTS linux-realtime

32 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.5

13 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-oracle-5.4

110 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.11

13 explicit affected versions

Ubuntu:20.04:LTS linux-riscv-5.8

10 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-azure-fips

72 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-5.19

7 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-azure

140 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-6.11

5 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-aws-fips

94 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.13

12 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-nvidia-tegra-5.15

39 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-aws-5.4

108 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-bluefield

80 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-xilinx-zynqmp

56 explicit affected versions

Ubuntu:18.04:LTS linux-azure

44 explicit affected versions

Ubuntu:18.04:LTS linux-azure-5.3

16 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-6.2

3 explicit affected versions

Ubuntu:20.04:LTS linux-riscv-5.11

13 explicit affected versions

Ubuntu:20.04:LTS linux-azure-fde

26 explicit affected versions

Ubuntu:20.04:LTS linux-gkeop-5.15

45 explicit affected versions

Ubuntu:18.04:LTS linux-gkeop-5.4

37 explicit affected versions

Ubuntu:24.04:LTS linux-lowlatency

37 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.5

14 explicit affected versions

Ubuntu:18.04:LTS linux-gcp

38 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-hwe

167 explicit affected versions

Ubuntu:18.04:LTS linux-oracle-5.3

9 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-5.19

11 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-6.8

25 explicit affected versions

Ubuntu:24.04:LTS linux-xilinx

8 explicit affected versions

Ubuntu:22.04:LTS linux-gcp

92 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.2

7 explicit affected versions

Ubuntu:Pro:FIPS:16.04:LTS linux-fips

97 explicit affected versions

Ubuntu:Pro:14.04:LTS linux-azure

121 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.8

4 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-riscv-5.15

81 explicit affected versions

Ubuntu:24.04:LTS linux-realtime

1 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.5

13 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-fips

1 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-gcp-fips

1 explicit affected versions

Ubuntu:Pro:Realtime:22.04:LTS linux-realtime

91 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-hwe-5.15

80 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-aws-5.15

79 explicit affected versions

Ubuntu:18.04:LTS linux-hwe

43 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-gcp-fips

77 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-kvm

119 explicit affected versions

Ubuntu:22.04:LTS linux-aws-5.19

10 explicit affected versions

Ubuntu:22.04:LTS linux-allwinner-5.19

8 explicit affected versions

Ubuntu:24.04:LTS linux-gke

31 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-ibm

88 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.2

14 explicit affected versions

Ubuntu:18.04:LTS linux-azure-edge

4 explicit affected versions

Ubuntu:20.04:LTS linux-gkeop

78 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.5

11 explicit affected versions

Ubuntu:22.04:LTS linux-realtime

1 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-gcp-fips

69 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-aws

123 explicit affected versions

Ubuntu:Pro:FIPS-updates:24.04:LTS linux-aws-fips

5 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.8

25 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-oracle-5.15

80 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities UBUNTU-CVE-2025-22083

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.

View original source

05 / REFERENCES

Further evidence