REDHAT-BUG-2562680: Use After Free

Published Oct 28, 2026
·
Updated

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

scsi: st: Fix use-after-free race between stremove() and stopen()

stremove() drops the probe reference on the scsitape with krefput() and only afterwards removes its index from stindexidr. If that was the last reference, scsitaperelease() frees the structure while it is still published in the idr.

scsitapeget(), called from stopen(), looks up the tape in stindexidr and takes a reference under strefmutex and stindexlock. removecdevs() does not wait for opens that are already past chrdevopen(), so an open that is blocked on strefmutex while stremove() holds it can take the mutex as soon as stremove() drops it, find the freed tpnt in the idr and call krefget() on it:

BUG: KASAN: slab-use-after-free in stopen Write of size 4 ... stopen (drivers/scsi/st.c:254 drivers/scsi/st.c:1291) chrdevopen ... Freed by task ...: kfree stremove (drivers/scsi/st.c:4512)

Remove the index from the idr before dropping the reference, all under strefmutex. A concurrent scsitapeget() now either runs first and holds a valid reference that keeps the tape alive, or runs afterwards and finds nothing, so stopen() fails with -ENXIO.

This restores the ordering stremove() had before the conversion to stindexidr, where the tape was unpublished from scsitapes[] before the final krefput().

Affected Software

1 affected component
Linux Linux kernel

Event History

Oct 28, 2026
Data Sourced
via Red Hat·10:48 AM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

When can this race be triggered?

The race requires a concurrent tape-device removal and an attempt to open the corresponding SCSI tape character device. The open must have progressed past chrdev_open() and contend on st_ref_mutex while st_remove() is running.

2

What is the likely impact of a successful race?

A concurrent open can retrieve a freed scsi_tape structure from the index and perform kref_get() on it, causing a slab use-after-free. The reported manifestation is a KASAN use-after-free in st_open().

3

How can systems determine whether they are exposed to this condition?

Systems using the Linux kernel SCSI tape driver and performing tape-device removal while the device may be opened concurrently are relevant to this race. Evidence may include KASAN reports identifying a slab-use-after-free in st_open(), with st_remove() shown as freeing the object.

4

What does the available fix change?

The fix removes the tape index from st_index_idr before dropping the final reference, while holding st_ref_mutex. This makes a concurrent open either obtain a valid reference before removal or find no indexed tape after removal.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203