Skip to contentSkip to conversation

CVE-2026-31677: crypto: af_alg - limit RX SG extraction by receive buffer budget

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

crypto: af_alg - limit RX SG extraction by receive buffer budget

Make af_alg_get_rsgl() limit each RX scatterlist extraction to the remaining receive buffer budget.

af_alg_get_rsgl() currently uses af_alg_readable() only as a gate before extracting data into the RX scatterlist. Limit each extraction to the remaining af_alg_rcvbuf(sk) budget so that receive-side accounting matches the amount of data attached to the request.

If skcipher cannot obtain enough RX space for at least one chunk while more data remains to be processed, reject the recvmsg call instead of rounding the request length down to zero.

The Linux kernel CVE team has assigned CVE-2026-31677 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 4.14 with commit e870456d8e7c8d57c059ea479b5aadbb55ff4c3a and fixed in 6.12.83 with commit 9bf3e6ccfdcfe56ae3190d1ae987dacf1cfef4f9
	Issue introduced in 4.14 with commit e870456d8e7c8d57c059ea479b5aadbb55ff4c3a and fixed in 6.18.24 with commit 07c6f6ffe29009426f0bd4d3cfbb6308b8ea8453
	Issue introduced in 4.14 with commit e870456d8e7c8d57c059ea479b5aadbb55ff4c3a and fixed in 6.19.14 with commit 4a264b2614c73c96666e196bbabe0cead52bdba7
	Issue introduced in 4.14 with commit e870456d8e7c8d57c059ea479b5aadbb55ff4c3a and fixed in 7.0 with commit 8eceab19eba9dcbfd2a0daec72e1bf48aa100170

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-31677

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:
crypto/af_alg.c
crypto/algif_skcipher.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/9bf3e6ccfdcfe56ae3190d1ae987dacf1cfef4f9
	https://git.kernel.org/stable/c/07c6f6ffe29009426f0bd4d3cfbb6308b8ea8453
	https://git.kernel.org/stable/c/4a264b2614c73c96666e196bbabe0cead52bdba7
	https://git.kernel.org/stable/c/8eceab19eba9dcbfd2a0daec72e1bf48aa100170