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 113BF45C10 for ; Wed, 1 May 2024 05:31:20 +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=1714541480; cv=none; b=qXFq67u+Xj4/IuzRfq/pkp0Vmbo4ML4Q3N+r5AqljBR66FxI2HiJUeqLfxS0YUqLKgs5jUhW5Ylyfao9y/ZVOaxpIFTvqP64pp4w6s67ecyu2KSId2Mx6snZGw6AreA0WIRsDEdFUmngO2xFsTK+zMY6vIHUpMxlwl7ng5vbgmQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714541480; c=relaxed/simple; bh=ifNAGJknjCqoAQlh0LxNcPCtOjbx9gC2ShNjTIEdl6c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qViqR/aTIJXOoth59cP3NWFYoNZYTNyOslMYfFMa5/sBuM2NpRGlNxV4LRiSsq4iwa6bm/chIqaaJI9MFr3HiwpCRDVaPKjYnHDTx1Sa3RAXZpUhJXMd7/1oPYvcdWHVdwTgEKJT7MBeMZkCHcmVi5jCdeIaby92blsuSd2+yrc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1FmXeQsO; 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="1FmXeQsO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8862CC4AF1D; Wed, 1 May 2024 05:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714541479; bh=ifNAGJknjCqoAQlh0LxNcPCtOjbx9gC2ShNjTIEdl6c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=1FmXeQsOggf0xDDCEV+likS3/AoB8s322eMVJYdeio+h3hgxKZSOey8EBVfs+HXt3 qV5XAtI/XOblRoR4PQZFRguBrfkZXkPhcgMQaj4gSpzufSZFLt5pH4rgsDrmw9DzGU cYs2xZhBWdOr0GYNiizeLyI9XCIE6mqqnH8N/Wm8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26995: usb: typec: tcpm: Correct the PDO counting in pd_set Date: Wed, 1 May 2024 07:30:56 +0200 Message-ID: <2024050144-CVE-2024-26995-ac9b@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=2609; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ifNAGJknjCqoAQlh0LxNcPCtOjbx9gC2ShNjTIEdl6c=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmGl1tjp0sfODSdW9043cMnVHqjwRudaiW/co/rMtLqu 4VKI0U7YlkYBJkYZMUUWb5s4zm6v+KQopeh7WmYOaxMIEMYuDgFYCLOPxkWLNll6+H4+ZpewWFR 5geetkkTWmvCGeYK338TWlS9fraY83amE/IeAbXaZlsA 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: Correct the PDO counting in pd_set Off-by-one errors happen because nr_snk_pdo and nr_src_pdo are incorrectly added one. The index of the loop is equal to the number of PDOs to be updated when leaving the loop and it doesn't need to be added one. When doing the power negotiation, TCPM relies on the "nr_snk_pdo" as the size of the local sink PDO array to match the Source capabilities of the partner port. If the off-by-one overflow occurs, a wrong RDO might be sent and unexpected power transfer might happen such as over voltage or over current (than expected). "nr_src_pdo" is used to set the Rp level when the port is in Source role. It is also the array size of the local Source capabilities when filling up the buffer which will be sent as the Source PDOs (such as in Power Negotiation). If the off-by-one overflow occurs, a wrong Rp level might be set and wrong Source PDOs will be sent to the partner port. This could potentially cause over current or port resets. The Linux kernel CVE team has assigned CVE-2024-26995 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit cd099cde4ed2 and fixed in 6.8.8 with commit f3da3192cdd3 Issue introduced in 6.8 with commit cd099cde4ed2 and fixed in 6.9-rc5 with commit c4128304c216 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-26995 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/f3da3192cdd3fefe213390e976eec424a8e270b5 https://git.kernel.org/stable/c/c4128304c2169b4664ed6fb6200f228cead2ab70