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 0D48B78C92 for ; Wed, 7 Aug 2024 15:26:32 +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=1723044392; cv=none; b=FfTDrJ43eFla7qhNM9dd2Rdo9HzyDsTXpIuQLgXG87itMS3Q3zfN/I9UdMBVnX7o1d3f7dhZx5JK+heO4kA1JahS2Ntdy2W8Poe1957UJRvFwcHRA1y4RKQk167WTZBaOUI/VVwI+ngcVua5OEBolDWhvrO4TI3tf9uPrQl99pw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723044392; c=relaxed/simple; bh=+yiCdgj8odTBxDbgxsDzcpuJ8144mo7rOK5PVeimPM4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Q4Q81hj2tX9LcvS2FCpmAGTcbPAx9xH/dRH/G/QoyafWOsKDbQ4EhhFheT5NcsPfNRgSrILK1lAJ5GW6LUtfsK3VcgMc0X2Hfx/Hh+9gGe46nJ2Sc13vD6OL5HJbM8rKPbajtsA97WTjkTv8xhuD45unkxBd9ctM9zD6x72TnQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mtUXHNEF; 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="mtUXHNEF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F783C32781; Wed, 7 Aug 2024 15:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723044391; bh=+yiCdgj8odTBxDbgxsDzcpuJ8144mo7rOK5PVeimPM4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=mtUXHNEFSFHboQlvAJeI3PUUc2EZvaI8DNB5bRa3B2jCH2lHMjUAfVliwV3aL2XK6 FzbK13y9jxQOZxe64A2azJjsIZBMkWtE25ef/pb3L754oCuCgyYB/c4YlwYFR4xlTE 3Jm4zgJoFucXs1Q37VxLs7Msrj3wACRyE8crqaHQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-42236: usb: gadget: configfs: Prevent OOB read/write in usb_string_copy() Date: Wed, 7 Aug 2024 17:14:42 +0200 Message-ID: <2024080740-CVE-2024-42236-365d@gregkh> X-Mailer: git-send-email 2.46.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=2652; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+yiCdgj8odTBxDbgxsDzcpuJ8144mo7rOK5PVeimPM4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmb+xNUsh+qbLvX13762KsNP3MFc7jnf2yTXjR31auYN bHRi5vOdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBETl5hmCunM9WirdO19kSn Tz4n8/91Kzc+F2GYn1qv89ExfPdWg+Qjv5a/aUlQ4G12AgA= 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: gadget: configfs: Prevent OOB read/write in usb_string_copy() Userspace provided string 's' could trivially have the length zero. Left unchecked this will firstly result in an OOB read in the form `if (str[0 - 1] == '\n') followed closely by an OOB write in the form `str[0 - 1] = '\0'`. There is already a validating check to catch strings that are too long. Let's supply an additional check for invalid strings that are too short. The Linux kernel CVE team has assigned CVE-2024-42236 to this issue. Affected and fixed versions =========================== Fixed in 4.19.318 with commit a444c3fc2641 Fixed in 5.4.280 with commit c95fbdde87e3 Fixed in 5.10.222 with commit e8474a10c535 Fixed in 5.15.163 with commit 72b8ee0d9826 Fixed in 6.1.100 with commit 2d16f63d8030 Fixed in 6.6.41 with commit d1205033e912 Fixed in 6.9.10 with commit eecfefad0953 Fixed in 6.10 with commit 6d3c721e686e 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-42236 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/gadget/configfs.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/a444c3fc264119801575ab086e03fb4952f23fd0 https://git.kernel.org/stable/c/c95fbdde87e39e5e0ae27f28bf6711edfb985caa https://git.kernel.org/stable/c/e8474a10c535e6a2024c3b06e37e4a3a23beb490 https://git.kernel.org/stable/c/72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce https://git.kernel.org/stable/c/2d16f63d8030903e5031853e79d731ee5d474e70 https://git.kernel.org/stable/c/d1205033e912f9332c1dbefa812e6ceb0575ce0a https://git.kernel.org/stable/c/eecfefad0953b2f31aaefa058f7f348ff39c4bba https://git.kernel.org/stable/c/6d3c721e686ea6c59e18289b400cc95c76e927e0