CVE-2024-26935
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
01/05/2024
Last modified:
23/12/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
scsi: core: Fix unremoved procfs host directory regression<br />
<br />
Commit fc663711b944 ("scsi: core: Remove the /proc/scsi/${proc_name}<br />
directory earlier") fixed a bug related to modules loading/unloading, by<br />
adding a call to scsi_proc_hostdir_rm() on scsi_remove_host(). But that led<br />
to a potential duplicate call to the hostdir_rm() routine, since it&#39;s also<br />
called from scsi_host_dev_release(). That triggered a regression report,<br />
which was then fixed by commit be03df3d4bfe ("scsi: core: Fix a procfs host<br />
directory removal regression"). The fix just dropped the hostdir_rm() call<br />
from dev_release().<br />
<br />
But it happens that this proc directory is created on scsi_host_alloc(),<br />
and that function "pairs" with scsi_host_dev_release(), while<br />
scsi_remove_host() pairs with scsi_add_host(). In other words, it seems the<br />
reason for removing the proc directory on dev_release() was meant to cover<br />
cases in which a SCSI host structure was allocated, but the call to<br />
scsi_add_host() didn&#39;t happen. And that pattern happens to exist in some<br />
error paths, for example.<br />
<br />
Syzkaller causes that by using USB raw gadget device, error&#39;ing on<br />
usb-storage driver, at usb_stor_probe2(). By checking that path, we can see<br />
that the BadDevice label leads to a scsi_host_put() after a SCSI host<br />
allocation, but there&#39;s no call to scsi_add_host() in such path. That leads<br />
to messages like this in dmesg (and a leak of the SCSI host proc<br />
structure):<br />
<br />
usb-storage 4-1:87.51: USB Mass Storage device detected<br />
proc_dir_entry &#39;scsi/usb-storage&#39; already registered<br />
WARNING: CPU: 1 PID: 3519 at fs/proc/generic.c:377 proc_register+0x347/0x4e0 fs/proc/generic.c:376<br />
<br />
The proper fix seems to still call scsi_proc_hostdir_rm() on dev_release(),<br />
but guard that with the state check for SHOST_CREATED; there is even a<br />
comment in scsi_host_dev_release() detailing that: such conditional is<br />
meant for cases where the SCSI host was allocated but there was no calls to<br />
{add,remove}_host(), like the usb-storage case.<br />
<br />
This is what we propose here and with that, the error path of usb-storage<br />
does not trigger the warning anymore.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.4.238 (including) | 5.4.274 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.10.176 (including) | 5.10.215 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.15.104 (including) | 5.15.154 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.1.21 (including) | 6.1.84 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2.8 (including) | 6.3 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.3.1 (including) | 6.6.24 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.7.12 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.8 (including) | 6.8.3 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.3:-:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.3:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.3:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.3:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.3:rc6:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.3:rc7:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/0053f15d50d50c9312d8ab9c11e2e405812dfcac
- https://git.kernel.org/stable/c/3678cf67ff7136db1dd3bf63c361650db5d92889
- https://git.kernel.org/stable/c/5c2386ba80e779a92ec3bb64ccadbedd88f779b1
- https://git.kernel.org/stable/c/cea234bb214b17d004dfdccce4491e6ff57c96ee
- https://git.kernel.org/stable/c/d4c34782b6d7b1e68d18d9549451b19433bd4c6c
- https://git.kernel.org/stable/c/e293c773c13b830cdc251f155df2254981abc320
- https://git.kernel.org/stable/c/f23a4d6e07570826fe95023ca1aa96a011fa9f84
- https://git.kernel.org/stable/c/f4ff08fab66eb5c0b97e1a24edac052fb40bf5d7
- https://git.kernel.org/stable/c/0053f15d50d50c9312d8ab9c11e2e405812dfcac
- https://git.kernel.org/stable/c/3678cf67ff7136db1dd3bf63c361650db5d92889
- https://git.kernel.org/stable/c/5c2386ba80e779a92ec3bb64ccadbedd88f779b1
- https://git.kernel.org/stable/c/cea234bb214b17d004dfdccce4491e6ff57c96ee
- https://git.kernel.org/stable/c/d4c34782b6d7b1e68d18d9549451b19433bd4c6c
- https://git.kernel.org/stable/c/e293c773c13b830cdc251f155df2254981abc320
- https://git.kernel.org/stable/c/f23a4d6e07570826fe95023ca1aa96a011fa9f84
- https://git.kernel.org/stable/c/f4ff08fab66eb5c0b97e1a24edac052fb40bf5d7
- https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html



