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 3B46628D8D1 for ; Wed, 18 Jun 2025 11:13:13 +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=1750245194; cv=none; b=t5t5Ym8VwGQ8mFH1KANiOuhn8LKZAldkRphncIDuyDaBqgp+xJU82/2wN0/XVdwuuhtUOAAznaxy9GfTV4iASxT9OlZS61i+k2p9hgSs5qo6ie80RGWWof+RPAHLf36pRQMNAiD9t/TVf8XP0XWioYwnV0CsMI4X8CQKbvNJvWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245194; c=relaxed/simple; bh=xpP+v26HOpesTjYPJTfDtWPH6ZH5wDTI/9JGlHbyG00=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=orV/d/+wgfW+CfKBvbkz+jkFaWd5qoJ0yi2MzKaAnTjZTu7+VDFrKV0IYGK50uxeEUSzsbUSdxjO48vw/uGPCzBw5CtMAB8OKAxW8/jSX/CdGA3ofJxj3k1b7AFOBO7ASmZQuXRxsmblEcPWrEYCMZ6smIZbVLDWl1rNfiA+Z+w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DCQejv17; 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="DCQejv17" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 528CCC4CEE7; Wed, 18 Jun 2025 11:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245193; bh=xpP+v26HOpesTjYPJTfDtWPH6ZH5wDTI/9JGlHbyG00=; h=From:To:Cc:Subject:Date:Reply-to:From; b=DCQejv17U0qD/bgfhnPhAuCd7sHUX2XMptImLdIfGmTwsErLiA0hZOfj7jN/rSp5F rQc78Cs3jngRcswkJJ1QTig1CrTEdnDcqr4O7MS8AvTgXs06at2ghZTlj5pZs7Iotn TJqABfRdh/bHoHy8s15SbVfaix8NIW4OIdzihl2U= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50156: HID: cp2112: prevent a buffer overflow in cp2112_xfer() Date: Wed, 18 Jun 2025 13:03:41 +0200 Message-ID: <2025061824-CVE-2022-50156-3e2e@gregkh> X-Mailer: git-send-email 2.49.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=3344; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2DlysS1tc72Yz5BDLlXt+fbolFkRjaE1WnnbX+CU7EI=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc1oKDOdNV/RiXhgZvV6ao/Rhpk/52qQtfxeaOZYV/ um3U+ruiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIkwH2SYZ+Aw4X/l64bzNVEy yw/FLL3N+IR5BcP88uZKVa/FoQGNfrdLfXj2ZDnXdtkAAA== 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: HID: cp2112: prevent a buffer overflow in cp2112_xfer() Smatch warnings: drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'data->block[1]' too small (33 vs 255) drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'buf' too small (64 vs 255) The 'read_length' variable is provided by 'data->block[0]' which comes from user and it(read_length) can take a value between 0-255. Add an upper bound to 'read_length' variable to prevent a buffer overflow in memcpy(). The Linux kernel CVE team has assigned CVE-2022-50156 to this issue. Affected and fixed versions =========================== Issue introduced in 4.15 with commit 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 and fixed in 4.19.256 with commit 3af7d60e9a6c17d6d41c4341f8020511887d372d Issue introduced in 4.15 with commit 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 and fixed in 5.4.211 with commit 519ff31a6ddd87aa4905bd9bf3b92e8b88801614 Issue introduced in 4.15 with commit 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 and fixed in 5.10.137 with commit ebda3d6b004bb6127a66a616524a2de152302ca7 Issue introduced in 4.15 with commit 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 and fixed in 5.15.61 with commit 8489a20ac481b08c0391608d81ed3796d373cfdf Issue introduced in 4.15 with commit 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 and fixed in 5.18.18 with commit e7028944e61014ae915e7fb74963d3835f2f761a Issue introduced in 4.15 with commit 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 and fixed in 5.19.2 with commit 26e427ac85c2b8d0d108cc80b6de34d33e2780c4 Issue introduced in 4.15 with commit 542134c0375b5ca2b1d18490c02b8a20bfdd8d74 and fixed in 6.0 with commit 381583845d19cb4bd21c8193449385f3fefa9caf 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-2022-50156 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/hid/hid-cp2112.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/3af7d60e9a6c17d6d41c4341f8020511887d372d https://git.kernel.org/stable/c/519ff31a6ddd87aa4905bd9bf3b92e8b88801614 https://git.kernel.org/stable/c/ebda3d6b004bb6127a66a616524a2de152302ca7 https://git.kernel.org/stable/c/8489a20ac481b08c0391608d81ed3796d373cfdf https://git.kernel.org/stable/c/e7028944e61014ae915e7fb74963d3835f2f761a https://git.kernel.org/stable/c/26e427ac85c2b8d0d108cc80b6de34d33e2780c4 https://git.kernel.org/stable/c/381583845d19cb4bd21c8193449385f3fefa9caf