CVE-2026-99039: memstick: core: wait for request completion before freeing card

Published Oct 23, 2026
·
Updated

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

memstick: core: wait for request completion before freeing card

In memstickalloccard() and memsticksetrwaddr(), waitforcompletiontimeout() is used to wait for device identification and address configuration requests to complete.

The memstick subsystem does not provide an abort or cancellation callback in struct memstickhost for in-flight requests. If waitforcompletiontimeout() expires (for instance, when a USB transfer or command retry is delayed), memstickalloccard() returns an error and frees the memstickdev structure via kfree(card).

However, the host controller driver (such as rtsxusbms) is still running the request asynchronously in worker context. When the transfer eventually finishes, the driver writes into host->req->data, which points to memory inside the already freed card structure. This leads to a KASAN slab-use-after-free write:

BUG: KASAN: slab-use-after-free in msreadbytes+0x8fe/0x990 Write of size 1 at addr ffff88813c188079 by task kworker/1:5/5239 Workqueue: events rtsxusbmshandlereq Call Trace: msreadbytes+0x8fe/0x990 drivers/memstick/host/rtsxusbms.c:450 rtsxusbmsissuecmd drivers/memstick/host/rtsxusbms.c:477 [inline] rtsxusbmshandlereq+0x557/0x1a00 drivers/memstick/host/rtsxusbms.c:531 processonework+0xac7/0x1b10 kernel/workqueue.c:3396 workerthread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436

Allocated by task 1662: memstickalloccard drivers/memstick/core/memstick.c:383 [inline] memstickcheck+0x2c1/0x10d0 drivers/memstick/core/memstick.c:452 processonework+0xac7/0x1b10 kernel/workqueue.c:3396

Freed by task 1662: kfree+0x20c/0x650 mm/slub.c:6792 memstickalloccard drivers/memstick/core/memstick.c:420 [inline] memstickcheck+0x72b/0x10d0 drivers/memstick/core/memstick.c:452 processonework+0xac7/0x1b10 kernel/workqueue.c:3396

Host controller drivers (rtsxusbms, jmb38xms, tifmms, r592) already implement their own hardware and bus timeouts, and callers in msproblock and msblock already rely on waitforcompletion() unconditionally.

Replace waitforcompletiontimeout() with waitforcompletion() in memsticksetrwaddr() and memstickalloccard() so that the card structure is never freed while an asynchronous request is in flight.

Affected Software

1 affected component
Linux Linux kernel

Event History

Oct 23, 2026
CVE Published
via MITRE·12:21 PM
Data Sourced
via MITRE·12:21 PM
Description

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