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 F1FD42522A7 for ; Thu, 4 Sep 2025 15:34:08 +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=1757000049; cv=none; b=kymr2qSC0Jsd0PuKZqFsxNCzvRjwCYg4TO1rmfwDcxPNV59JsG/EPO8Lj8ZjZIO6yhw2hRQywu2TfQ0hL4JSftkf0GsclALYAgduRulQSg1xft6rF7LJZh/nrqTir/meV6dFDWRZca7hgYxotmKYEB9GwyOUisyNcuUQXiPnq7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757000049; c=relaxed/simple; bh=H+Q3kn+/QQD+bVprOu7Qik9r7e1lsJpul7zQMzFMlnw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Li47CI472GR2CvqqOgOHGvsLGLs+Z2WATIVxmi2dfNF5SUf1Z1SxNMvcUSDpEShEVTawZHZIZISeRcE4cFaLEb0yEnvewQsE/OVjqQA+rhLVrPtjZH6XFngfkEjYdxsyeCIjFQRbeq8yCvfPZsefK5BYkParS//bOQFCPxVKnMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GKYwZ9nh; 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="GKYwZ9nh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DD39C4CEF0; Thu, 4 Sep 2025 15:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757000048; bh=H+Q3kn+/QQD+bVprOu7Qik9r7e1lsJpul7zQMzFMlnw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=GKYwZ9nhl5n/MPyAaTdgl9uW7T8BWrTCs7TRj1DBCfcZqRbugoUT28KINqSXydiAh y0UVVgpbTqrrgGmhkZLIJYlIXIY9fW1gGN+1h08Yu2/pM4plSuGh9tTowbm9LDQA4p iyatmRQVLE81/lnsMFLKQevEkmp56W7gAesy5n3U= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38688: iommufd: Prevent ALIGN() overflow Date: Thu, 4 Sep 2025 17:32:53 +0200 Message-ID: <2025090448-CVE-2025-38688-6e94@gregkh> X-Mailer: git-send-email 2.51.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=2940; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+MQ1Z0I/67RbtsiEy8RieJ+atG3XWFlQNnObIKF9wHE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBk7NyoYff365mXTx2faWvF3+uevWsfR6xX66Ur2+jr29 6r7Tm/K74hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJPG5mWNDz+bhc9RTjjzek zGPn26rIZHSdPs0wv0DA5m+ySHvlh/ycYNu160+Yfdu/DgA= 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: iommufd: Prevent ALIGN() overflow When allocating IOVA the candidate range gets aligned to the target alignment. If the range is close to ULONG_MAX then the ALIGN() can wrap resulting in a corrupted iova. Open code the ALIGN() using get_add_overflow() to prevent this. This simplifies the checks as we don't need to check for length earlier either. Consolidate the two copies of this code under a single helper. This bug would allow userspace to create a mapping that overlaps with some other mapping or a reserved range. The Linux kernel CVE team has assigned CVE-2025-38688 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit 51fe6141f0f64ae0bbc096a41a07572273e8c0ef and fixed in 6.6.103 with commit d19b817540c0abe84854a64ee9ee34cecc3bbeef Issue introduced in 6.2 with commit 51fe6141f0f64ae0bbc096a41a07572273e8c0ef and fixed in 6.12.43 with commit ebb6021560b94649bec6b8faba6fe0dca2218e81 Issue introduced in 6.2 with commit 51fe6141f0f64ae0bbc096a41a07572273e8c0ef and fixed in 6.15.11 with commit e42a046bb41dcdde4f766a17d8211842007ed537 Issue introduced in 6.2 with commit 51fe6141f0f64ae0bbc096a41a07572273e8c0ef and fixed in 6.16.2 with commit 79fad1917802c28de51a479318a056a6fbe3e2f2 Issue introduced in 6.2 with commit 51fe6141f0f64ae0bbc096a41a07572273e8c0ef and fixed in 6.17-rc1 with commit b42497e3c0e74db061eafad41c0cd7243c46436b 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-38688 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/iommufd/io_pagetable.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/d19b817540c0abe84854a64ee9ee34cecc3bbeef https://git.kernel.org/stable/c/ebb6021560b94649bec6b8faba6fe0dca2218e81 https://git.kernel.org/stable/c/e42a046bb41dcdde4f766a17d8211842007ed537 https://git.kernel.org/stable/c/79fad1917802c28de51a479318a056a6fbe3e2f2 https://git.kernel.org/stable/c/b42497e3c0e74db061eafad41c0cd7243c46436b