CVE-2026-80558: libceph: Avoid using invalid osd indices from primary_temp
In the Linux kernel, the following vulnerability has been resolved:
libceph: Avoid using invalid osd indices from primarytemp
A corrupted osdmap received from a Ceph monitor or OSD may contain osd indices in its pgtemp, primarytemp, pgupmap, and pgupmapitems parts that don't exist, i.e., that are greater than maxosd or smaller than CEPHHOMELESSOSD (-1). These indices are used to create the up and acting set in cephpgtoupactingosds(), called from calctarget(). While most of these osd indices are checked, the one from primarytemp is not. Subsequently, this may lead to calctarget() returning this (potentially invalid) index as target osd for a (linger) request. Because the osdstate, osdweight, and osdaddr arrays only contain maxosd entries (with indices 0 to maxosd -1), this leads to out-of-bounds accesses when trying to read values from these arrays.
This patch fixes the issue by adding a check to gettemposds(), so that only valid osd indices from primarytemp are used, and it falls back to using the primary from pgtemp or the up set if it is invalid.
[ idryomov: changelog ]
Affected Software
Event History
Frequently Asked Questions
What condition is required to trigger the out-of-bounds access?
A Ceph client must process a corrupted OSD map received from a Ceph monitor or OSD. The map must contain a primary_temp OSD index greater than max_osd or less than CEPH_HOMELESS_OSD (-1), and that value must be selected as the target OSD for a request.
Which systems are exposed?
Systems using the Linux kernel's libceph code and communicating with Ceph monitors or OSDs are the relevant population. The issue concerns processing of received OSD maps, not merely the presence of an OSD map on disk.
What happens when an invalid primary_temp index is used?
calc_target() can return the invalid index as the target OSD for a linger request. Subsequent reads of the osd_state, osd_weight, or osd_addr arrays can access memory out of bounds because those arrays contain entries only for indices from 0 through max_osd - 1.
What behavior does the fix introduce?
The fix validates indices from primary_temp in get_temp_osds(). If the primary_temp index is invalid, it falls back to the primary from pg_temp or from the up set.