# CVE-2021-47258: scsi: core: Fix error handling of scsi_host_alloc()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 15% of CVEs (2026-12-01)
- Published: 2024-05-21T14:19:52.082Z
- Modified: 2026-06-17T04:17:02.023Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

scsi: core: Fix error handling of scsi_host_alloc()

After device is initialized via device_initialize(), or its name is set via
dev_set_name(), the device has to be freed via put_device().  Otherwise
device name will be leaked because it is allocated dynamically in
dev_set_name().

Fix the leak by replacing kfree() with put_device(). Since
scsi_host_dev_release() properly handles IDA and kthread removal, remove
special-casing these from the error handling as well.

(As written by CVE List.)

## Affected

- Linux Linux: from 1fa5ae857bb14f6046205171d98506d8112dd74e before 8958181c1663e24a13434448e7d6b96b5d04900a; from 1fa5ae857bb14f6046205171d98506d8112dd74e before db08ce595dd64ea9859f7d088b51cbfc8e685c66; from 1fa5ae857bb14f6046205171d98506d8112dd74e before 2dc85045ae65b9302a1d2e2ddd7ce4c030153a6a; from 1fa5ae857bb14f6046205171d98506d8112dd74e before 79296e292d67fa7b5fb8d8c27343683e823872c8; from 1fa5ae857bb14f6046205171d98506d8112dd74e before 7a696ce1d5d16a33a6cd6400bbcc0339b2460e11; from 1fa5ae857bb14f6046205171d98506d8112dd74e before 45d83db4728127944b237c0c8248987df9d478e7; from 1fa5ae857bb14f6046205171d98506d8112dd74e before 66a834d092930cf41d809c0e989b13cd6f9ca006; 2.6.30 (not affected: before 2.6.30; from 4.9.273 up to 4.9.*; from 4.14.237 up to 4.14.*; from 4.19.195 up to 4.19.*; from 5.4.126 up to 5.4.*; from 5.10.44 up to 5.10.*; from 5.12.11 up to 5.12.*; from 5.13 up to *)
- linux linux_kernel: before 4.9.273; from 4.10 before 4.14.237; from 4.15 before 4.19.195; from 4.20 before 5.4.126; from 5.5 before 5.10.44; from 5.11 before 5.12.11; 5.13

## References

- <https://git.kernel.org/stable/c/8958181c1663e24a13434448e7d6b96b5d04900a> (patch)
- <https://git.kernel.org/stable/c/db08ce595dd64ea9859f7d088b51cbfc8e685c66> (patch)
- <https://git.kernel.org/stable/c/2dc85045ae65b9302a1d2e2ddd7ce4c030153a6a> (patch)
- <https://git.kernel.org/stable/c/79296e292d67fa7b5fb8d8c27343683e823872c8> (patch)
- <https://git.kernel.org/stable/c/7a696ce1d5d16a33a6cd6400bbcc0339b2460e11> (patch)
- <https://git.kernel.org/stable/c/45d83db4728127944b237c0c8248987df9d478e7> (patch)
- <https://git.kernel.org/stable/c/66a834d092930cf41d809c0e989b13cd6f9ca006> (patch)

## Sources

- CVE List: [CVE-2021-47258](https://www.cve.org/CVERecord?id=CVE-2021-47258), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2021-47258](https://nvd.nist.gov/vuln/detail/CVE-2021-47258), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-47258 · Whole record: https://cve.day/CVE-2021-47258.json · Rebuilt by cve.day 2026-11-25T22:58:08.761Z
