Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792759121; b=XTOUXXIy5NasZNWveABTy6RKfeqpMyyX+kacfXChC89RavQte4yzQUIjBWefW//7cTEp ycIsYr8SPzt0bTDRdu6iU7TLSzzRbZyp/YwsF0ExbJFX+lJlxdpUUwpHpoZpywcYMsS5x BsaWt/SRoVuVCnP3UuqPqpulhH+2KseyW1NtoL/moPeIN2aSe1IW5rQAgM6hOp0HloZPO tz6zraJhhb4HlnjEEvg9hKXAL+SWYQ0zzM/dG2CUF9n/HzxHKUe+1MqRTN8Cso8k5YadF rMDEz/n8LU/YuqINGbapZE6YnkiezWyBVrGyrolrnVJnO1q22C+piNdkpWJmt/yxHAQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792759121; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=lBW5eQDAeTs774dRlSdPOjRAERS0yvYXQyJzIySBRM0=; b=bmCV6CIvpoof52rJoiadgJT8zzGwAM/ucFAOJ1SWwAZkVjHn4DqkdMxZ3EqxL7IqK+oD vFEwLYMLIqlBU2BZPoMiIazXEux2pay1XH4Lm4eTA3pwX7L7OxVWfVa1BzSlN3M7Bnpi0 I9yqB+HyCb6l6F04+TwGN72rtfDuLXSbE8cUWmOJyloB5WptUDy3ALN2laDUOF/U0/1uj DVRI9JuKzqHulShCzXs0A9A9/P7lGSAUK6TUGGPcYyKUlDiNy6hOjowJoAyvDLjw7w4uS hs898u8If5lJEgkHT+dl3dq9eZEtqFA2XG/r7SS4Xaf+KNaTGPVQ6qSWiqCmuJQwaQw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=mGNQ4CCn; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AB4C606A31A for ; Fri, 23 Oct 2026 12:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=mGNQ4CCn Received: by smtp.kernel.org (Postfix) with ESMTPSA id 657821F01825; Fri, 23 Oct 2026 12:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792759121; bh=lBW5eQDAeTs774dRlSdPOjRAERS0yvYXQyJzIySBRM0=; h=From:To:Cc:Subject:Date:Reply-To; b=mGNQ4CCnqlBH8shm5sReMbT6b2mLaUPo/208d8BEDagTeU6focGFC4+vQQfsq9cXT oEgpf6rd0NlD05Pqx7kuK2s1F3V1REvhj7ogF9+qCXdxkVBuMuIlv4WAeE9ZlyJkzx UJQn1r5FPTZ1RbRuCCLGaX48J7t0Xotfh1rmRdGk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99039: memstick: core: wait for request completion before freeing card Date: Fri, 23 Oct 2026 14:20:41 +0200 Message-ID: <2026102326-CVE-2026-99039-a0df@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4787; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4JlPtOKC1IYpPXlKk3BeykFD+hKTwy5jTg79YMjlUBE=; b=owGbwMvMwCRo6H6F97bub03G02pJDFm3A85tvJK62F1j+/OKroOHb919Lmfn9krvxfq7DPu/M L1688doWUcsC4MgE4OsmCLLl208R/dXHFL0MrQ9DTOHlQlkCAMXpwBMxPgIw4KlVZMezXTK27j8 pO+/Z7URut/V9mYyLOiMNZQ/p/AzxGS9gNp0R87OaediwgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: memstick: core: wait for request completion before freeing card In memstick_alloc_card() and memstick_set_rw_addr(), wait_for_completion_timeout() 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 memstick_host for in-flight requests. If wait_for_completion_timeout() expires (for instance, when a USB transfer or command retry is delayed), memstick_alloc_card() returns an error and frees the memstick_dev structure via kfree(card). However, the host controller driver (such as rtsx_usb_ms) 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 ms_read_bytes+0x8fe/0x990 Write of size 1 at addr ffff88813c188079 by task kworker/1:5/5239 Workqueue: events rtsx_usb_ms_handle_req Call Trace: ms_read_bytes+0x8fe/0x990 drivers/memstick/host/rtsx_usb_ms.c:450 rtsx_usb_ms_issue_cmd drivers/memstick/host/rtsx_usb_ms.c:477 [inline] rtsx_usb_ms_handle_req+0x557/0x1a00 drivers/memstick/host/rtsx_usb_ms.c:531 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 Allocated by task 1662: memstick_alloc_card drivers/memstick/core/memstick.c:383 [inline] memstick_check+0x2c1/0x10d0 drivers/memstick/core/memstick.c:452 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 Freed by task 1662: kfree+0x20c/0x650 mm/slub.c:6792 memstick_alloc_card drivers/memstick/core/memstick.c:420 [inline] memstick_check+0x72b/0x10d0 drivers/memstick/core/memstick.c:452 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 Host controller drivers (rtsx_usb_ms, jmb38x_ms, tifm_ms, r592) already implement their own hardware and bus timeouts, and callers in mspro_block and ms_block already rely on wait_for_completion() unconditionally. Replace wait_for_completion_timeout() with wait_for_completion() in memstick_set_rw_addr() and memstick_alloc_card() so that the card structure is never freed while an asynchronous request is in flight. The Linux kernel CVE team has assigned CVE-2026-99039 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.25 with commit baf8532a147d5b76681ce040e2c8f25a3f0e718d and fixed in 6.6.160 with commit c3ab92542475d59ae685cbb294e70ca4d0ba38e9 Issue introduced in 2.6.25 with commit baf8532a147d5b76681ce040e2c8f25a3f0e718d and fixed in 6.12.113 with commit 810580cf60edc75c9891c2de3225e4cda78e4d9f Issue introduced in 2.6.25 with commit baf8532a147d5b76681ce040e2c8f25a3f0e718d and fixed in 6.18.57 with commit f2795c50144d528dabc2cf2fd53c0f0c63a823a1 Issue introduced in 2.6.25 with commit baf8532a147d5b76681ce040e2c8f25a3f0e718d and fixed in 7.2.11 with commit 3af81770e2011c6ac7bb597a4af2e4f3591f928c Issue introduced in 2.6.25 with commit baf8532a147d5b76681ce040e2c8f25a3f0e718d and fixed in 7.3 with commit aa0a37b5024d921e96ac4f8f487c8bfbf1f1a582 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-99039 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/memstick/core/memstick.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/c3ab92542475d59ae685cbb294e70ca4d0ba38e9 https://git.kernel.org/stable/c/810580cf60edc75c9891c2de3225e4cda78e4d9f https://git.kernel.org/stable/c/f2795c50144d528dabc2cf2fd53c0f0c63a823a1 https://git.kernel.org/stable/c/3af81770e2011c6ac7bb597a4af2e4f3591f928c https://git.kernel.org/stable/c/aa0a37b5024d921e96ac4f8f487c8bfbf1f1a582