GHSA-2F7P-H662-999P
Vulnerability from github – Published: 2026-09-17 18:31 – Updated: 2026-09-17 18:31In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix request buffer leak in smb2_new_read_req()
smb2_new_read_req() allocates the request buffer with smb2_plain_req_init() but only publishes it to the caller with *buf = req at the very end of the function. Two error returns sit in between:
rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, server,
(void **) &req, total_len);
if (rc)
return rc;
if (server == NULL)
return -ECONNABORTED;
[...]
rdata->mr = smbd_register_mr(server->smbd_conn,
&rdata->subreq.io_iter,
true, need_invalidate);
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: smb2_async_readv() does 'goto out' on a non-zero return, which skips the cifs_small_buf_release(buf) at async_readv_out, and buf has not been assigned at that point in any case.
The write path has never had this problem. smb2_async_writev() registers the memory region inline and jumps to its release label instead of returning:
wdata->mr = smbd_register_mr(...);
if (!wdata->mr) {
rc = -EAGAIN;
goto async_writev_out;
}
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 smb2_plain_req_init() calls smb2_reconnect() 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 smb2_async_readv(), which marks the subrequest NETFS_SREQ_NEED_RETRY, so a failing registration can be retried rather than ending the I/O, and every attempt that reaches it leaks another buffer. smb2_should_replay() 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 SMB2_read() 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 smb2_async_readv().
{
"affected": [],
"aliases": [
"CVE-2026-90125"
],
"database_specific": {
"cwe_ids": [],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-09-17T17:17:04Z",
"severity": null
},
"details": "In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fix request buffer leak in smb2_new_read_req()\n\nsmb2_new_read_req() allocates the request buffer with\nsmb2_plain_req_init() but only publishes it to the caller with\n*buf = req at the very end of the function. Two error returns sit in\nbetween:\n\n\trc = smb2_plain_req_init(SMB2_READ, io_parms-\u003etcon, server,\n\t\t\t\t (void **) \u0026req, total_len);\n\tif (rc)\n\t\treturn rc;\n\n\tif (server == NULL)\n\t\treturn -ECONNABORTED;\n\t[...]\n\t\trdata-\u003emr = smbd_register_mr(server-\u003esmbd_conn,\n\t\t\t\t\t \u0026rdata-\u003esubreq.io_iter,\n\t\t\t\t\t true, need_invalidate);\n\t\tif (!rdata-\u003emr)\n\t\t\treturn -EAGAIN;\n\nOn either of them the buffer is neither released nor handed back, so\nit is leaked. The caller cannot clean up after it: smb2_async_readv()\ndoes \u0027goto out\u0027 on a non-zero return, which skips the\ncifs_small_buf_release(buf) at async_readv_out, and buf has not been\nassigned at that point in any case.\n\nThe write path has never had this problem. smb2_async_writev()\nregisters the memory region inline and jumps to its release label\ninstead of returning:\n\n\twdata-\u003emr = smbd_register_mr(...);\n\tif (!wdata-\u003emr) {\n\t\trc = -EAGAIN;\n\t\tgoto async_writev_out;\n\t}\n\nCommit b7972092199f (\"cifs: smbd: Retry on memory registration\nfailure\") changed both sides from -ENOBUFS to -EAGAIN in a single\npatch, which puts the two shapes next to each other.\n\nOnly the -EAGAIN return is reachable in practice, because\nsmb2_plain_req_init() calls smb2_reconnect() first and that already\nfails with -EIO when server is NULL, before anything is allocated.\nBoth returns are given the same treatment here rather than leaving\none of them correct only by accident.\n\nBecause -EAGAIN is a replayable error, the failure also reaches the\nretry block at the end of smb2_async_readv(), which marks the\nsubrequest NETFS_SREQ_NEED_RETRY, so a failing registration can be\nretried rather than ending the I/O, and every attempt that reaches it\nleaks another buffer. smb2_should_replay() short-circuits on\ntcon-\u003eretry, so on a hard mount the attempt count is not bounded by\nthe retrans setting.\n\nOnly the asynchronous read path is affected. The synchronous\nSMB2_read() caller passes rdata == NULL and the memory registration\nblock is guarded on rdata.\n\nThe memory registration failure path was pointed out by the Sashiko\nAI reviewer while it was reviewing an unrelated patch to\nsmb2_async_readv().",
"id": "GHSA-2f7p-h662-999p",
"modified": "2026-09-17T18:31:52Z",
"published": "2026-09-17T18:31:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-90125"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/12092ed28434bf41e08d41e3c5269eb6b337fc02"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/442c5f1358ced0d4e716778ac06f1e323a7e4f21"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/58066940076b90c16e821fd6f9767cd979cbdb5e"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/73f6bdb0380486ab37fe12cd74de20abfaf5d3ae"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/deb6468f4164640e4dc875f008aa449cf55987a5"
}
],
"schema_version": "1.4.0",
"severity": []
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.