HIGH Introduced in 3.7
st IndexIdr UAF
CVE-2026-99156
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.1HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: scsi: st: Fix use-after-free race between st_remove() and st_open() st_remove() drops the probe reference on the scsi_tape with kref_put() and only afterwards removes its index from st_index_idr. If that was the last reference, scsi_tape_release() frees the structure while it is still published in the idr. scsi_tape_get(), called from st_open(), looks up the tape in st_index_idr and takes a reference under st_ref_mutex and st_index_lock. remove_cdevs() does not wait for opens that are already past chrdev_open(), so an open that is blocked on st_ref_mutex while st_remove() holds it can take the mutex as soon as st_remove() drops it, find the freed tpnt in the idr and call kref_get() on it: BUG: KASAN: slab-use-after-free in st_open Write of size 4 ... st_open (drivers/scsi/st.c:254 drivers/scsi/st.c:1291) chrdev_open ... Freed by task ...: kfree st_remove (drivers/scsi/st.c:4512) Remove the index from the idr before dropping the reference, all under st_ref_mutex. A concurrent scsi_tape_get() now either runs first and holds a valid reference that keeps the tape alive, or runs afterwards and finds nothing, so st_open() fails with -ENXIO. This restores the ordering st_remove() had before the conversion to st_index_idr, where the tape was unpublished from scsi_tapes[] before the final kref_put().
02KernelScan AI Analysis
Risk summary
A local user with access to a SCSI tape device (/dev/st*) can race a device removal operation to trigger a use-after-free in the kernel. This can lead to kernel panic (denial of service) or potentially be exploited for privilege escalation. Systems with SCSI tape drives attached and accessible to non-root users are at risk.
Vulnerability analysis
The SCSI tape driver's device removal sequence released the last reference to a tape device before removing it from the internal lookup table. This created a race window where a concurrent open operation could locate the already-freed device in the table and attempt to use it, resulting in a use-after-free. The fix changes the removal order so the device is removed from the lookup table while its reference is still held, guaranteeing that any open either finds a valid device or fails cleanly. The flaw requires local access to the tape device file and the ability to race against a device removal (normally triggered by an administrator or physical disconnection), making it a local privilege escalation or denial-of-service issue.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 3.7 | 5.10.273 | 7d7f9d2ee4b0 |
| 5.15 | 3.7 | 5.15.224 | d9517fc39ec3 |
| 6.1 | 3.7 | 6.1.191 | e7a5da4a4820 |
| 6.12 | 3.7 | 6.12.115 | 5ef230f734e0 |
| 6.18 | 3.7 | 6.18.59 | a1647b653549 |
| 6.6 | 3.7 | 6.6.161 | 00ff1128123d |
| 7.2 | 3.7 | 7.2.13 | 18a0e3733ce3 |
| mainline | 3.7 | 7.3 | 71caf7f84bd6 |
| cip/6.12 | 3.7 | 6.12.117-cip35 | 5ef230f734e0 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.117-cip35 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip137) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip137-rt51) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip116) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |