UBUNTU-CVE-2026-90125: Medium severity ubuntu/linux-hwe-edge vulnerability
In the Linux kernel, the following vulnerability has been resolved: smb: client: fix request buffer leak in smb2newreadreq() smb2newreadreq() allocates the request buffer with smb2plainreqinit() but only publishes it to the caller with buf = req at the very end of the function. Two error returns sit in between: rc = smb2plainreqinit(SMB2READ, ioparms->tcon, server, (void ) &req, totallen); if (rc) return rc; if (server == NULL) return -ECONNABORTED; [...] rdata->mr = smbdregistermr(server->smbdconn, &rdata->subreq.ioiter, true, needinvalidate); if (!rdata->mr) return -EAGAIN; On either of them the buffer is neither released nor handed back, so it is leaked. The caller cannot clean up after it: smb2asyncreadv() does 'goto out' on a non-zero return, which skips the cifssmallbufrelease(buf) at asyncreadvout, and buf has not been assigned at that point in any case. The write path has never had this problem. smb2asyncwritev() registers the memory region inline and jumps to its release label instead of returning: wdata->mr = smbdregistermr(...); if (!wdata->mr) { rc = -EAGAIN; goto asyncwritevout; } Commit b7972092199f ("cifs: smbd: Retry on memory registration failure") changed both sides from -ENOBUFS to -EAGAIN in a single patch, which puts the two shapes next to each other. Only the -EAGAIN return is reachable in practice, because smb2plainreqinit() calls smb2reconnect() first and that already fails with -EIO when server is NULL, before anything is allocated. Both returns are given the same treatment here rather than leaving one of them correct only by accident. Because -EAGAIN is a replayable error, the failure also reaches the retry block at the end of smb2asyncreadv(), which marks the subrequest NETFSSREQNEEDRETRY, so a failing registration can be retried rather than ending the I/O, and every attempt that reaches it leaks another buffer. smb2shouldreplay() short-circuits on tcon->retry, so on a hard mount the attempt count is not bounded by the retrans setting. Only the asynchronous read path is affected. The synchronous SMB2read() caller passes rdata == NULL and the memory registration block is guarded on rdata. The memory registration failure path was pointed out by the Sashiko AI reviewer while it was reviewing an unrelated patch to smb2asyncreadv().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
In smb2_new_read_req(), ensure both the -ECONNABORTED and memory-registration -EAGAIN error paths release the request buffer allocated by smb2_plain_req_init(), or route through the existing cleanup path, before returning.