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 D0A7D25F963 for ; Tue, 20 May 2025 15:24: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=1747754672; cv=none; b=kqdwQkbZUBkJZW8wqcZcEXKME5icMIFyNYk4PKwwR1XmDL6Y8Wsk8RL74MqbsBesM7VSRWsXrbhJNXFxAkJOdvGI0E0iZUiPbeYIKHtU96daVr+gWkC+4nmGRyI7KvV+VljnIP2GCaOemjwzcz2CIETfZfSpIh6qgIWpKsjmAqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747754672; c=relaxed/simple; bh=lS8y5BKLNAVECcCk64uNBJLN2HO81eB6QqNiiM0ylvc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=n1qu5tyZkaMKn1ilZu5xEgFujcaJR3ZQPChHV2xdWMERFH5IfRTG6v67uOsK0eedZ6EvitpYVhB50T5zTzMXK3bz8Qg2vLHO6K6p/daQCPpXzo6D5nfT7+CbQjFrx0cyM76fLXGZ6eWFr2mBjVaxDRN0C+cMaTcbCmO42HVNdFU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tcAD/DvR; 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="tcAD/DvR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 604ACC4CEEA; Tue, 20 May 2025 15:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747754672; bh=lS8y5BKLNAVECcCk64uNBJLN2HO81eB6QqNiiM0ylvc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=tcAD/DvRZPsrXsYby8B4aevWV9n3vBYRHaWzxjNtSXI8atj9Jtm8arZ+djzKjF+0b gzoTlWGDS7BFrotEqadisFn+nzHT1BsBrCG+pt2dr6tHE+2CO2RleXcT/rCf6Nr5+7 M7212d169dvaQf9rFUPGzX+9SOORaADH9JIOduHg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37927: iommu/amd: Fix potential buffer overflow in parse_ivrs_acpihid Date: Tue, 20 May 2025 17:22:23 +0200 Message-ID: <2025052004-CVE-2025-37927-5e21@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=3380; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3gq8M7Z8Wvs6dqIFZLwPSMdmV3FVYxEVVXNgi3kX7ys=; b=owGbwMvMwCRo6H6F97bub03G02pJDBk682Q+3XTrtjdZ1cq7+EH4lDm84lsm+z7gvRL0Kltmy 9yD75YEdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEHs5mmCsw/d9xE4edGz/n 2TetPjn106/ZqQ8Z5kddXbzv3LuOl4/VZGwnTLd+cGKb4xYA 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: iommu/amd: Fix potential buffer overflow in parse_ivrs_acpihid There is a string parsing logic error which can lead to an overflow of hid or uid buffers. Comparing ACPIID_LEN against a total string length doesn't take into account the lengths of individual hid and uid buffers so the check is insufficient in some cases. For example if the length of hid string is 4 and the length of the uid string is 260, the length of str will be equal to ACPIID_LEN + 1 but uid string will overflow uid buffer which size is 256. The same applies to the hid string with length 13 and uid string with length 250. Check the length of hid and uid strings separately to prevent buffer overflow. Found by Linux Verification Center (linuxtesting.org) with SVACE. The Linux kernel CVE team has assigned CVE-2025-37927 to this issue. Affected and fixed versions =========================== Issue introduced in 4.7 with commit ca3bf5d47cec8b7614bcb2e9132c40081d6d81db and fixed in 5.15.182 with commit 466d9da267079a8d3b69fa72dfa3a732e1f6dbb5 Issue introduced in 4.7 with commit ca3bf5d47cec8b7614bcb2e9132c40081d6d81db and fixed in 6.1.138 with commit c3f37faa71f5d26dd2144b3f2b14525ec8f5e41f Issue introduced in 4.7 with commit ca3bf5d47cec8b7614bcb2e9132c40081d6d81db and fixed in 6.6.90 with commit 13d67528e1ae4486e9ab24b70122fab104c73c29 Issue introduced in 4.7 with commit ca3bf5d47cec8b7614bcb2e9132c40081d6d81db and fixed in 6.12.28 with commit 10d901a95f8e766e5aa0bb9a983fb41271f64718 Issue introduced in 4.7 with commit ca3bf5d47cec8b7614bcb2e9132c40081d6d81db and fixed in 6.14.6 with commit c8bdfc0297965bb13fa439d36ca9c4f7c8447f0f Issue introduced in 4.7 with commit ca3bf5d47cec8b7614bcb2e9132c40081d6d81db and fixed in 6.15-rc5 with commit 8dee308e4c01dea48fc104d37f92d5b58c50b96c 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-37927 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/iommu/amd/init.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/466d9da267079a8d3b69fa72dfa3a732e1f6dbb5 https://git.kernel.org/stable/c/c3f37faa71f5d26dd2144b3f2b14525ec8f5e41f https://git.kernel.org/stable/c/13d67528e1ae4486e9ab24b70122fab104c73c29 https://git.kernel.org/stable/c/10d901a95f8e766e5aa0bb9a983fb41271f64718 https://git.kernel.org/stable/c/c8bdfc0297965bb13fa439d36ca9c4f7c8447f0f https://git.kernel.org/stable/c/8dee308e4c01dea48fc104d37f92d5b58c50b96c