{"id":"CVE-2024-26689","summary":"ceph: prevent use-after-free in encode_cap_msg()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nceph: prevent use-after-free in encode_cap_msg()\n\nIn fs/ceph/caps.c, in encode_cap_msg(), \"use after free\" error was\ncaught by KASAN at this line - 'ceph_buffer_get(arg-\u003exattr_buf);'. This\nimplies before the refcount could be increment here, it was freed.\n\nIn same file, in \"handle_cap_grant()\" refcount is decremented by this\nline - 'ceph_buffer_put(ci-\u003ei_xattrs.blob);'. It appears that a race\noccurred and resource was freed by the latter line before the former\nline could increment it.\n\nencode_cap_msg() is called by __send_cap() and __send_cap() is called by\nceph_check_caps() after calling __prep_cap(). __prep_cap() is where\narg-\u003exattr_buf is assigned to ci-\u003ei_xattrs.blob. This is the spot where\nthe refcount must be increased to prevent \"use after free\" error.","modified":"2026-03-20T12:35:08.269505Z","published":"2024-04-03T14:54:50.885Z","related":["SUSE-SU-2024:1490-1","SUSE-SU-2024:1641-1","SUSE-SU-2024:1642-1","SUSE-SU-2024:1643-1","SUSE-SU-2024:1645-1","SUSE-SU-2024:1646-1","SUSE-SU-2024:1647-1","SUSE-SU-2024:1650-1","SUSE-SU-2024:1659-1","SUSE-SU-2024:1663-1","SUSE-SU-2024:1870-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/26xxx/CVE-2024-26689.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/70e329b440762390258a6fe8c0de93c9fdd56c77"},{"type":"WEB","url":"https://git.kernel.org/stable/c/7958c1bf5b03c6f1f58e724dbdec93f8f60b96fc"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8180d0c27b93a6eb60da1b08ea079e3926328214"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ae20db45e482303a20e56f2db667a9d9c54ac7e7"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cda4672da1c26835dcbd7aec2bfed954eda9b5ef"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f3f98d7d84b31828004545e29fd7262b9f444139"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/26xxx/CVE-2024-26689.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26689"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"9030aaf9bf0a1eee47a154c316c789e959638b0f"},{"fixed":"8180d0c27b93a6eb60da1b08ea079e3926328214"},{"fixed":"70e329b440762390258a6fe8c0de93c9fdd56c77"},{"fixed":"f3f98d7d84b31828004545e29fd7262b9f444139"},{"fixed":"ae20db45e482303a20e56f2db667a9d9c54ac7e7"},{"fixed":"7958c1bf5b03c6f1f58e724dbdec93f8f60b96fc"},{"fixed":"cda4672da1c26835dcbd7aec2bfed954eda9b5ef"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-26689.json"}}],"schema_version":"1.7.5"}