ceph: prevent use-after-free in encode_cap_msg()
In the Linux kernel, the following vulnerability has been resolved: ceph: prevent use-after-free in encode_cap_msg() In fs/ceph/caps.c, in encode_cap_msg(), "use after free" error was caught by KASAN at this line - 'ceph_buffer_get(arg->xattr_buf);'. This implies before the refcount could be increment here, it was freed. In same file, in "handle_cap_grant()" refcount is decremented by this line - 'ceph_buffer_put(ci->i_xattrs.blob);'. It appears that a race occurred and resource was freed by the latter line before the former line could increment it. encode_cap_msg() is called by __send_cap() and __send_cap() is called by ceph_check_caps() after calling __prep_cap(). __prep_cap() is where arg->xattr_buf is assigned to ci->i_xattrs.blob. This is the spot where the refcount must be increased to prevent "use after free" error.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.210, 5.15.149, 6.1.79, 6.6.18, 6.7.6
- CVEs
- CVE-2024-26689
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 19:01 UTC · Revision 1
Source evidence
ceph: prevent use-after-free in encode_cap_msg()
core-osv · Original sourcePublished 3 Apr 2024, 14:54 UTC
In the Linux kernel, the following vulnerability has been resolved: ceph: prevent use-after-free in encode_cap_msg() In fs/ceph/caps.c, in encode_cap_msg(), "use after free" error was caught by KASAN at this line - 'ceph_buffer_get(arg->xattr_buf);'. This implies before the refcount could be increment here, it was freed. In same file, in "handle_cap_grant()" refcount is decremented by this line - 'ceph_buffer_put(ci->i_xattrs.blob);'. It appears that a race occurred and resource was freed by the latter line before the former line could increment it. encode_cap_msg() is called by __send_cap() and __send_cap() is called by ceph_check_caps() after calling __prep_cap(). __prep_cap() is where arg->xattr_buf is assigned to ci->i_xattrs.blob. This is the spot where the refcount must be increased to prevent "use after free" error.
osv:CVE-2024-26689
Kernel
Fixed versions: 5.10.210, 5.15.149, 6.1.79, 6.6.18, 6.7.6
Complete source record
{
"id": "c7f5a0e0d72688017794749d36dfa09a0b0c80c3f297f7a2781b9d915b334140",
"url": "https://osv.dev/vulnerability/CVE-2024-26689",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "ceph: prevent use-after-free in encode_cap_msg()",
"summary": "In the Linux kernel, the following vulnerability has been resolved: ceph: prevent use-after-free in encode_cap_msg() In fs/ceph/caps.c, in encode_cap_msg(), \"use after free\" error was caught by KASAN at this line - 'ceph_buffer_get(arg->xattr_buf);'. This implies before the refcount could be increment here, it was freed. In same file, in \"handle_cap_grant()\" refcount is decremented by this line - 'ceph_buffer_put(ci->i_xattrs.blob);'. It appears that a race occurred and resource was freed by the latter line before the former line could increment it. encode_cap_msg() is called by __send_cap() and __send_cap() is called by ceph_check_caps() after calling __prep_cap(). __prep_cap() is where arg->xattr_buf is assigned to ci->i_xattrs.blob. This is the spot where the refcount must be increased to prevent \"use after free\" error.",
"evidence": "osv:CVE-2024-26689",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.10.210",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.149",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.79",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.18",
"evidence": "/affected/1/ranges"
},
{
"value": "6.7.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2024-26689",
"aliases": [
"CVE-2024-26689"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/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": "9030aaf9bf0a1eee47a154c316c789e959638b0f"
},
{
"fixed": "8180d0c27b93a6eb60da1b08ea079e3926328214"
},
{
"fixed": "70e329b440762390258a6fe8c0de93c9fdd56c77"
},
{
"fixed": "f3f98d7d84b31828004545e29fd7262b9f444139"
},
{
"fixed": "ae20db45e482303a20e56f2db667a9d9c54ac7e7"
},
{
"fixed": "7958c1bf5b03c6f1f58e724dbdec93f8f60b96fc"
},
{
"fixed": "cda4672da1c26835dcbd7aec2bfed954eda9b5ef"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-26689.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.6.34"
},
{
"fixed": "5.10.210"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.149"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.79"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.18"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.7.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-26689.json"
}
}
],
"modified": "2026-10-28T02:30:22.747320208Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/70e329b440762390258a6fe8c0de93c9fdd56c77",
"https://git.kernel.org/stable/c/7958c1bf5b03c6f1f58e724dbdec93f8f60b96fc",
"https://git.kernel.org/stable/c/8180d0c27b93a6eb60da1b08ea079e3926328214",
"https://git.kernel.org/stable/c/ae20db45e482303a20e56f2db667a9d9c54ac7e7",
"https://git.kernel.org/stable/c/cda4672da1c26835dcbd7aec2bfed954eda9b5ef",
"https://git.kernel.org/stable/c/f3f98d7d84b31828004545e29fd7262b9f444139",
"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/26xxx/CVE-2024-26689.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-26689",
"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/2024/26xxx/CVE-2024-26689.json"
}
},
"related_cves": [
{
"value": "CVE-2024-26689",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 488920,
"published_at": "2024-04-03T14:54:50.885+00:00"
}