CVE-2026-31641: rxrpc: Fix RxGK token loading to check bounds
In the Linux kernel, the following vulnerability has been resolved:
rxrpc: Fix RxGK token loading to check bounds
rxrpcpreparsexdryfsrxgk() reads the raw key length and ticket length from the XDR token as u32 values and passes each through roundup(x, 4) before using the rounded value for validation and allocation. When the raw length is >= 0xfffffffd, roundup() wraps to 0, so the bounds check and kzalloc both use 0 while the subsequent memcpy still copies the original ~4 GiB value, producing a heap buffer overflow reachable from an unprivileged addkey() call.
Fix this by:
(1) Rejecting raw key lengths above AFSTOKENGKKEYMAX and raw ticket lengths above AFSTOKENGKTOKENMAX before rounding, consistent with the caps that the RxKAD path already enforces via AFSTOKENRKTIXMAX.
(2) Sizing the flexible-array allocation from the validated raw key length via structsizet() instead of the rounded value.
(3) Caching the raw lengths so that the later field assignments and memcpy calls do not re-read from the token, eliminating a class of TOCTOU re-parse.
The control path (valid token with lengths within bounds) is unaffected.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31641?
CVE-2026-31641 has been classified as a high-severity vulnerability due to its potential impact on the Linux kernel.
How do I fix CVE-2026-31641?
To fix CVE-2026-31641, ensure you update your Linux kernel to the latest stable version where this vulnerability has been patched.
What systems are affected by CVE-2026-31641?
CVE-2026-31641 affects system environments running vulnerable versions of the Linux kernel.
What is the nature of CVE-2026-31641?
CVE-2026-31641 involves a buffer bounds check issue in the rxrpc_preparse_xdr_yfs_rxgk() function within the Linux kernel.
Is CVE-2026-31641 being actively exploited?
As of now, there are no confirmed reports of CVE-2026-31641 being actively exploited in the wild.