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 DB60643AD9 for ; Wed, 1 May 2024 05:23:31 +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=1714541011; cv=none; b=GoVIU/Th8F5fu4tPNhHakxSonjlET/LirG2QVPiqvewIcEleV75R80fAVHn3D9A739rfHE3qvbbN+y80zryJ7sscTkFROc1502E3byUaOHMbVYbtxcFLqE3b5gZfY67peqVO1XVSnPoCFNlhhFLm8xFFkp5DTrUnqmW4iwWu0DY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714541011; c=relaxed/simple; bh=8odRsPZA6qZ7IpEicI8zv5+rK8TDi6TEXdoAfLhLEH4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VVrtlj4WvMpLQJ3aqi3mb2JER+Y7EFHOS1M4YJU5otSX/VaeJ/8VGeVhDzu8zdIh5eApyGohdIG0phWegfV/ZH+cUYc//Cc/a6XEd4a2vqo2rja3wz47HsiRdnFwV0VQ37qxwfqqlj0tfU1QLVjgFZMlk75HAPFCGvsykNlN5pM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jeNj6MQ5; 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="jeNj6MQ5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63470C113CC; Wed, 1 May 2024 05:23:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714541011; bh=8odRsPZA6qZ7IpEicI8zv5+rK8TDi6TEXdoAfLhLEH4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jeNj6MQ5YNZzVraCbcAMUreQ6JCFN+4q4ubzB647moVJF210WLltSnPJ0/h3ZBoOX LIDF9JiGuiMTTxDEo78yblJ0lFwtm6Qlvln3Qw3XUI3wV2AeLIEUYNJxllS7j5Bvqz JWN0JEqQHn0z4h5CYOdGl3Io9VxGsq2h/4GedaCs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26932: usb: typec: tcpm: fix double-free issue in tcpm_port_unregister_pd() Date: Wed, 1 May 2024 07:21:23 +0200 Message-ID: <2024050123-CVE-2024-26932-587d@gregkh> X-Mailer: git-send-email 2.44.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=2942; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=8odRsPZA6qZ7IpEicI8zv5+rK8TDi6TEXdoAfLhLEH4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmGF4PnLtkyqanQ/f6aB1/5RMrDzThv2F5mevzijYyrR lbFdTPTjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIvTjDggUBljYZgW7rZJpX x+x3eZ87f0mkFsOC4xvu+a2V5vRTsuK2tVq0Zd0tftbJAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: usb: typec: tcpm: fix double-free issue in tcpm_port_unregister_pd() When unregister pd capabilitie in tcpm, KASAN will capture below double -free issue. The root cause is the same capabilitiy will be kfreed twice, the first time is kfreed by pd_capabilities_release() and the second time is explicitly kfreed by tcpm_port_unregister_pd(). [ 3.988059] BUG: KASAN: double-free in tcpm_port_unregister_pd+0x1a4/0x3dc [ 3.995001] Free of addr ffff0008164d3000 by task kworker/u16:0/10 [ 4.001206] [ 4.002712] CPU: 2 PID: 10 Comm: kworker/u16:0 Not tainted 6.8.0-rc5-next-20240220-05616-g52728c567a55 #53 [ 4.012402] Hardware name: Freescale i.MX8QXP MEK (DT) [ 4.017569] Workqueue: events_unbound deferred_probe_work_func [ 4.023456] Call trace: [ 4.025920] dump_backtrace+0x94/0xec [ 4.029629] show_stack+0x18/0x24 [ 4.032974] dump_stack_lvl+0x78/0x90 [ 4.036675] print_report+0xfc/0x5c0 [ 4.040289] kasan_report_invalid_free+0xa0/0xc0 [ 4.044937] __kasan_slab_free+0x124/0x154 [ 4.049072] kfree+0xb4/0x1e8 [ 4.052069] tcpm_port_unregister_pd+0x1a4/0x3dc [ 4.056725] tcpm_register_port+0x1dd0/0x2558 [ 4.061121] tcpci_register_port+0x420/0x71c [ 4.065430] tcpci_probe+0x118/0x2e0 To fix the issue, this will remove kree() from tcpm_port_unregister_pd(). The Linux kernel CVE team has assigned CVE-2024-26932 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit cd099cde4ed2 and fixed in 6.8.3 with commit 242e425ed580 Issue introduced in 6.8 with commit cd099cde4ed2 and fixed in 6.9-rc2 with commit b63f90487bdf 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-2024-26932 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/usb/typec/tcpm/tcpm.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/242e425ed580b2f4dbcb86c8fc03a410a4084a69 https://git.kernel.org/stable/c/b63f90487bdf93a4223ce7853d14717e9d452856