cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size()
In the Linux kernel, the following vulnerability has been resolved: cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size() When the else branch of cifs_file_set_size() finds a writable file handle via find_writable_file(), it borrows tcon and server from the handle's tlink, attempts the handle-based set_file_size() RPC, and then releases the handle with cifsFileInfo_put(). If set_file_size() fails, execution falls through to the path-based fallback, which reuses the borrowed tcon and server under the "if (tcon == NULL)" guard. Since tcon is not NULL at that point, the guard is skipped. If cifsFileInfo_put() dropped the last reference on a tlink that was already removed from the tlink tree (TCON_LINK_IN_TREE cleared, as happens during reconnection or session teardown), cifs_put_tlink() will have freed tcon; the subsequent set_path_size() call is then a use-after-free. Setting tcon = NULL after cifsFileInfo_put() causes the existing guard to take the cifs_sb_tlink() path, which acquires a fresh reference for the path-based operation or fails cleanly if the session is gone.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.18.50, 7.2.4
- CVEs
- CVE-2026-89641
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 19:32 UTC · Revision 1
Source evidence
cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size()
core-osv · Original sourcePublished 11 Sept 2026, 19:45 UTC
In the Linux kernel, the following vulnerability has been resolved: cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size() When the else branch of cifs_file_set_size() finds a writable file handle via find_writable_file(), it borrows tcon and server from the handle's tlink, attempts the handle-based set_file_size() RPC, and then releases the handle with cifsFileInfo_put(). If set_file_size() fails, execution falls through to the path-based fallback, which reuses the borrowed tcon and server under the "if (tcon == NULL)" guard. Since tcon is not NULL at that point, the guard is skipped. If cifsFileInfo_put() dropped the last reference on a tlink that was already removed from the tlink tree (TCON_LINK_IN_TREE cleared, as happens during reconnection or session teardown), cifs_put_tlink() will have freed tcon; the subsequent set_path_size() call is then a use-after-free. Setting tcon = NULL after cifsFileInfo_put() causes the existing guard to take the cifs_sb_tlink() path, which acquires a fresh reference for the path-based operation or fails cleanly if the session is gone.
osv:CVE-2026-89641
Kernel
Fixed versions: 6.18.50, 7.2.4
Complete source record
{
"id": "8297a57bb8b81a3e66043fecb98915149bd83f418d4f147bff132ecff8dca0c8",
"url": "https://osv.dev/vulnerability/CVE-2026-89641",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size()",
"summary": "In the Linux kernel, the following vulnerability has been resolved: cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size() When the else branch of cifs_file_set_size() finds a writable file handle via find_writable_file(), it borrows tcon and server from the handle's tlink, attempts the handle-based set_file_size() RPC, and then releases the handle with cifsFileInfo_put(). If set_file_size() fails, execution falls through to the path-based fallback, which reuses the borrowed tcon and server under the \"if (tcon == NULL)\" guard. Since tcon is not NULL at that point, the guard is skipped. If cifsFileInfo_put() dropped the last reference on a tlink that was already removed from the tlink tree (TCON_LINK_IN_TREE cleared, as happens during reconnection or session teardown), cifs_put_tlink() will have freed tcon; the subsequent set_path_size() call is then a use-after-free. Setting tcon = NULL after cifsFileInfo_put() causes the existing guard to take the cifs_sb_tlink() path, which acquires a fresh reference for the path-based operation or fails cleanly if the session is gone.",
"evidence": "osv:CVE-2026-89641",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.18.50",
"evidence": "/affected/1/ranges"
},
{
"value": "7.2.4",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2026-89641",
"aliases": [
"CVE-2026-89641"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "110fee6b9bb58a5c50047fc2594d415f741b591e"
},
{
"fixed": "4f18c9e7ee464aaae5cd9fccdb943b3fcb4655d4"
},
{
"fixed": "4bea15d9c7683218f57b8c1f5f0aa75cab76af8d"
},
{
"fixed": "b96db32fed8dfb2478d7c208f89bf383beed1535"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-89641.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.18.0"
},
{
"fixed": "6.18.50"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.19.0"
},
{
"fixed": "7.2.4"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-89641.json"
}
}
],
"modified": "2026-10-28T02:30:22.627368627Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/4bea15d9c7683218f57b8c1f5f0aa75cab76af8d",
"https://git.kernel.org/stable/c/4f18c9e7ee464aaae5cd9fccdb943b3fcb4655d4",
"https://git.kernel.org/stable/c/b96db32fed8dfb2478d7c208f89bf383beed1535",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/89xxx/CVE-2026-89641.json",
"https://nvd.nist.gov/vuln/detail/CVE-2026-89641",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/89xxx/CVE-2026-89641.json"
}
},
"related_cves": [
{
"value": "CVE-2026-89641",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 489208,
"published_at": "2026-09-11T19:45:34.036+00:00"
}