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 3BB7232B10B for ; Tue, 19 May 2026 10:44: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=1779187473; cv=none; b=py0xs2wbN5ptLN4Bzs8dUvlW66ByQY2+NyzVxDdV0CnjGNMAaQgMD9a3vZToiu6eKGLiP3TgqFSTwrmM8M6Jf4bdg2uwaVVHVfKCmBC8QV1vRzvUZABPjwgemZq1CmOLmXhKVY00n/EDzV27v0Z7VcPAp6/wboMw2sZ8LnHHeKE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779187473; c=relaxed/simple; bh=8ab+EmtTF6D4HBZvd2ykq8QakAxNCHwD6wwQgwLq2DY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fRTXmURsiiClrZwG6J8dDHOCtWR+Ts2gUmlUKmSgmyc3i5oKtYLcaqPjWsvkVEFcEd+P7iZA28G5Rtf1MAOxbaKGZDE+xlma/WWlVT4jC6THST8nc2mhPV8ROH6y05sdInSF21hQo8m2Yn4cxbKUHzMxdoV/PwDZwqz/L/sg7bE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sTZLGatj; 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="sTZLGatj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D4C2C2BCB3; Tue, 19 May 2026 10:44:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1779187472; bh=8ab+EmtTF6D4HBZvd2ykq8QakAxNCHwD6wwQgwLq2DY=; h=From:To:Cc:Subject:Date:Reply-To:From; b=sTZLGatjF7LjlXMI7qcujayEKhRXqpwo47985JpQb+sZGxf3wOde3df1kAZP31Ofb 28Cwwdd/qZdYWNYbIkVEdlh766gBVMLEpeGv1Pvapjuceae7IWAAYznkLwaWGwV0W8 11irWdoJWZeUEVhW7QhQkyAsIQcDgSd92HMM1KPg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-43492: lib/crypto: mpi: Fix integer underflow in mpi_read_raw_from_sgl() Date: Tue, 19 May 2026 12:43:45 +0200 Message-ID: <2026051945-CVE-2026-43492-67e4@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4048; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vTROUxHB7Zxyg+hGKrW54qpaPp/g8qk4/sV1XVWebaE=; b=owGbwMvMwCRo6H6F97bub03G02pJDFk8dg81G4xe3V/ct1Sh85FOrPKNZddLnnnuXXDgR4ZDj cbmxMJdHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR48EMCxa3C2hPdzgrYPv4 gUIaz9nk3VVnvBkWrDr2MOhJ31uroAjdmDKW9XK6X6/WAQA= 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: lib/crypto: mpi: Fix integer underflow in mpi_read_raw_from_sgl() Yiming reports an integer underflow in mpi_read_raw_from_sgl() when subtracting "lzeros" from the unsigned "nbytes". For this to happen, the scatterlist "sgl" needs to occupy more bytes than the "nbytes" parameter and the first "nbytes + 1" bytes of the scatterlist must be zero. Under these conditions, the while loop iterating over the scatterlist will count more zeroes than "nbytes", subtract the number of zeroes from "nbytes" and cause the underflow. When commit 2d4d1eea540b ("lib/mpi: Add mpi sgl helpers") originally introduced the bug, it couldn't be triggered because all callers of mpi_read_raw_from_sgl() passed a scatterlist whose length was equal to "nbytes". However since commit 63ba4d67594a ("KEYS: asymmetric: Use new crypto interface without scatterlists"), the underflow can now actually be triggered. When invoking a KEYCTL_PKEY_ENCRYPT system call with a larger "out_len" than "in_len" and filling the "in" buffer with zeroes, crypto_akcipher_sync_prep() will create an all-zero scatterlist used for both the "src" and "dst" member of struct akcipher_request and thereby fulfil the conditions to trigger the bug: sys_keyctl() keyctl_pkey_e_d_s() asymmetric_key_eds_op() software_key_eds_op() crypto_akcipher_sync_encrypt() crypto_akcipher_sync_prep() crypto_akcipher_encrypt() rsa_enc() mpi_read_raw_from_sgl() To the user this will be visible as a DoS as the kernel spins forever, causing soft lockup splats as a side effect. Fix it. The Linux kernel CVE team has assigned CVE-2026-43492 to this issue. Affected and fixed versions =========================== Issue introduced in 4.4 with commit 2d4d1eea540b27c72488fd1914674c42473d53df and fixed in 6.6.140 with commit 2aa77a18dc7f2670497fe3ee5acbeda0b57659e5 Issue introduced in 4.4 with commit 2d4d1eea540b27c72488fd1914674c42473d53df and fixed in 6.12.88 with commit 26d3a97ad46c7a9226ec04d4bf35bd4998a97d16 Issue introduced in 4.4 with commit 2d4d1eea540b27c72488fd1914674c42473d53df and fixed in 6.18.30 with commit 8637dfb4c1d8a7026ef681f2477c6de8b71c4003 Issue introduced in 4.4 with commit 2d4d1eea540b27c72488fd1914674c42473d53df and fixed in 7.0.7 with commit 30e513e755bb381afce6fb57cdc8694136193f22 Issue introduced in 4.4 with commit 2d4d1eea540b27c72488fd1914674c42473d53df and fixed in 7.1-rc1 with commit 8c2f1288250a90a4b5cabed5d888d7e3aeed4035 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-2026-43492 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: lib/crypto/mpi/mpicoder.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/2aa77a18dc7f2670497fe3ee5acbeda0b57659e5 https://git.kernel.org/stable/c/26d3a97ad46c7a9226ec04d4bf35bd4998a97d16 https://git.kernel.org/stable/c/8637dfb4c1d8a7026ef681f2477c6de8b71c4003 https://git.kernel.org/stable/c/30e513e755bb381afce6fb57cdc8694136193f22 https://git.kernel.org/stable/c/8c2f1288250a90a4b5cabed5d888d7e3aeed4035