vhost-scsi: Fix handling of multiple calls to vhost_scsi_set_endpoint
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4f7f46d32c9875004fae1d57ae3c02cc2e6cd6a3 · < 5dd639a1646ef5fe8f4bf270fad47c5c3755b9b6| No fix yet |
| Linux Linux |
|
|
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:
From the CVE record · Linux
The Linux kernel’s vhost-scsi component mishandles repeated calls to vhost_scsi_set_endpoint without an intervening clear. A local caller able to make those calls can trigger a use-after-free when a SCSI request follows; other sequences can prevent target directories from being removed or leak target portal groups. The input does not specify whether authentication is required or user interaction is involved.
Engineers running Linux kernels with vhost-scsi should check their deployments; affected versions are not specified.