CVE-2026-138834: xprtrdma: trim head iovec when the payload arrives via a Write chunk
In the Linux kernel, the following vulnerability has been resolved:
xprtrdma: trim head iovec when the payload arrives via a Write chunk
The upper layer sets rqrcvbuf.head[0].iovlen from its estimate of the reply header size. For RPCSECGSS that estimate includes auth->auralign, which gsscreatenew() initializes to GSSVERFSLACK >> 2 (25 XDR words, or 100 bytes) and which is corrected to the real verifier size only after the first reply on that rpcauth has been unwrapped. In this case, the krb5 MIC verifier is 36 bytes, so every request encoded before the first reply completes has a head that is 64 bytes too long.
On TCP this is harmless: xdrrealignpages() moves the excess head bytes, which are genuine reply data, into the page list. With RPC-over-RDMA and a Write chunk (sec=krb5, i.e. RPCGSSSVCNONE, where DDP is allowed), the payload has already been placed directly into the page list, and the receive buffer holds only the inline part of the reply. rpcrdmainlinefixup() clamps its local copy of the head length to the inline length but leaves head.iovlen untouched, so xdrrealignpages() still sees iovlen > cur and shifts whatever lies past the inline reply in the receive buffer into the front of the directly-placed payload:
rpcxdrrecvfrom: head=[...,196] page=524288 tail=[...,64] rpcxdralignment: nfsv4 READ offset=132 copied=64
The first 64 bytes returned by each such READ are incorrect (zeroed, or shifted right by 64 bytes depending on the kernel's xdrshrinkbufhead() implementation). This is readily hit with pNFS flexfiles over RDMA and sec=krb5: the per-DS rpcclnt gets a fresh rpcauth whose first RPC is a large READ. Reads following the first completed reply return the expected data.
Commit cb0ae1fbb2f5 ("xprtrdma: Do not update {head, tail}.iovlen in rpcrdmainlinefixup()") removed the head-length correction while fixing the handling of pure-inline krb5p replies.
When a Write chunk conveyed the payload, trim head.iovlen (in both rqrcvbuf and rqprivatebuf, which calldecode() expects to match) to the inline length actually received so that the XDR layer does not realign the page list. These READ replies have no trailing inline fields, and the payload is already in the page list, so the upper layer's head estimate can be safely reduced. Reduce buflen by the same amount to avoid treating unused head capacity as additional tail capacity. Pure inline replies and Reply chunk replies are unchanged.
Tested on Linux 6.8.0 and 7.3-rc4 with NFSv4.1 pNFS flexfiles over RPC/RDMA and sec=krb5.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Compensating control
When an RPC-over-RDMA Write chunk conveys the payload, trim head.iov_len in both rq_rcv_buf and rq_private_buf to the inline length actually received, and reduce buflen by the same amount.
Event History
Frequently Asked Questions
Which configurations are exposed to this issue?
The affected path requires RPC-over-RDMA with a Write chunk, using sec=krb5 with RPC_GSS_SVC_NONE. This is the mode in which direct data placement is allowed and payload data is placed directly into the page list.
When does the incorrect receive-buffer sizing occur?
It can occur for requests encoded before the first reply using a given RPC authentication context has completed. Until that reply is unwrapped, the RPCSEC_GSS alignment estimate includes 100 bytes of verifier slack rather than the actual 36-byte Kerberos MIC verifier size.