KernelScan.io

CRITICAL Introduced in 3.9

sunrpc XdrBuf Underflow

CVE-2026-89551

CVSS 9.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI9.8CRITICAL

01

In the Linux kernel, the following vulnerability has been resolved: SUNRPC: xdr_buf_trim: clamp buf->len to avoid underflow xdr_buf_trim() trims `len` bytes from the tail of an xdr_buf by walking the tail, pages, and head iovecs. Each per-section step uses min_t() so it never removes more bytes than that section holds, but the final accounting at the fix_len label subtracts the total bytes actually consumed from buf->len without any clamp: fix_len: buf->len -= (len - trim); When the caller has set buf->len to a value smaller than the sum of the iov_lens, (len - trim) can exceed buf->len and the unsigned subtraction wraps to near UINT_MAX. gss_krb5_unwrap_v2() reaches xdr_buf_trim() in exactly that state: buf->head[0].iov_len -= GSS_KRB5_TOK_HDR_LEN + headskip; buf->len = len - (GSS_KRB5_TOK_HDR_LEN + headskip); xdr_buf_trim(buf, ec + GSS_KRB5_TOK_HDR_LEN + tailskip); buf->len is a small wire-derived value while the iov_lens are at page scale, so the per-section loops legitimately consume far more bytes than buf->len records. The wrapped buf->len then propagates as the authoritative stream bound into every downstream XDR decoder. Fix by clamping the decrement so buf->len bottoms out at zero: buf->len -= min_t(unsigned int, buf->len, len - trim); On the normal path where the iov_lens sum to buf->len, (len - trim) is always <= buf->len and the result is identical to before. No callers change behavior outside the underflow case.

02

Engine v0.6.0

Risk summary

A network attacker can send a crafted RPC message with a malformed Kerberos GSS token to any host running NFS or other RPC services with RPCSEC_GSS Kerberos authentication, triggering an unsigned integer underflow in the XDR buffer length. The corrupted length propagates into downstream XDR decoders as a near-UINT_MAX bound, enabling out-of-bounds memory access that can leak kernel memory, corrupt data, or crash the kernel. No authentication or privileges are required because the bug fires during token unwrapping before auth completes.

Affectednet/sunrpc/xdr.c (SUNRPC XDR)

Vulnerability analysis

When an RPC message protected by Kerberos GSS privacy or integrity is received, the unwrap routine sets the XDR buffer length to a small wire-derived value while the underlying I/O vectors remain at page scale. The buffer-trimming helper then subtracts the total bytes it consumed from that small length without any clamp, causing the unsigned result to wrap to near UINT_MAX. This enormous corrupted length becomes the authoritative stream bound for every downstream XDR decoder, allowing out-of-bounds reads and potential further corruption. The fix clamps the subtraction so the buffer length never drops below zero, leaving all normal code paths unchanged. Any network attacker who can deliver an RPC message to a host running NFS or another RPC service with RPCSEC_GSS Kerberos authentication can trigger this; no credentials or local access are required because the underflow occurs during token unwrapping before authentication completes.

03

BranchIntroducedFixed inPatch commit
5.103.95.10.270a3d77bcd974b
5.153.95.15.221fa16bbe987b4
6.13.96.1.188a924ac4c78af
6.123.96.12.109e6267cccd7b0
6.183.96.18.50ad0cce80d4af
6.63.96.6.1574bf59cb0ea5b
7.23.97.2.485e9602650e9
mainline3.97.33f491306dcb6
cip/5.103.95.10.271-cip78a3d77bcd974b
cip/6.13.96.1.189-cip61a924ac4c78af
cip/6.1-rt3.96.1.189-cip61-rt32a924ac4c78af
cip/6.123.96.12.111-cip32e6267cccd7b0

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Fixed in 5.10.271-cip78
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.268-cip77-rt34)
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)
cip/4.4Affected — no CIP fix yet (latest 4.4.302-cip115)
cip/4.4-rtAffected — no CIP fix yet (latest 4.4.302-cip115-rt63)