Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2479A315D24 for ; Wed, 15 Oct 2025 07:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760515133; cv=none; b=UCWpx6OqICeRMyzP6GC2qpXkD3JxFMdTCszyjEeHG4Y725h5q8mNd2b8Ujwu2Gl5uv8bVSxySaDreqhjbu6IVQLXJhZOl5QTC0p0AQ3iRfYslcJ4WpiUVxfUQOoNM6PwLZRzrYsHPczNbMYxMYzJZo1/+iU/hGf87JJUFXdk6dc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760515133; c=relaxed/simple; bh=ZuHZOG5Ch0cJwlHGigzDk8R+jnfisUezQ9uEx1br+O4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bMLngRbw5ipsVCj0lf0ayP6osmdIO5FNEyAiAEtyu2jyfg6VecRitHdfLxfxwV3VYeSxFl2nRk+mwkBXmCAEBodX8Cy95UOt54DJ12UtQm75fGhtx7kWZ7fi5fe+b4pyOJHWptIALtDOFmJwh3fAzzxKLen9KnI2UrU0KbHkl6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hPj4ZuWT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hPj4ZuWT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94524C4CEF9; Wed, 15 Oct 2025 07:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760515133; bh=ZuHZOG5Ch0cJwlHGigzDk8R+jnfisUezQ9uEx1br+O4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hPj4ZuWTmwD99Hmt21FstMpH05Cr1CCBgs7ReIim4MmxqQfiqZj9HeZPcVlZ0j4YA nX1VAo3UzxB1tbV1TUIRBUzvy3HnfQmaelv9nO+E4qAOoKuvO8lM4EkDhgWdb3BbTf yIiSE4xEyTuHrk2Q7l0+Go5/28W2j3I+ikmaluLU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39997: ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free Date: Wed, 15 Oct 2025 09:58:34 +0200 Message-ID: <2025101528-CVE-2025-39997-4384@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2756; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=H64mvm2O3Z9iYiuH5EUXrlg2iGZe0491wVgOf7eaxn8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnvQ1TLFxnJTf/7InQ6X+XvrzM0Mng2Cp1rnz/rScdEJ sWMzt1RHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRKR4MczhehG2Lmth+7/gS 79NxLZ3lMQkeLAzzzHgefd7f/3XKn3MfTNoXXNhdH3DtLgA= 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: ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free The previous commit 0718a78f6a9f ("ALSA: usb-audio: Kill timer properly at removal") patched a UAF issue caused by the error timer. However, because the error timer kill added in this patch occurs after the endpoint delete, a race condition to UAF still occurs, albeit rarely. Additionally, since kill-cleanup for urb is also missing, freed memory can be accessed in interrupt context related to urb, which can cause UAF. Therefore, to prevent this, error timer and urb must be killed before freeing the heap memory. The Linux kernel CVE team has assigned CVE-2025-39997 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1 and fixed in 6.16.11 with commit af600e7f5526d16146b3ae99f6ad57bfea79ca33 Issue introduced in 6.16 with commit 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1 and fixed in 6.17.1 with commit 353d8c715cc951a980728133c9dd64ca5a0a186c Issue introduced in 6.16 with commit 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1 and fixed in 6.18-rc1 with commit 9f2c0ac1423d5f267e7f1d1940780fc764b0fee3 Issue introduced in 6.15.3 with commit 62066758d2ae169278e5d6aea5995b1b6f6ddeb5 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-2025-39997 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: sound/usb/midi.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/dc4874366cf6cf4a31d8fa4b7f0e2a5b2d7647ba https://git.kernel.org/stable/c/647d6b8d22be12842fde6ed0c56859ebc615f21e https://git.kernel.org/stable/c/af600e7f5526d16146b3ae99f6ad57bfea79ca33 https://git.kernel.org/stable/c/353d8c715cc951a980728133c9dd64ca5a0a186c https://git.kernel.org/stable/c/9f2c0ac1423d5f267e7f1d1940780fc764b0fee3