CVE-2026-90042: ceph: properly decrypt filenames in vmalloc() buffers
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
ceph: properly decrypt filenames in vmalloc() buffers
The fscrypt subsystem uses the scatterlist crypto API, inheriting its requirement that any buffers are in the linear mapping region. However, the messenger client uses kvmalloc() to create buffers for messages, which will occasionally place those buffers in the vmalloc() region when physical memory fragmentation doesn't permit a large enough kmalloc(). The various callers of ceph_fname_to_usr() directly pass (slices of) raw messages from the MDS without considering that the messages may be in vmalloc() buffers, resulting in oopses especially on non-x86 platforms (see 'Closes:' for more details and a reproducer).
Make ceph_fname_to_usr() explicitly tolerant of vmalloc()-allocated fname->ctext, fname->name, and/or oname->name buffers, using tname (which, when non-null, must be a linear address; when null, is briefly allocated as necessary) as a bounce buffer to avoid passing any inappropriate addresses to fscrypt_fname_disk_to_usr().
Additionally change parse_reply_info_readdir() -- the only function to supply its own tname -- to follow the new "tname must never come from vmalloc()" rule by passing NULL when the message is not in the linear region. Though this causes a per-dentry kmalloc()+kfree(), this overhead exists only when processing the minority of messages that spill into vmalloc(). My (crude) testing puts this at only about 1 in 8,000 readdir messages. Still, if the overhead proves unreasonable in the future, it is easy enough to mitigate: a future change could allocate a bounce buffer in parse_reply_info_readdir() and use that as tname instead.
The Linux kernel CVE team has assigned CVE-2026-90042 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.6 with commit 457117f077c6749d1e28469eae91fb69c9806768 and fixed in 6.18.51 with commit 110747ff535e3d98ac17d68dbd056bb6ef000e23 Issue introduced in 6.6 with commit 457117f077c6749d1e28469eae91fb69c9806768 and fixed in 7.2.5 with commit 3b467c68803d7c7e82678289e598afd44faa6101 Issue introduced in 6.6 with commit 457117f077c6749d1e28469eae91fb69c9806768 and fixed in 7.3-rc1 with commit e939fc6a7bd969a58a150b7f188c1047138403e3
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-90042
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/ceph/crypto.c
fs/ceph/mds_client.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/110747ff535e3d98ac17d68dbd056bb6ef000e23 https://git.kernel.org/stable/c/3b467c68803d7c7e82678289e598afd44faa6101 https://git.kernel.org/stable/c/e939fc6a7bd969a58a150b7f188c1047138403e3